M5Paper UI Framework Sample Project



  • I've been fascinated with the M5Paper ever since I received it and wanted to use it to build some home automation controller that runs for a long time on the battery.

    Now, when I started looking into the UI code of the Factory Test application, I thought I could easily extend it but unfortunately, the code is not really well documented and a weird mix of C and C++. This is where I started with my project to build a library for UI development on the M5 paper that is generic enough to be easily extended and make it easy to build nice looking and usable applications. For example the Tic Tac Toe application is about 300 lines of easy to reason about code.

    Right now it's in the beginning, but feel free to check out the source code here https://github.com/grundprinzip/M5PaperUI I'm planning to extend it with simple text fields, settings application for wifi configuration etc.

    Below are some example images from the project:

    Home Screen

    Paint App

    alt text



  • Looks good so far!

    If you want a full UI framework, though, I think MicroPython is the better option, for the simple fact that you can push "apps" (technically Python applets) without the need of reflashing the device. I think the Odroid guys did some weird hackery with the Odroid GO where they use the OTA partition layout, have a "launcher" firmware on factory, and put the ROM/app to be run in ota_0 and ota_1, set the boot flag, and reboot. But with MicroPython you don't even need to do that - you can run the scripts from SPIFFS, or from an SD card, without much trouble.

    MicroPython has the downside of having no generic UI library available, whereas for C/C++ you have plethora - there's GxEPD2 (which already has a base IT8951 implementation! One just needs to make a copy of that, change the pins, VCOM voltage, and it's good to go), LittlevGL, and of course Adafruit's TFT library. All of them are much, much better options than the hacked-together M5EPD base, unfortunately.



  • @fonix232 Thanks! For me the exercise is much more exploring how the epaper display works when drawing the different components and how to optimize partial updates.

    I will have a look at the projects you mentioned and see if I can find some inspiration!