Live data from Hacker News

MicroPython – Python for Microcontrollers

micropython.org

31–40 of 106 posts

Re: MicroPython – Python for Microcontrollers

#31
post #30

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…

> It falls apart when you need to work with it professionally though More accurately: it falls apart when you need it professionally :) Totally depends on the usecase.

What did you end up using MicroPython for?

Re: MicroPython – Python for Microcontrollers

#32
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 hidden like a black box?

Is this really easy or useful at all?

A superior solution already exists called “Arduino” that removes most of the complexity of microcontroller development, comes with an ide and loader tool chain and you press a button and Bingo, your code is running directly on the metal of a variety of hardware, which these days includes some of the most powerful microcontrollers out there such as the teensy 4 and its iMX RT1062

I have an archmix with the identical microcontroller, but with a micropython runtime, it was sold by seeed studio and it sits in the box it came in as I never managed to do much with it.

There’s really no effective way of avoiding hardware with microcontrollers, as you expressly access it’s features with no operating system and only a HAL or CMSIS for an API, most of the time.

By the time someone wraps all hardware functionality in a scripting language, much developer time has passed and it’s likely that features are missing or broken, and basically the noobs are still out of luck waiting for all promised supported functionality and discouraged from learning anything about the actual hardware platform

Re: MicroPython – Python for Microcontrollers

#33

I hope we see JS for microcontrollers fast enough so we can enjoy bloated Electron apps running on microcontrollers. :) I mean, who wants anything but the fastest, leanest languages running on microcontrollers?

That's good bait. In fact, I've almost reflexively down-voted you after reading the first line.

Re: MicroPython – Python for Microcontrollers

#34

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…

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 drop down menu, run it, rinse and repeat until you are familiar with idioms for all sorts of things, real hardware examples they do real things, real peripheral support in the form of examples

Re: MicroPython – Python for Microcontrollers

#35
post #33

I hope we see JS for microcontrollers fast enough so we can enjoy bloated Electron apps running on microcontrollers. :) I mean, who wants anything but the fastest, leanest languages running on microcontrollers?

That's good bait. In fact, I've almost reflexively down-voted you after reading the first line.

Hardware utilization and capacities matter if you have kilobytes of ram and megahertz of cpu speed

Re: MicroPython – Python for Microcontrollers

#36
I use a hybrid architecture that is working quite well for interactives in my little corner of the museum industry. I pair a raspi running either node-red or python with a Teensy coprocessor running embedded C code and handling the IO. The two communicate via UART serial via either firmata or a custom protocol as the project requires. Having the Teensy handle IO lets me tie directly into pin interrupts, FlexIO, DMA and other hardware goodies with the very well written PJRC libraries. At the same time, the raspi handles any network connectivity, timekeeping, controller coordination, and HDMI output. I get all the rapid prototyping ability of python or node-red while at the same time having all the raw bit banging power of C on a Teensy 4 at 600mhz.

Re: MicroPython – Python for Microcontrollers

#38
post #30

Earlier quoted context omitted.

> It falls apart when you need to work with it professionally though More accurately: it falls apart when you need it professionally :) Totally depends on the usecase.

What did you end up using MicroPython for?

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

Re: MicroPython – Python for Microcontrollers

#39

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.

"...only ok on an esp32 with psram"??

I use it on many devices (rp2040, nRF52, ESP32 and, professionally, on STM32). It's an effective platform on all of them.

Re: MicroPython – Python for Microcontrollers

#40

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…

Yes, I have been using MicroPython on ESP32 and RPi Pico. For projects like home automation, it was super easy and handy. When I started building a game console using RPi Pico ( https://github.com/codetiger/GameTiger-Console ), I had to rewrite as Python interpreter takes a lot of memory and leaves very little for the application. In my case, I had to avoid using Framebuffer on MicroPython. After switching to C++, it…

I think what used to be BASIC / Assembly relationship back when hardware comparable to ESP32 used to take a whole desk, is now Python / C++ instead.
Post reply on HN