Hi!
I don't know much about MicroPython yet but I've been programming in CPython for years. Please let me know if the following is not really a valid use-case for MicroPython, or if it's not likely to help me out much.
I want to start to develop for a somewhat constrained SBC running Debian and later shrink to an MCU. For ease of development I was considering implementing my first iteration in CPython and then reimplementing in C/C++ for RTOS or baremetal MCU. When I discovered MicroPython I thought potentially I could start with it on the SBC and reduce some of the reimplementation effort as I further constrain my hardware.
My reason for wanting to start with an SBC running Debian is for the USB drivers; I need to read a sensor that demands a USB host, and the network stack will be handy.
In future iterations I hope to eliminate the need for the bloat of USB, and to switch to an embedded cell module (UART) for internet comms.
Thanks!
David
Newbie questions about reasons to use MicroPython
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Newbie questions about reasons to use MicroPython
You can run the Unix build of MP under Debian. MP aims to be a compatible subset of CPython, so developing under the Unix build of MP is ideal if you plan to port your code to a microcontroller. Porting effort should then be merely to accommodate hardware differences.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Newbie questions about reasons to use MicroPython
The only limitation will be accessing hardware features from the unix build of micropython. There are a wide variety of CPython libraries for working with the Linux gpio/spi/i2c devices (e.g. https://pypi.org/project/spidev/ ) but "out of the box" the MicroPython port for Linux has none of these features, but this shouldn't be a showstopper (e.g. you could access gpio sysfs via file i/o).pythoncoder wrote: ↑Sat Jun 11, 2022 7:43 amYou can run the Unix build of MP under Debian. MP aims to be a compatible subset of CPython, so developing under the Unix build of MP is ideal if you plan to port your code to a microcontroller. Porting effort should then be merely to accommodate hardware differences.
Re: Newbie questions about reasons to use MicroPython
I've been programming microcontrollers in upython for a couple of years now & repl development is nice. But I sometimes wonder if the time saved by not having to recompile after each code change is not lost by trying to find upython libs to match the wealth of stuff out there in C++ ?
Every time I want to use lora on a new lora equipped esp32 board for example it's a big deal to find the right upython drivers for that board, when they're ready to go in the arduino style IDE.
Every time I want to use lora on a new lora equipped esp32 board for example it's a big deal to find the right upython drivers for that board, when they're ready to go in the arduino style IDE.