-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add support for Lego EV3 MicroPython #43
Comments
Hi, thanks for the idea. I will look further into it, but as I do not own an EV3 brick myself, I am not sure if I will be able to generate the stubs for it. Have you tried executing If the stubs generate successfully, you could either provide them to me or create a PR on micropy-stubs to add them for everyone. Let me know if you're able to make any progress with this. Thanks. |
There is no micropython repl on uart, but there is ssh access to ev3. Just need to understand what scripr i need to run on ev3 to generate stubs. |
Can you add option to generate stubber as file? |
Interesting. So micropy-cli uses micropython-stubber for its stub generation. Essentially, you need to do the following:
If you run into any memory related errors, you can use my fork of the repo, make your module edits, then execute For finding the EV3 modules you can reference their documentation and try executing If you run into any trouble, I am happy to help. |
There custom Lego build of micropython - pybricks-micropython (MicroPython v1.9.4 on 2019-03-26; linux version) with differences in 'os' module, so i change createstubs in several places with os and firmware version parsing. It is generating stubs for everything but custom modules. And i don't know why... |
Sure, I'd love to take a look at it! |
What is the best way to give you access credential? |
Hi, I think that what is happening is that there is no way for a .py script to find out which modules there are on the firmware. the only way is to issue the command : so the approach that I have uses in micro-stubber is :
so : you need to add the LEGO specific ones . #.... at the very end
stubber.add_modules(['pybricks']) # stubs for LEGO Pybricks
stubber.create_all_stubs() run createsubs.py , ie brickrun createstubs.py retrieve (upload..) the stubs from the brick to your PC ( and please share or send a PR to https://github.com/josverl/micropython-stubber including any license ( MIT?) that is relevant for LEGO ) |
also if you have a list of LEGO specific MicroPython modules , i can just add them to the list of modules to try for micros-stubber. |
help('modules') show modules without any problems:
But when i add stubber.add_modules(['pybricks/ev3brick']) I got only this as result MCU: posixStubber: 1.2.0display = None |
Okay, that is helpful I suspect that has something to do with nested modules ( module/submodule and even module/sub/leaf ) have you tried |
also likely relevant : a manual stubbing exercise : https://github.com/drewwhis/pybricks-stubs |
Already use it. But automation with micropy-cli will be better. |
Checked both: |
@Josverl, thanks for your help. I don't really know much about the EV3 products. @vbolshakov, agreed. When I get to a desktop later today I will look at this in more detail. |
@vbolshakov, I suppose I could add pybricks-stubs to micropy-stubs until Josverl/micropython-stubber#7 is solved. Sound good for now? |
Yes. |
Basic Frozen Modules for EV3 pybricks, see BradenM/micropy-cli#43 and Josverl/micropython-stubber#7
Okay, went ahead and added what I could. Since it's only the extra modules from This seemed to work pretty well for me while I was testing it: micropy stubs add ev3-pybricks-0.0.1
micropy stubs add esp32-micropython-1.9.4 # Someone mentioned PyBricks was based on 1.9.4? {
"name": "NewProject",
"stubs": {
"esp32-micropython-1.9.4": "1.2.0",
"ev3-pybricks-0.0.1": "1.2.0"
},
"config": {
"vscode": true,
"pylint": true
},
"packages": {},
"dev-packages": {}
} I will leave this issue open until we can manage a full package from the EV3. |
@vbolshakov |
Closed via BradenM/micropy-stubs#3 and Josverl/micropython-stubber#7 Also, as I edited here, did not mean to bash on @Josverl 's work (my own, rather) haha. |
Basic Frozen Modules for EV3 pybricks, see BradenM/micropy-cli#43 and Josverl/micropython-stubber#7
Add support for Lego EV3 MicroPython. https://education.lego.com/en-us/support/mindstorms-ev3/python-for-ev3
The text was updated successfully, but these errors were encountered: