Welcome

Software

The software in the thing usually does nothing much: wake up, connect to the access point, request an image from a server over http, display it and go to sleep again. The free RAM inside the ESP8266 is only 40K or so, which is pretty small compared to the 60K needed to store an 800x600 monochrome image. That's why the controller streams the image to the display instead of storing it first. This also means the image has to be offered in a streamable format, which is why the server software can't just output a standard PNG file.

For ease of use, I wrote the pixel server, the thing that serves the pixel data in the format the E-ink display needs, in PhantomJS. PhantomJS is a Webkit based headless web browser stack, which you can execute a Javascript program in to control it: in it's simplest form, you feed it a webpage and it spits out an image of the rendered page, images and javascript-based things included.

In my case: as soon as the eink display wants a new image, my Javascript code will tell Webkit to grab a webpage and render it. It will then encode the rendered webpage in the format the display needs and send it back to the E-ink display, which then renders it. This way, I can basically show any HTML/CSS content on the eink display without having to try and fit an entire render engine on the ESP8266. The code that displays the actual info then becomes a nice clean HTML/JS/PHP/CSS combo, coded up as a standard webpage; if I want to test that bit, I can just point my webserver at it and see what it looks like.


Ofcourse, the display needs to be configured for initial use: it will want to know what access point to connect to plus the password for it, if needed. It'll also need to know the URL to the pixel server. To change that, the ESP8266 will execute a somewhat different routine on initial power up. When the battery is pulled and put back in, the display will show a built-in image to show the device is in configuration mode and will put up an access point. Connect to that access point and you can use your webbrowser to set all the needed parameters.

« Prev 6 Next »


© 2006-2022 Sprite_tm - Contact