Live data from Hacker News

MicroPython

micropython.org

111–120 of 152 posts

Re: MicroPython

#111

MicroPython is stellar. If you're building an embedded system for people to hack and customize, make the highest level abstraction of the embedded system in MicroPython so that users can easily modify/patch/contribute/hack your system with ease. This is what Arduino and Arduino IDE did for millions of hobbyist, but it is time to ditch C/C++ for MicroPython. In this [1] PyCon talk by Matt Trentini, a demo of QR code g…

The biggest thing you are underselling (if at all), is that you can have a repl directly into the device itself and doing lots of exploratory programming directly in-circuit.

Yes, this is a complete game-changer; I love showing experienced embedded engineers how to connect to the REPL, and poke live, interactive I2C or SPI at a peripheral. :)

Re: MicroPython

#112
post #76

MicroPython is stellar. If you're building an embedded system for people to hack and customize, make the highest level abstraction of the embedded system in MicroPython so that users can easily modify/patch/contribute/hack your system with ease. This is what Arduino and Arduino IDE did for millions of hobbyist, but it is time to ditch C/C++ for MicroPython. In this [1] PyCon talk by Matt Trentini, a demo of QR code g…

The one big issue I've had with MicroPython is that it's a PITA to manage files on it. I use this hacky tool called "ampy" to do it, and wish that the device could just be mounted as a media device. CircuitPython, however, does accomplish this, with the microcontroller showing up just like a USB drive.

Bit of shameless plug, but I put this [0] together to make it easy to build a simple, flashable MicroPython image with your code included.

[0] - https://github.com/dcmorton/esp32-micropython-image-builder

Re: MicroPython

#113

Neat, but not very practical. To be of any use you still need board support to drive the I2C, SPI, etc which means you have to use C anyhow. You can buy one of their boards with the BSP but that's over $40, yikes. To use micropython you need at least an M4 class micro-controller so that a $5 or greater part. Or you could just stick with C and use a M0 class micro that costs A difference of $40 in BOM cost makes it on…

Going to disagree here, i2c and spi work fine in micropython. Is it as fast as C? No. Does that mean it's useless? No. The absolute coolest thing is to take a $2 Wemos D1 clone, put micropython on it, hook it to a sensor (I've been using temp and humidity sensors lately) and have it periodically fetch " &p= "" rel="nofollow">http://webserver-ip/temp?t= &p= " every 10 seconds and have a little python webserver sitting…

I've done something pretty similar that with my project here [0]. Instead of using MQTT the ESP32 feeds directly to an InfluxDB database.

[0] - https://github.com/dcmorton/esp32-dht22-upython

Re: MicroPython

#114
post #25

Earlier quoted context omitted.

Why would you want to replace Lua in this space? At least why replace with another dynamically typed, imperative scripting language, but without tail-call optimization? What would be the gain?

> Why would you want to replace Lua in this space? The crowd of people who speak Lua is pretty different than those who speak Python. I would guess the Lua crowd to be older, more experienced, but smaller. The Python crowd is much bigger, and includes people who dabble in coding rather than those of us who do it for a living. It depends on the user base of your application, but I can totally see why Python would be a…

The Lua crowd includes kids learning to code because they want mods in Minecraft and other games. Sometimes I see Lua suggested a a first language over JavaScript because it's much smaller and has less warts (plenty of warts exist though). Can you even use V8/SpiderMonkey in the same way as LuaJIT?

Re: MicroPython

#115
post #92
post #25

Earlier quoted context omitted.

Why would you want to replace Lua in this space? At least why replace with another dynamically typed, imperative scripting language, but without tail-call optimization? What would be the gain?

I'd prefer to use a language that's more orthodox than Lua, e.g. one with class-based OOP and separate lists & maps, rather than tables-for-everything. I'd also like a language that puts more emphasis on backwards-compatibility than Lua. Sure, everyone complains about the Python 2 => 3 transition, but there have been 3 new major versions of Lua since the release of Python 3.

