The Wall Display

ESP8266 Wall DisplayI’ve just spent time working on my hallway wall display, the amount of which would be considered commercial suicide. Good job it isn’t commercial.

Of course I’ve not just been working on the pretty colours – I’ve revamped the control codes for the ESP8266-driven controller twice, discovered and fixed an OTA flaw in the code, re-hashed the Node-Red driving code, found and fixed countless other bits and pieces… and in the process taken pause for thought as to why I ever used the Dark Skies Node… you know – in other words – pretty much revamped everything just to improve a simple display.

Oh and I spotted an issue in Node-Red and upgraded to the latest version 0.17.4 which is wonderful.

Anyway, I figured some of you might find this interesting so here’s what I’ve been doing the last few days (apart from a trip to the coast and consuming too much alcohol on the odd evening).

Let’s get the important stuff out of the way – the hole in the box doesn’t do anything. Throwback to a previous project and it is waiting to be covered by one of those £1 Chinese back-lit touch-panels I mentioned a blog or two back.

So the box is just an Ebay job, I think it was £3 – sadly I can’t find them right now, lovely job with rounded corners and top/bottom vents. The display is one I call the QD-tech display, based on the 6sd02a1 controller and very cheap. 120x160 pixel LCD – see Ebay or AliExpress.

Glued to the back of this display is a Wemos D1 Mini from AliExpress, dirt cheap ESP-12 based board and they communicate via SPI – simplified to the minimum. I’ve connected resets together, CE to ground and so the only actual connections to the display are 5v and 3v3 (backlight) from the Wemos D1) and ground of course, for signals: clock, data, D/C. That’s it.

I use my well-developed kitchen-sink ESP8266 code for this and had to make some improvements on the way. As I was updating the board over and over and over, learning about the display chip, I noted memory issues occasionally when doing over the air updates – fixed that. I noted that I had no way to tell if the ESP8266 (and hence the display) had reset at any time (to know to do the init code) – fixed that (my ESP8266 code now sends a status message when rebooting). I got sick of the clumsy way I had to update the display, sending line, box, text commands so I amalgamated them all into string commands – and that was such a good idea I went back and made the code for other displays follow the same format.  You can see how all of this might’ve taken up a lot of time.

Node-Red

Above you see the Node-Red code, running on a Raspberry Pi using my usual setup – there are in fact 2 displays – one on my desk and one in the hallway. I check for the ESP12s coming out of reset and send start-up code via MQTT to the displays separately. Overkill, could have just done the one.  That includes setting up the display itself, clearing the screen and putting in that nice white framework of lines and rectangles.  Meanwhile I have timed functions updating the time (once a second) and everything else once a minute.  The weather forecast (see icons in a previous post) comes from Dark Sky and I was having difficulty getting what I wanted out of the Node for that service, when it occurred to me that was just as easy to do an HTTP request – as the HTTP node is able to capture information and convert it to a JSON object. How handy is that.

DarkSky

Above you see the setup to get the forecast… where it says 123 you would need your own (free) key and those are my longitude and latitude values straight from Google Maps. The function on the end – simply does this.. global.set("weather",msg.payload);

So now the global object “weather” contains everything I could ever need. See the info on their site – amazing amount of information. As a trivial example of how simple it is to get info from this – having stored the lot in an object called “weather” -  to get the percentage chance of rain for the day I need nothing more than..

var precip=global.get("weather").daily.data[0].precipProbability;

As I did not want to get barred for calling up information requests too rapidly, I separated off the weather request and now update that every 15 minutes.

You may notice a reference to England – this display is running in Spain but I have a Node-Red setup with sensors back in the UK so the two Node-Red installations exchange temperature/humidity and other info – so I figured I may as well show temperature and humidity from back in the UK.

I’ll not go into the entire code sent off to the display, as mentioned above I’ve very much simplified that now and it is all detailed in the manual I put together for home control.

And that’s it for now – as you can see on the display, it’s quite warm right now and so a bunch of us are off swimming for the day. No doubt I’ll come back full of new ideas.

Meanwhile I’ve been checking out the Khadas Vim board and the latest RF Bridge 433 from Itead – but more on this and more later.

Facebooktwittergoogle_pluspinterestlinkedin

8 thoughts on “The Wall Display

  1. What was the bug in Node Red 0.17.4 Pete? I've got an issue at present. I've been playing with that large weather object/flow from your bitbucket. It caused no problems with 0.16.x but I get out of memory errors during start-up and Node Red 0.17.4 refuses to start.

    I isolated the issue by disabling my Dark Sky flow (by using a text editor to edit flows_raspberrypi.json). Was this by any chance the same fault?
    Keith.

    1. Hi Keith - the bug was in 0.17.0 - the little blue lights that indicate you've changed something - if you just MOVED something they stayed on - fixed at 0.17.4

      I'm not getting any errors.. but hang on - the way I've done dark skies - it doesn't do anything at start up - so it could not stop Node-Red working - I just pull in the object at some arbitrary time after startup....

      Not getting any problems up to now.

    2. I had a big failure last week on my previous raspberry, so I installed all from scratch wite THESCRIPT 🙂
      The node red is the 0.17.4 and I had the same problem with memory errors and continuos restart exactly due to the dark sky flow.
      Removing the weather monster (i copied from here) with the text editor everything started running without problem.
      I still have it a darksky call but not the "monster"

  2. I just came across this today. Cost a bit more but looks interesting though.
    https://www.amazon.co.uk/ESP32-WROVER-KIT-board-for-Espressif-ESP32/dp/B071ZLSB2D/ref=sr_1_2?ie=UTF8&qid=1501078881&sr=8-2&keywords=espressif

    SD card might be useful.

    Cheaper directly from Olimex.

    ESP32-WROVER module with 4MB RAM and ESP32 silicone rev.1
    3.2" LCD display
    MicroSD card connector
    Micro USB connector
    Built-in JTAG and UART interface
    RGB LED
    Two buttons
    JTAG connector
    IO 48 pin 0.1" step connector
    5V power supply jack
    ON/OFF switch

    1. Not sure that's a stunning buy - ESP8266 + the 240x320 Ili board I've already done could easily do that for 25% of the price...display would be a little smaller though... according to the spec - that's 8,000 x 4,000 x 1,500 cm - that's a BIG display - and only 18 grms! 🙂

      I think I might want a lot more than no documentation - not everyone uses Arduino - I use the Espressif SDK for example... the price is ok but pushing it - FriendlyArm s430 display _ M3 i.e. Touch 320*480 plus M3 comes to not a lot more and you have full Linux computer, stunningly nice touch display, I2c, SPI etc etc...for not a lot more... three left, will you be able to get any more... what is the screen res etc...

Leave a Reply

Your email address will not be published. Required fields are marked *