uLisp on M5Stack (ESP32)
Last edited on February 16, 2021
About two years I ago I bought a couple of M5Stack ESP32 computers on a Maker Fair. I made little use of them so far but now I started to put uLisp on them and suddenly it is much more fun.
Specifically, I got a M5Stack ESP32 Basic Core (now sold as an "IoT Development KIT") and two M5Stack ESP32 Faces Kits. Basically, they are full-blown computers on a better level than you've had as a PC in the mid-90ties:
- 240 MHz dual-core ESP32 processor,
- 520 KB SRAM,
- 16 MB Flash – my datasheet actually says: 4 MB Flash,
- 2 inch TFT LCD display with 320x240 pixels and 262 K colors (ILITEK ILI9341),
- WiFi with built-in antenna,
- SD card slot
- 110 mAh battery (M5Stack Basic Core) – my datasheet says: 150 mAh,
600 mAh battery (M5Stack Faces Kit)
- 1 W Speaker
- 3 buttons
As a first test I have made use of the buttons, the built-in TFT display, the Wi-Fi support, Network Time Protocol (NTP), HTTP and HTTPS requests. Actually, this was a small IoT demo to have it store ISO 8601 timestamps on button presses in the graph database Dydra via the SPARQL 1.1 Graph Store HTTP Protocol.
It was quite easy to do as some ESP32 boards are already supported by the ESP version of uLisp, ulisp-esp, which can just be uploaded to the M5Stack using the Arduino software. But this version doesn't support any of the built-in hardware of the M5Stack systems. Luckily, uLisp is easy to enhance.
I forked ulisp-esp and published my first adaptations for the M5Stack on GitHub as ulisp-esp-m5stack. As a start, the version I pushed today has the full graphics extension working on the M5Stack.
Also, you have to live with the fact that I have included a Makefile and some helper scripts to compile and test the distribution of uLisp without having to use the GUI of the Arduino software. (Of course, the Arduino software is still used for the real work, so you have to have it and the M5Stack extensions installed and the command "arduino" needs to point to the right location to execute it.)
In a follow-up project I have already used a DS18B20 digital temperature sensor as well as an analog pH sensor and wrote a little library in Lisp to derive pH values from the measured analog voltage. But that is stuff for a later post… As always I am happy for comments via email!
Full disclosure note
I work for the company behind Dydra. This influenced my choice of the database. Still, this is my personal blog and I write in my own time.