MicroPython ESP32 IDE Makes Life Simpler

In theory, using MicroPython on the ESP32 is easy —  just flash an image and connect using a serial port. But that leaves a lot of things you still have to do. You need to move files between the two platforms. You’ll want to manage network configurations. You might want better editing and assistance, too. So there are a number of IDEs made to help you and one we recently noticed was MPY-Jama.

The IDE provides source code editing, of course. But it also allows you to do things like pull information about the network using a dashboard or connect to a WiFi network easily. You can even create your own AP with a simple interface.

Although the front part of the README mentions it is for Windows or Mac, if you scroll down you’ll find instructions for installing under Linux. The IDE is extensible using “Jama Funcs” and can handle the flashing operation from inside the IDE.

Of course, there is an IDE from Arduino (but not the Arduino IDE) that handles MicroPython. You can also find a rundown of several similar alternatives online.  If you need some inspiration for a MicroPython project, perhaps you’d like to play a game?

GitHub ESP32 OTA Updates, Now In MicroPython Flavor

Wouldn’t it be great if you could keep all of your small Internet-connected hacks up to date with a single codebase? A couple of weeks ago, we wrote up a project that automagically pulls down OTA updates to an ESP32 from GitHub, using the ESP32 C SDK. [Pascal] asked in the comments, “but what about MicroPython?” Gauntlet thrown, [TURFPTAx] wrote ugit.pya simple library that mirrors all of the code from a public GitHub Python repo straight to your gizmo running Micropython.

[Damped] wrote in about Senko, another library that does something very similar, but by then [TURFPTAx] was already done. Bam! Part of the speed is that MicroPython includes everything you need to get the job done – parsing streamed JSON was the hard part with the original hack. MicroPython makes those sorts of things easy.

This is one of those ideas that’s just brilliant for a hacker with a small flock of independent devices to herd. And because ugit.py itself is fairly simple and readable, if you need to customize it to do your own bidding, that’s no problem either. Just be sure that when you’re storing your WiFi authentication info, it’s not publicly displayed. ([TURFPTAx], could I log into your home WiFi?)

What’s [TURFPTAx] going to be using this for? We’re guessing it’s going to be deploying code to his awesome Open Muscle sensing rigs. What will we be using it for? Blinky Christmas decorations for the in-laws, now remotely updatable without them having to even learn what a “repo” is.

Continue reading “GitHub ESP32 OTA Updates, Now In MicroPython Flavor”

BBC Micro:Bit As Handheld Synthesizer

The BBC Micro:bit, while not quite as popular in our community as other microcontroller development boards, has a few quirks that can make it a much more interesting piece of hardware to build a project around than an Arduino. [Turi] took note of these unique features and decided that it was the perfect platform to build a synthesizer on.

The Micro:bit includes two important elements that make this project work: the LED matrix and a gyro sensor. [Turi] built a 5×5 button matrix for inputs and paired each to one of the diodes, which eliminates the problem of false inputs. The gyro sensor is used for detuning, which varies the pitch of any generated sound by a set amount according to the orientation of the device. It also includes a passive low-pass filter to make the sound more pleasant to the ear, especially for younger players of the machine. He’s released the source code on his GitHub page for anyone interested in recreating it.

While this was a one-off project for [Turi], he notes that using MicroPython to program it instead of C led to a lot of unnecessary complications, and the greater control allowed by C would enable some extra features with less hassle. Still, it’s a fun project that really showcases the unique features of this board, much like this tiny Sumo robot we covered over the summer.

Continue reading “BBC Micro:Bit As Handheld Synthesizer”

Pi Pico QR Display Hands Out WiFi Info With Style

At this point, you’re likely aware that you can store your wireless network’s credentials in a QR code, so that anyone who wants to connect with their smartphone need only scan the 2D barcode. Whether you print it out on paper, extrude it out of plastic, or paint the thing on the wall, it still works the same. It’s a neat trick for when you’ve got friends and family over, and saves you having to explain your ponderously long WPA key.

But what if you want to change up the encryption key every so often? Sure would be a hassle to have to repaint the wall. Enter this interesting project from [Predrag Mijatovic], which uses a few scripts to automatically set up a new encrypted guest WiFi network and present the appropriate QR code on an OLED display attached to a Raspberry Pi Pico. It’s a bit convoluted, and almost certainly won’t work on your network without significant tweaks, but we’re intrigued by the idea.

As [Predrag] explains, the whole thing is based on a Latvian MikroTik router that can be configured over SSH. A Bash script generates a new encryption key by base64 encoding the output /dev/urandom,  logs into the router to set up a new network using it, and then generates the matching ASCII QR code. With some sed trickery, the code is then embedded into a MicroPython program that gets uploaded to the connected Pi Pico.

In the video after the break [Predrag] takes us through the process manually so it’s easier to see what’s going on. Under normal circumstances, it would all happen automatically and would take just a few seconds to complete. We’d feel more comfortable if the scripts had some error correction that would allow them to gracefully exit if something goes wrong, but as a proof of concept, it certainly works.

