Giter Club home page Giter Club logo

mqtt-agent-epaper4's Introduction

Weather epaper display

This repo contains an experiment to drive epaper display, connected to an esp32s2 chip. we use the micropython firmware on the chip, with additional microython libraries for mqtt, and epaper spi control

Expected Outcomes

  • Evaluating the ease of multi device control implementation, and microython maturity

  • Evaluating the deployment options to lean the install of devices

  • Evaluating semantic and protocol over mqtt to control displays

  • Evaluating the ease of creating new screens and design toolchain

Installing esp32s2 device

  • download the micropython firmware, and esptool.py it !

install the command line to a venv python3 -mvenv p3 source p3/bin/activate pip3 install -r requierments_dev.txt

put the python files :

cd device_code
ampy --port /dev/ttyACM0 put *

Design and implementation

ePaper display 400x300 in BW colors, in this design the esp32s2 implements a display server that offers the following primitives :

  • clear() : clear the screen
  • picture( p, x, y ) : display a picture at a specific location on the screen
  • text (box, textstring) : display a text in a box
  • update(): apply the in-buffer to the screen. (this primitive is quite slow, due to epaper technology)

These primitives are send thought mqtt, as commands, and evaluated within the python interpreter. see device_code/display.py

On the agent side (epaper_info.py), the screens are not directly implemented using code (too long).

An SVG template is taken and dynamic values are replaced within the svg document (using templating) and then rasterized using cairosvg.

The template is drawn in Inkskape, some text box are named for text replacement with weather api content.

The whole display is then splitted into small image tiles and sent over the mqtt topic as below :

p = p64("///8////wP///f///8D///z////A///8////wP///f///8D///z////A///8////wP///f///8D///z////A///8////wP///f///8D///z////A///8////wP///f///8D///z////A///8////wP///f///8D///z////A///8////wP///f///8D///z////A///8////wP///f///8D///z////A///8////wP///f///8D///z////A///8////wP///f///8D///z////A///8////wP///f///8BSlKT////AAAAA////wP///////8D////////A////////wP///////8D////////A////////wP///////8D////////A////////wP///////8D////////A////////wP///////8D////////A////////wP///////8A=", 50, 50)
d.picture(p, 350, 250)

After having sent all the tiles, a final d.update() is sent over the wire to materialize the reconstructed image on the screen.

mqtt-agent-epaper4's People

Contributors

frett27 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.