Tips on using a Badger 2040
I've had a Badger 2040 knocking around for a while (boy have they gone up in price) and I hadn't been using it, so when my energy monitor decided to play up I wanted to see if I could use the little eInk screen with an old Raspberry Pi to give me a clock, energy readings and the weather.
The board uses MicroPython and has a the same chip as a Raspberry Pi Pico at its core (an RP2040 microcontroller, hence the name) so can use many of the same commands.
I was able to adapt one of their examples to get a basic clock example running with a date as well. And rather than add a real-time clock (RTC) I was planning to simply update a file on the Badger each night so any drift was minimal (as it has no internet connection of its own, where the controlling Pi does). As it happens it doesn't do so bad on its own.
The biggest issue I ran into was connecting to the Badger 2040 and copying my code over (as well as running a reset to load it). All of the examples out there wanted to use GUI apps to connect (Thonny for example) but as I was connecting to the Pi via the command line and wanted to script a transfer I obviously wanted a command line option.
Finding one took a lot of digging but eventually I found rshell was an option. The Badger 2040 presents as a serial port device and rshell should just find it when you run rshell
in a command line with the Badger connected.
While it did the job and allowed me to indentify the port being used (/dev/ttyACM0 in my case) ultimately I couldn't find a way to trigger a reset of the Badger to read the time file I copied over.
So I turned to Adafruit's ampy instead. That provided a much simpler interface to both transfer the file and trigger a reset (so the new file was read).
That worked perfectly so if you're struggling to connect to your Badger 2040 and run commands that is worth a try.