I am a sucker for E Ink displays. So when I saw https://paperd.ink/ I joined the waiting list immediately, even though I don’t know much about hardware.
I got my dev kit yesterday and so far managed to run some sample apps, and learned some things along the way. This post is a note to myself aiming at reinforcing the lessons learned, but might be useful to others new to this.
- The display uses something called
ESP32
. From what I understand, it is a chip/microcontroller that provides the CPU, WiFi and Bluetooth. It seems like it’s a popular chip used by other projects. - All the programming is done in Arduino IDE, which is the IDE for working on the Arduino boards. I learned
that you can install different “boards” to the IDE, which somehow allows one to work on Arduino and deploy
applications to the board one is working on. In this case
ESP32
. - The code is written in C++.
- Arduino has something like a marketplace of libraries by 3rd parties. They provide things like JSON parsing,
graphics libraries, etc.
- In the code all you have to do is include the appropiate header files and call the right functions. Arduino will try to find it in the installed libraries, and if there are conflicts it will pick one of them. Not sure about the heuristic used there.
- The code is compiled and deployed via USB. One tells what kind of board one is working with, and then if everything goes right Arduino will detect the board and allows you to “Upload” binaries. As I said, I don’t know much about hardware and IoT, but seems to me what Arduino does is “flash” the binary into the board so that your code runs when you turn it on.
- In Linux, users must have permission to use the serial port. So your user must belong to the
dialout
group. I had to do that manually in Ubuntu and restart the laptop. You can tell the user has no access to it because you can’t select the “Port” from ArduinoTools
menu. - There was also an issue with the USB in Ubuntu:
dmesg
showed the board being recognized and then immediately disconnected. The error message in particular wasinterface 0 claimed by cp210x while 'brltty' sets config #1
. To solve this, one needs to uninstall thebrltty
package (sudo apt autoremove brltty
) which is installed by default and is used for something related to Braile keyboards. - I tried different examples (https://docs.paperd.ink/docs/software/examples/). Most of them are poorly documented.
The one I am running right now is https://github.com/paperdink/quotes which displays quotes from quotable.io.
I liked this one because it’s small enough, and yet I learned quite a few things about how this kind of devices
are programmed:
- It connects to your WiFi (you need to provide the auth details of course). Here I learned that the libraries
that allows you to interact with the WiFi module are part of the “board”. In this case, the libraries were installed
when I installed the
ESP32
board into Arduino. - The board libraries also provide you with HTTP and HTTPS clients. This example in particular uses HTTPS
(
WifiClientSecure
), but I was unable to make it work. So I had to modify it to use plain HTTP (intutively enough all I did was remove theSecure
suffix). Still don’t know what causes this nor how to debug it. - The rendering of letters is also done using a library by Adafruit called GFX.
- It connects to your WiFi (you need to provide the auth details of course). Here I learned that the libraries
that allows you to interact with the WiFi module are part of the “board”. In this case, the libraries were installed
when I installed the
- One can look at the logs being printed by the application from Arduino. You do need to ensure that the device is
connected, and also that the
baud
config in theSerial Monitor
window is set to the value provided to theDEBUG.begin(XXXXX);
function.