Lua versioning is a really weird thing I'll give you that. I find class-based OOP a point against a language rather than for it, but there's already a huge chunk of languages that compile to/add types to Lua (https://github.com/hengestone/Lua-languages), with Wu and Amulet looking intriguing to me.

Re: MicroPython

#116
post #65

MaixPy ported Micropython to K210 (a 64-bit dual-core RISC-V CPU with hardware FPU, FFT, sha256 and convolution accelerator). It includes a general-purpose neural network processor, which can do convolutional neural network calculation at low power consumption, for example obtain the size, coordinates and types of detected objects or detect and classify faces and objects. It can load TensorFlow Light Neural Nets. htt…

I'm literally at lunch on the way home from picking up a delivery of one of these.

Re: MicroPython

#117

MicroPython is stellar. If you're building an embedded system for people to hack and customize, make the highest level abstraction of the embedded system in MicroPython so that users can easily modify/patch/contribute/hack your system with ease. This is what Arduino and Arduino IDE did for millions of hobbyist, but it is time to ditch C/C++ for MicroPython. In this [1] PyCon talk by Matt Trentini, a demo of QR code g…

TinyGo ( https://github.com/tinygo-org/tinygo ) is the Golang equivalent of this for anyone who wants a more performant (than python) and simple language to use.

But no REPL for real-time probing or testing, so you’re in a big-guess-recompile-deploy cycle, correct?

Re: MicroPython

#118

Earlier quoted context omitted.

The biggest thing you are underselling (if at all), is that you can have a repl directly into the device itself and doing lots of exploratory programming directly in-circuit.

Yes, this is a complete game-changer; I love showing experienced embedded engineers how to connect to the REPL, and poke live, interactive I2C or SPI at a peripheral. :)

I only wish Micropython had a real debugger (pdb).

Re: MicroPython

#119

MicroPython is stellar. If you're building an embedded system for people to hack and customize, make the highest level abstraction of the embedded system in MicroPython so that users can easily modify/patch/contribute/hack your system with ease. This is what Arduino and Arduino IDE did for millions of hobbyist, but it is time to ditch C/C++ for MicroPython. In this [1] PyCon talk by Matt Trentini, a demo of QR code g…

I'd love to try it out but the realm in which I am moving is around 32K of flash and 6K RAM. And if my research was not wrong MicroPython needs at least 256K flash and 32K RAM, and that's without any user program in Python on top of that. That's quite a lot ...

Re: MicroPython

#120

MicroPython is stellar. If you're building an embedded system for people to hack and customize, make the highest level abstraction of the embedded system in MicroPython so that users can easily modify/patch/contribute/hack your system with ease. This is what Arduino and Arduino IDE did for millions of hobbyist, but it is time to ditch C/C++ for MicroPython. In this [1] PyCon talk by Matt Trentini, a demo of QR code g…

I understand what value MicroPython holds for Python community who want to get into embedded computing.

But aren't these contradictory -

>but it is time to ditch C/C++ for MicroPython.

>Therefore, it is critical to put performance demanding code in C/C++ modules and compile a MicroPython bindings

I understand that these are underlying issues of Python itself and I've been burned before because of it. Had a massive python project in my previous startup, it became very clear soon enough when the user base grew that only way to extract meaningful performance(and to bring down server costs) was to replace core components with C-extensions(e.g. Concurrency, Networking). Although we were able to do it, it is a huge overhead for a small startup and capital intensive.

If I have to recommend Python to someone who is new to programming, I have to add a disclaimer that "If you want to build something which demands serious performance with it, you'll also have to learn C/C++"

All those can be avoided, if we could just take up a language which was specifically built to fix the underlying issues with Python i.e. If it's the utility we want, then Go.

As far as embedded is concerned, TinyGo does what MicroPython does. But I've found solace with Gobot via Firmata, although it demands Client-Server architecture the utility of not having to flash the Microcontroller each time we make a change is worth it, besides having all the libraries we have in the Go ecosystem at our disposal. I would recommend this for home projects where Client-Server arch is not an issue, I recently built a 'Butt Triggered Pomodoro Timer' with it[1].

[1]https://abishekmuthian.com/butt-pomodoro-a-butt-triggered-po...

Post reply on HN