We’d like to see this concept explored a bit further, perhaps using one of the physical QR code displays we’ve seen over the years. A programmable electronic paper display would also be a logical way to show off a dynamic QR code.

Continue reading “Pi Pico QR Display Hands Out WiFi Info With Style”

Screenshot of the Arduino Lab for MicroPython

Arduino Brings A MicroPython IDE

Both Arduino and MicroPython are giants when it comes to the electronics education area, and each one of them represents something you can’t pass up on as an educator. Arduino offers you a broad ecosystem of cheap hardware with a beginner-friendly IDE, helped by forum posts explaining every single problem that you could and will stumble upon. MicroPython, on the other hand, offers a powerful programming environment ripe for experimentation, and doesn’t unleash a machine gun fire of triangle brackets if you try to parse JSON slightly incorrectly. They look like a match made in heaven, and today, from heaven descends the Arduino Lab for MicroPython.

This is not an Arduino IDE extension – it’s a separate Arduino IDE-shaped app that does MicroPython editing and uploads code to your board from a friendly environment. It works over a serial port, and as such, the venerable ESP8266-based boards shouldn’t be be left out – it even offers file manager capabilities! Arduino states that this is an experimental effort – it doesn’t yet have syntax checks, for instance, and no promises are made. That said, it already is a wonderful MicroPython IDE for beginner purposes, and absolutely a move in the right direction. Want to try? Download it here, there’s even a Linux build!

High-level languages let you build projects faster – perfect fit for someone getting into microcontrollers. Hopefully, what follows is a MicroPython library manager and repository! We’ve first tried out MicroPython in 2016, and it’s come a long way since then – we’ve seen quite a few beginner-friendly MicroPython intros, from a gaming handheld programming course, to a bipedal robot programming MicroPython exploration. And, of course, you can bring your C libraries with you.

A graphing calculator with a 3D-printed enclosure, with a circuit board next to it

2022 Cyberdeck Contest: The Galdeano Is More Than A Graphing Calculator

Graphing calculators have evolved from expensive playthings for rich nerds to everyday tools for high schoolers worldwide. Even though teenagers nowadays carry powerful internet-connected computers in their pockets, math teachers often prefer them to use a clunky Z80-powered calculator in class, if only because their limited performance reduces the potential for distraction. The worst thing a lazy student can do is play a simple game like Snake or Tetris.

But what if you’re not a student anymore and you want a graphing calculator that has up-to-date hardware and infinite customizability in software? Look no further than [Angel Cabello]’s Galdeano, a handheld that has all the features of a modern graphing calculator plus a lot more. The heart of the device is an ESP32, which sits on a custom PCB that also holds a 6×7 array of push-buttons and a 320×240 touch-sensitive color display. It can be powered through a lithium-polymer battery or, like a classic calculator, through four AAA cells. The entire thing is housed in a 3D printed enclosure with color-coded buttons indicating various built-in functions.

The ESP32 runs MicroPython along with a symbolic math engine called Eigenmath. This enables the Galdeano to  manipulate expressions, perform integration and differentiation, and plot functions. Porting Eigenmath to a memory-constrained platform like the ESP32 was quite a challenge and required a few workarounds, including a memory partition scheme and even a custom compact font with mathematical symbols.

Thanks to the flexibility of MicroPython and the ESP’s WiFi system, the Galdeano is not limited to implementing a calculator: it can also perform various general-purpose tasks ranging from file editing to controlling a set of smart light bulbs. The project page doesn’t mention any games yet, but we’re sure it won’t take long before someone ports Tetris to this system as well.

Of course, even classroom-grade calculators can be pushed to do much more than their designers intended: they can receive GPS signals, run Debian or even perform ray tracing. If you’re looking for a powerful open-source calculator, this BeagleBoard-based machine runs the R statistical computing environment.

Continue reading “2022 Cyberdeck Contest: The Galdeano Is More Than A Graphing Calculator”

screenshot from the video linked, showing example code that lights up an LED, and in a small window, also shows the LED lit up on a small Pi Pico board connected over USB

Your MicroPython Board Can Be Your Tinkering Peripheral

[Brian Pugh] has shared a cool new project that simultaneously runs on desktop Python and MicroPython – the Belay library. This library lets you control a MicroPython device seamlessly from your Python code – interacting with real-world things like analog/digital trinkets, servos, Neopixels and displays, without having to create your own firmware or APIs.

You need a serial-connected MicroPython board – even an ESP8266 should do. Then, you can intersperse your Python code with MicroPython-written functions, and call them whenever you need your connected device to do something – keeping the entire logic of your project within a single device. [Brian] provides quite a few examples, even for more complex things like displays. No doubt, there are limitations, but this looks to be a powerful tool in a hacker’s arsenal.

Readers might be reminded of an Arduino library called Firmata – an old-time way to do such connectivity. We’ve also previously covered a Pi Pico firmware that does a similar thing, and even features a breakout board for all your experimentation needs!
Continue reading “Your MicroPython Board Can Be Your Tinkering Peripheral”