-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate a hub API from a dump. #7
Comments
i made a functioning disassembler for micropython. Should i post is somewhere in this repo or put it somewhere else? It can be used to disassemble correctly all of hub_runtime.mpy. |
😲 Wow that's amazing! I'm more than happy to add it to this repo or just add links to your repo, is it written in python? I was at some point going to add a |
It is written in typescript, not in python, but it depends on some micropython source files... Yes, it is an absolute mess. |
See #10 |
Is there a list of all functions somewhere? I manually tried to call each function and recorded what they did and how to call them. |
There's the official documentation which has some of the functions in it, but not most. I've been using this dump-api.py script to extract information from the hub, but the limited ram on the hub makes it harder than it needs to be. Also there's no way of determining the arguments of the functions or classes from the dump. A better approach would probably be to decompile the files and extract the functions and their argument counts / named arguments. However, this won't get the functions that are baked into the firmware, so something needs to be done about that too. TLDR: Nope, no list of functions yet. |
Just to add to this, the internal |
if you want I could paste somewhere my function reference when I am done. I am currently a bit stuck in the async part with VirtualMachine from runtime. I am trying to run code async but even though asyncio seems to be there somehow I am not sure how to control it |
Sounds good, there's also a goal to add the official api docs here: #9 which I have yet to get to. |
This is what I have so far. I will continue to post here:
|
a little more:
|
All the internals (
VCP stands for Virtual Com Port |
LEGO has released some documentation: https://lego.github.io/MINDSTORMS-Robot-Inventor-hub-API/index.html |
Using the
dump-api.py
script from the simulator it's possible to get what I hope is all the functions available on the hub (along with lots of other information)What is needed:
help("modules")
prints to stdout, but on the hub this cannot be redirected because the micropython version is too old.The text was updated successfully, but these errors were encountered: