Refactor to ESP32

Written on November 28, 2020

After a brief chat with Marcus, I shifted away from the Raspberry Pi again. As already mentioned a couple of days ago, it seems overpowered. Also the flip dot library seems to work fine on an Arduino like chip so I would not need to rewrite it for the Raspberry. An Arduino like architecture also seems to be more stable than a full fletched system running node.

me-no-dev could help me solve the issue I had with flashing the ESP32 with the new macOS Big Sur.

For the ESP32 and the flip dots, I am currently considering these two libraries to get everything connected and running:

The new board also requires a new hardware setup for the case, which needs to be implemented, as well as a restructure of the Firebase code I currently have on the website. Instead of using the Firestore database I need to shift the messaging system to the Realtime Database so that the ESP32 library is able to work properly.

To test if everything would work as expected, I adapted the code of the basic example file so that it fits the pin layout of the ESP32. I faced an issue with the required analog pins, but by changing a couple of lines in the flip dot library file to these ones, I could fix that:

#ifndef ESP8266
class FlipDot_5x7_Slave : public FlipDot_5x7 {
  private:
    const uint8_t
      addr1 = 32,
      addr2 = 33,
      addr3 = 34,
      addr4 = 35;
  public:
    FlipDot_5x7_Slave(boolean invert) : FlipDot_5x7(1,1,invert) {}
    void begin(void);
    void receiveEvent(int);
};
#endif /* ESP8266 */

Here you can see a short snippet of the display running with an ESP32. Also I replaced the previous 12V 1A power adapter to a 12V 5A one, which seemed to increase the performance of the flip dots a lot. (Tipp: right click and select “show controls” to enable sound of the video, then you will be able to hear the actual flipping sound.)