Live data from Hacker News

Embedded Python: MicroPython Is Amazing

hackaday.com

11–16 of 16 posts

Re: Embedded Python: MicroPython Is Amazing

#11

I've tried to use micropython a few times, and it just didn't gel for me. All the examples I've found seem to center around doing things interactively in the CLI. Do people write code like that? I write a lot of python and I maybe interact directly with a REPL for 5 minutes in a month. There was no good tooling for managing a set of script files on the embedded device, and as soon as I had something mildly complex (o…

Have you tried `mpremote`? It's the standard tool by the MicroPython team that allows - among other features - you to mount your PC filesystem on a MicroPython device. It's a very productive way to develop! Update code on your PC, mount, try it out. Rinse, repeat. No compilation/deploy cycle makes for fast iterations.

But to answer your questions directly, yes, I do use the REPL quite a lot to experiment and figure out how the system works.

I'm surprised that you had OOM errors, especially on an ESP32 where there's usually plenty of headroom. I haven't seen an OOM error - except when I've made a mistake - in years.

Re: Embedded Python: MicroPython Is Amazing

#14
post #7

On the note of testing I2C devices: hook them up to any VGA or HDMI port and you are good to go with a complete OS. I even have some sensors running that way on my server for domotica needs.

I don't get it. How does one use vga or HDMI to hook up i2c?

You literally just hook a device up to pin 15/16 on an HDMI port.

https://mitxela.com/projects/ddc-oled

DDC is how your OS reads the list of supported resolutions from your display and is present on VGA ports as well. It's just a low speed i2c bus and can be used for other things :)

Re: Embedded Python: MicroPython Is Amazing

#15

I just want a simple SMALL embeddable python library for my C programs... but I have yet to find a good one.

You may want to consider Asp. It is python like language thats interpreter is designed for embedded usage. https://www.asplang.org/ Also fully fuzzy tested to not ever crash regardless of the bytecode given to it.

Thanks, it does look neat, and relatively small I guess, but I should have clarified my definitions.

By small I meant like, at most only a few files in a single folder I can just drop into a project and be off running quickly and easily. Seeing cmake in that repo for example was a big sign that it's still way too big for what I want.

Re: Embedded Python: MicroPython Is Amazing

#16
post #14

Earlier quoted context omitted.

I don't get it. How does one use vga or HDMI to hook up i2c?

You literally just hook a device up to pin 15/16 on an HDMI port. https://mitxela.com/projects/ddc-oled DDC is how your OS reads the list of supported resolutions from your display and is present on VGA ports as well. It's just a low speed i2c bus and can be used for other things :)

That's so cool. I just recently saw a more recent impl of this: copying fb over spi on rpi. This approach is much more clever and equally useless
Post reply on HN