Live data from Hacker News

MicroPython – Python for Microcontrollers

micropython.org

41–50 of 106 posts

Re: MicroPython – Python for Microcontrollers

#41

A language with meaningful whitespace and indentation does not make a good language for UART or other serial interaction. At the point you can use a higher level interaction, why stop at Python? Go full codeless checkboxes on webpages. If the alleged problem that micropython solves is complexity of actually coding microcontrollers, why settle for Python, which can only ever wrap/call native functionality that is hidd…

> A language with meaningful whitespace and indentation does not make a good language for UART or other serial interaction

I mean its almost irrelevant to the ability to handle serial, unless you are exec'ing raw serial, which is going to make everyone sad.

I have found that bitbanging in python a bit of an arse. Using the struct library isn't as forgiving (or dangerous) as it is in C. But on the flip side it does force you to properly define your binary serial protocol, unless you want loads of exceptions.

Arduino is grand, and fun. But where the python like languages shine is higher level stuff, like networking.

Re: MicroPython – Python for Microcontrollers

#42

Another alternative is rust. https://github.com/rust-embedded/awesome-embedded-rust I intend to have a try of both rust and tinygo. Micropython is only ok on an esp32 with psram.

I think rust is the way to go, it provides granular control if needed and strong type annotations and the borrow features. however, C is here to stay for an eternity.

COBOL and Fortran as well, so what.

Re: MicroPython – Python for Microcontrollers

#43

Earlier quoted context omitted.

One thing to add from my experiences: it's dramatically more accessible to beginners than Arduino and way more useful for building one-offs/prototypes as well.

My personal experience was the opposite. I own two identically equipped boards: the Seeed Studio ArchMix and the Teensy 4.1 On the archmix, I managed to boot up and that’s about it. There was literally a REPL and I was able to blink the LED and then I couldn’t proceed further, where was I supposed to code? Bad experience. Teensy: connect the board , fire up the teensyduino ide, choose an interesting example from the…

I agree that the user experience, onboarding etc. are very well executed for Arduino (and especially for the ESP32 port of uPython could use some polishing)...

> rinse and repeat until you are familiar with idioms for all sorts of things

Except that the idioms you learn are really not suitable for anything but toy examples. Arduino is rotten from the core: "setup", "loop" and "delay" are the worst imaginable way to write embedded software, yet everyone coming from Arduino thinks this is how well written embedded software should look.

Re: MicroPython – Python for Microcontrollers

#44

Hm, interesting. I remember the upcome of Arduino: They advertised their system (setup() once, loop() forever) as very friendly towards tinkerers using 8bit uControllers. Anybody could jump straight ahead without setting up anything in ASM let alone programming the EEPROM externally. With hardware progress (ESP32 is 32bit/80MHz+), it seems another iteration happened: processing power is traded again for accessability…

All of this only applies to hobbists. Serious shops have been using 32 bit mcus since the mid 00s and if you even think about putting an interpreter in there, a senior software engineer will probably kill you in your sleep. Rightfully so.

Re: MicroPython – Python for Microcontrollers

#45

I did a lot of product development using Micropython over the past year or so. There are certain things it is very good at - one is rapid prototyping. For instance it’s a lot easier and faster and less verbose to quickly get some http server communication going on the ESP32 in Micropython rather than the C equivalent. The downsides are somewhat dramatic though - it’s, of course, a lot slower and hungrier for memory t…

The company I work for uses MicroPython commercially to build medical devices. It hasn't fallen apart for us.

Indeed, it's helped deliver high-quality solutions quickly...

Re: MicroPython – Python for Microcontrollers

#47

Hm, interesting. I remember the upcome of Arduino: They advertised their system (setup() once, loop() forever) as very friendly towards tinkerers using 8bit uControllers. Anybody could jump straight ahead without setting up anything in ASM let alone programming the EEPROM externally. With hardware progress (ESP32 is 32bit/80MHz+), it seems another iteration happened: processing power is traded again for accessability…

All of this only applies to hobbists. Serious shops have been using 32 bit mcus since the mid 00s and if you even think about putting an interpreter in there, a senior software engineer will probably kill you in your sleep. Rightfully so.

Not in my experience; 32 bit MCUs are cheap and powerful these days and reducing the development time by a significant margin - our projects have seen 15-30% reductions compared to our equivalent C estimates - is well worth considering. I'd be more worried about senior engineers that didn't take that seriously.

Re: MicroPython – Python for Microcontrollers

#48
post #16

A possible alternative to MicroPython is Nim - it's a strongly typed language with Python-like syntax that compiles down to C. Since it compiles to C, it can use existing C libraries without much fuss (just wrap signatures as needed), plus there's no need for a "micro" version of the language. Several members of the community have been working on improving the embedded ecosystem: although I haven't played around with…

Nim, Zig, Julia, Rust, so many languages lately ... anyone else with language-choice anxiety?

Re: MicroPython – Python for Microcontrollers

#49

Earlier quoted context omitted.

What did you end up using MicroPython for?

My company uses it for medical device development, ama if it will help!

Very cool.

Are you prototyping or manufacturing at scale?

What kind of sensors have you attached?

Re: MicroPython – Python for Microcontrollers

#50

I did a lot of product development using Micropython over the past year or so. There are certain things it is very good at - one is rapid prototyping. For instance it’s a lot easier and faster and less verbose to quickly get some http server communication going on the ESP32 in Micropython rather than the C equivalent. The downsides are somewhat dramatic though - it’s, of course, a lot slower and hungrier for memory t…

The company I work for uses MicroPython commercially to build medical devices. It hasn't fallen apart for us. Indeed, it's helped deliver high-quality solutions quickly...

You have to have the right people. They have to like Python and want to use it, but not because they think "C is too hard". They have to be happy writing Python code and confident enough to write modules in C and work on MicroPython itself.

There is some steps necessary to go from "prototyping MicroPython" to "production MicroPython" and many people either forget about them, are not skilled enough to do them (which is fine, MicroPython is about onboarding people to embedded as well) or they feel like these steps make using MicroPython pointless.

Post reply on HN