# Nice(?) and cheap ESP32+Colour display

**URL:** https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413
**Category:** Hardware
**Created:** [27 October 2023 21:39 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413 "2023-10-27T21:39:17Z")
**Posts on this page:** 20
**Page:** 4

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [10 November 2023 13:54 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/61 "2023-11-10T13:54:51Z")

</div>

We have wormsign 🙂

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/a/6a373764b910524a42b13782c2167f036e65056e.jpeg "10 November 2023") ](https://www.youtube.com/watch?v=zHoxEJyhHR0)

All MQTT based

So Arduino sketch on the CYD that sends pressure/x/y when touched

```auto
void printTouchToMQTT(TS_Point p) {
  Serial.print("Pressure = ");
  Serial.println(p.z);
  // doc previously declard as DynamicJsonDocument doc(200);
  doc.clear();
  doc["pressure"] = p.z;
  doc["x"] = p.x;
  doc["y"] = p.y;
  char buffer[256];
  serializeJson(doc, buffer);
  client.publish("CYD1", buffer);
}

```

Also, decodes JSON received and checks for keys such as clear and writeText

```auto
void callback(char* topic, byte *payload, unsigned int length) {
  Serial.println("sub rcvd:");
  for (int i=0;i<length;i++) {
    Serial.print((char)payload[i]);
  }
  Serial.println();
  rcvdDoc.clear();
  deserializeJson(rcvdDoc, (const byte*)payload, length);
  
  if (rcvdDoc.containsKey("writeText")) {
    int x = rcvdDoc["x"];
    int y = rcvdDoc["y"];
    String temp = rcvdDoc["writeText"];
    word backgroundColour = 65535;
    if (rcvdDoc.containsKey("backgroundColour")) {
      backgroundColour = rcvdDoc["backgroundColour"];
    }
    tft.setTextColor(TFT_BLACK,backgroundColour);
    int fontSize = 4;
    if (rcvdDoc.containsKey("fontSize")) {
      fontSize = rcvdDoc["fontSize"];
    }
    tft.drawString(temp, x, y, fontSize);
  }
  if (rcvdDoc.containsKey("clear")) {
    tft.fillScreen(TFT_BLACK);
  }

}

```

NR

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/346e567ac75f940cad82a1f8c38f69231384a085.png)

Just simply checking the x position received and

if \<160 (left) then I send a clear message and then a writeText message saying "LIGHTS OFF" and put that over on right. Also get NR to send message to Alexa to turn my ceiling light on

then if x \> 160 (right) I send clear message and then a writeText message saying "LIGHTS ON" and put that over on right. Also get NR to send message to Alexa to turn my ceiling light off

All very rough at moment but now I'm thinking I need to buy another one so I put one in living room for daughter who won't speak to Alexa on principle to turn stuff on/off 🙂

[edit]Already changed my UI 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b19bfc9c2f6338c764031cb35261ebd9297c048e.jpeg)

Click on name of light and it will toggle its state

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [20 December 2023 13:46 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/62 "2023-12-20T13:46:30Z")

</div>

Are there any more examples of successful applications for this?

Not wanting to copy anybody's homework of course...

---

<div class="post-metadata">

### Author: ![yogy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yogy/32/32191_2.png) [@yogy](https://discourse.nodered.org/u/yogy)
#### Post date: [20 December 2023 15:02 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/63 "2023-12-20T15:02:42Z")

</div>

![foto](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee0c56913b5e71f8eab4326962d3e27615d89a7b.jpeg)

Just some tryouts **mostly stolen** from the web.  
Nothing useful but more to get a grasp of openhasp.  
So only some loose nodes to tryout.  
I have the device on my desk and control some lights.  
Working now for a couple of weeks  
First the pages.jsonl on the device, not nessecary, you can do everything with mqtt.

I have a ESP32-8048S050C from the Sunton store (800x480)

```auto
{"comment":" ----------- Page 1 - Hoofd Menu ------------"}

{"page":0,"id":14,"obj":"line","points":[[670,0],[670,480]],"line_color":"#ffffff","enabled":false}
{"page":0,"id":13,"obj":"line","points":[[0,410],[800,410]],"line_color":"#ffffff","enabled":false}

{"page":0,"id":16,"obj":"label","x":690,"y":410,"w":100,"h":40,"border_width":0,"text_color":"#ffffff","text":"Tijd"}
{"page":0,"id":17,"obj":"label","x":690,"y":440,"w":100,"h":40,"border_width":0,"text_color":"#ffffff","text":"temp"}
{"page":0,"id":18,"obj":"led", "x":750,"y":20,"w":40,"h":40,"border_color":"#ffffff","bg_color":"#1f87e8","tag":"LedCV"}
{"page":0,"id":19,"obj":"led", "x":750,"y":80,"w":40,"h":40,"border_color":"#ffffff","bg_color":"#1f87e8","tag":"LedConvector"}
{"page":0,"id":1,"obj":"btn","action":{"up":"page 1"},"x":10,"y":415,"w":150,"h":65,"radius":5,"text":"Menu"}

{"page":1,"id":1, "obj":"btn","x":10, "y":20, "w":210,"h":80,"radius":5,"text":"Scenes"}
{"page":1,"id":2, "obj":"btn","x":230,"y":20, "w":210,"h":80,"radius":5,"text":"Verwarming"}
{"page":1,"id":3, "obj":"btn","x":450,"y":20, "w":210,"h":80,"radius":5,"text":"3"}
{"page":1,"id":4, "obj":"btn","x":10, "y":120,"w":210,"h":80,"radius":5,"text":"4"}
{"page":1,"id":5, "obj":"btn","x":230,"y":120,"w":210,"h":80,"radius":5,"text":"5"}
{"page":1,"id":6, "obj":"btn","x":450,"y":120,"w":210,"h":80,"radius":5,"text":"6"}
{"page":1,"id":7, "obj":"btn","x":10, "y":220,"w":210,"h":80,"radius":5,"text":"7"}
{"page":1,"id":8, "obj":"btn","x":230,"y":220,"w":210,"h":80,"radius":5,"text":"8"}
{"page":1,"id":9, "obj":"btn","x":450,"y":220,"w":210,"h":80,"radius":5,"text":"9"}
{"page":1,"id":10,"obj":"btn","x":10, "y":320,"w":210,"h":80,"radius":5,"text":"10"}
{"page":1,"id":11,"obj":"btn","x":230,"y":320,"w":210,"h":80,"radius":5,"text":"11"}
{"page":1,"id":12,"obj":"btn","x":450,"y":320,"w":210,"h":80,"radius":5,"text":"12"}

{"page":3, "comment":"Scrolling text test"}
{"id":100, "obj":"tabview", "x":50, "y":200, "w":350, "h":200, "bg_color":"#444444", "bg_opa":128, "btn_pos":0}
{"id":101, "obj":"tab", "parentid":100}
{"id":102, "parentid":101, "obj":"label", "x":10, "y":10, "w":330, "text_color":"#eee6d1", "text": "This test device is #000080 located on my desk#. This is only a test, and this whole thing is to test how text will or won't scroll up and down or maybe sideways. Make sure to set click:false for the label object so the scroll touches hit the TAB instead of the LABEL.", "mode":"break", "click":"false"}

```

```auto
[{"id":"78702519da996257","type":"mqtt out","z":"27d6323ed6b7a6c0","name":"","topic":"hasp/plate/command","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b7b4fc84.41ca7","x":1040,"y":290,"wires":[]},{"id":"fe12f56f750de13d","type":"inject","z":"27d6323ed6b7a6c0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"page 1","payloadType":"str","x":230,"y":160,"wires":[["09819177dcf01872"]]},{"id":"5e19a889d5cf0822","type":"inject","z":"27d6323ed6b7a6c0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"antiburn on","payloadType":"str","x":240,"y":120,"wires":[["09819177dcf01872"]]},{"id":"973fcb951093073c","type":"mqtt in","z":"27d6323ed6b7a6c0","name":"","topic":"hasp/plate/state/#","qos":"2","datatype":"auto-detect","broker":"b7b4fc84.41ca7","nl":false,"rap":true,"rh":0,"inputs":0,"x":230,"y":30,"wires":[["2a40d1089c6f49bf"]]},{"id":"2a40d1089c6f49bf","type":"debug","z":"27d6323ed6b7a6c0","name":"debug 340","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":30,"wires":[]},{"id":"3a50643e1622d6c2","type":"debug","z":"27d6323ed6b7a6c0","name":"debug 351","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":980,"y":540,"wires":[]},{"id":"3c7ba024a6a14d01","type":"mqtt out","z":"27d6323ed6b7a6c0","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b7b4fc84.41ca7","x":970,"y":480,"wires":[]},{"id":"e8ac6dc6c350c07d","type":"link in","z":"27d6323ed6b7a6c0","name":"MQTT Send","links":["6b9866dae24dbae0","3dee1d54ab4978c4","6ac2fd1ef16ff0d1","11fba29d2bd01acf","dc4cc948412aa7ea","452efc6a9a7b1537","30f7dcb067c6f0ce","ba88e701d190bb43","6e36443a397ad2c6","c23b1605938dd4e4"],"x":875,"y":480,"wires":[["3c7ba024a6a14d01","3a50643e1622d6c2"]]},{"id":"ffdd593a52db4455","type":"inject","z":"27d6323ed6b7a6c0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"page 2","payloadType":"str","x":230,"y":200,"wires":[["09819177dcf01872"]]},{"id":"ca8d131ebad10e37","type":"inject","z":"27d6323ed6b7a6c0","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"restart","payloadType":"str","x":230,"y":280,"wires":[["09819177dcf01872"]]},{"id":"0d425b85aba2c038","type":"inject","z":"27d6323ed6b7a6c0","name":"Page 3","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"page 3","payloadType":"str","x":220,"y":240,"wires":[["09819177dcf01872"]]},{"id":"e37c0eb15a21c263","type":"inject","z":"27d6323ed6b7a6c0","name":"Clear page ...","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"clearpage 2","payloadType":"str","x":230,"y":80,"wires":[["09819177dcf01872"]],"info":"/**clearpage~\naccepted parameters: [0-12] or all\nDeletes all objects on a given page. \nIf no page number is specified, it clears the current page. \nUse clearpage all to clear all objects on all pages.\n\nTo delete individual objects, you can issue the pXbY.delete command.\n */"},{"id":"09819177dcf01872","type":"junction","z":"27d6323ed6b7a6c0","x":350,"y":160,"wires":[["2b535b146f49db6a"]]},{"id":"2b535b146f49db6a","type":"junction","z":"27d6323ed6b7a6c0","x":400,"y":290,"wires":[["f127f11c00f00784"]]},{"id":"f127f11c00f00784","type":"junction","z":"27d6323ed6b7a6c0","x":870,"y":290,"wires":[["78702519da996257"]]},{"id":"79c9f23f1f486db2","type":"group","z":"27d6323ed6b7a6c0","name":"","style":{"fill":"#ffffbf","label":true},"nodes":["723dff211a826d58","85e4ee14683c874a","41691329f159374c","d333b8c90bdc942c","e50f64ce8cde1a4c"],"x":514,"y":539,"w":282,"h":132},{"id":"723dff211a826d58","type":"inject","z":"27d6323ed6b7a6c0","g":"79c9f23f1f486db2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"25","crontab":"","once":true,"onceDelay":"6","topic":"","payload":"","payloadType":"date","x":575,"y":580,"wires":[["41691329f159374c"]],"l":false},{"id":"85e4ee14683c874a","type":"mqtt out","z":"27d6323ed6b7a6c0","g":"79c9f23f1f486db2","name":"Tijd","topic":"hasp/plate/command/p0b16.text","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b7b4fc84.41ca7","x":720,"y":580,"wires":[]},{"id":"41691329f159374c","type":"moment","z":"27d6323ed6b7a6c0","g":"79c9f23f1f486db2","name":"","topic":"","input":"","inputType":"msg","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm","locale":"nl-NL","output":"","outputType":"msg","outTz":"Europe/Amsterdam","x":635,"y":580,"wires":[["85e4ee14683c874a"]],"l":false},{"id":"d333b8c90bdc942c","type":"link in","z":"27d6323ed6b7a6c0","g":"79c9f23f1f486db2","name":"WKTemp Openhasp","links":["6cf6c557a046112f"],"x":635,"y":630,"wires":[["e50f64ce8cde1a4c"]]},{"id":"e50f64ce8cde1a4c","type":"mqtt out","z":"27d6323ed6b7a6c0","g":"79c9f23f1f486db2","name":"Temp","topic":"hasp/plate/command/p0b17.text","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b7b4fc84.41ca7","x":720,"y":630,"wires":[]},{"id":"1531b54368523ad7","type":"group","z":"27d6323ed6b7a6c0","name":"","style":{"fill":"#ffffbf","label":true},"nodes":["678261e518b57e7b","a900d5316cf9b94d","dc4cc948412aa7ea"],"x":474,"y":359,"w":372,"h":82},{"id":"678261e518b57e7b","type":"inject","z":"27d6323ed6b7a6c0","g":"1531b54368523ad7","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":535,"y":400,"wires":[["a900d5316cf9b94d"]],"l":false},{"id":"a900d5316cf9b94d","type":"function","z":"27d6323ed6b7a6c0","g":"1531b54368523ad7","name":"Backgroud Page .. Color","func":"msg.topic = \"hasp/plate/command/jsonl\"\nmsg.payload = { \"page\": 2, \"id\": 0, \"bg_color\": \"#111\" }\nreturn msg;\n\n/**\n{\"id\":0,\"bg_color\":\"#111\"}\n{\"page\":1,\"id\":0,\"bg_color\":\"#111\"}\n{\"page\":2,\"id\":0,\"bg_color\":\"#111\"}\n{\"page\":3,\"id\":0,\"bg_color\":\"#111\"}\n{\"page\":4,\"id\":0,\"bg_color\":\"#111\"}\n */","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":400,"wires":[["dc4cc948412aa7ea"]]},{"id":"dc4cc948412aa7ea","type":"link out","z":"27d6323ed6b7a6c0","g":"1531b54368523ad7","name":"Backgroud Page","mode":"link","links":["e8ac6dc6c350c07d"],"x":805,"y":400,"wires":[]},{"id":"ebf53e92cf4f4cc1","type":"group","z":"27d6323ed6b7a6c0","name":"","style":{"fill":"#e3f3d3","label":true},"nodes":["cf8dc1a1ca094363","821cda605625f61f","9c8c1bfcfca0a524","2ea011cc9ac757b1","452efc6a9a7b1537","30f7dcb067c6f0ce"],"x":134,"y":359,"w":322,"h":122},{"id":"cf8dc1a1ca094363","type":"link in","z":"27d6323ed6b7a6c0","g":"ebf53e92cf4f4cc1","name":"WKTemp Openhasp","links":["ab7ebe5e8d281d35"],"x":175,"y":440,"wires":[["821cda605625f61f"]]},{"id":"821cda605625f61f","type":"function","z":"27d6323ed6b7a6c0","g":"ebf53e92cf4f4cc1","name":"CV On Led","func":"let status = msg.payload;\nmsg.topic = \"hasp/plate/command/jsonl\"\n\nif(status == \"ON\") {\n msg.payload = { \"page\": 0, \"id\": 18, \"bg_color\": \"#d81b43\" }\n } \nelse {\n msg.payload = { \"page\": 0, \"id\": 18, \"bg_color\": \"#808080\" }\n }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":290,"y":440,"wires":[["452efc6a9a7b1537"]]},{"id":"9c8c1bfcfca0a524","type":"link in","z":"27d6323ed6b7a6c0","g":"ebf53e92cf4f4cc1","name":"WKTemp Openhasp","links":["752575baab179965"],"x":175,"y":400,"wires":[["2ea011cc9ac757b1"]]},{"id":"2ea011cc9ac757b1","type":"function","z":"27d6323ed6b7a6c0","g":"ebf53e92cf4f4cc1","name":"Convector Led","func":"let status = msg.payload;\nmsg.topic = \"hasp/plate/command/jsonl\"\n\nif(status == \"ON\") {\n msg.payload = { \"page\": 0, \"id\": 19, \"bg_color\": \"#d81b43\" }\n } \nelse {\n msg.payload = { \"page\": 0, \"id\": 19, \"bg_color\": \"#808080\" }\n }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":400,"wires":[["30f7dcb067c6f0ce"]]},{"id":"452efc6a9a7b1537","type":"link out","z":"27d6323ed6b7a6c0","g":"ebf53e92cf4f4cc1","name":"link out 11","mode":"link","links":["e8ac6dc6c350c07d"],"x":415,"y":440,"wires":[]},{"id":"30f7dcb067c6f0ce","type":"link out","z":"27d6323ed6b7a6c0","g":"ebf53e92cf4f4cc1","name":"link out 12","mode":"link","links":["e8ac6dc6c350c07d"],"x":415,"y":400,"wires":[]},{"id":"4dda5e85960d3138","type":"group","z":"27d6323ed6b7a6c0","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["2a9146b7cfb09c1f","3dee1d54ab4978c4","34a8317f129a07da","fa5905bf43e9e050","ba88e701d190bb43","e400ed406cc5ed20","e6a0e81fed5ca0cb","6e36443a397ad2c6","a7e02f5fc9774474","469abad14528b583","c23b1605938dd4e4","9e515a582b572839"],"x":134,"y":509,"w":272,"h":172},{"id":"2a9146b7cfb09c1f","type":"inject","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":195,"y":550,"wires":[["34a8317f129a07da"]],"l":false},{"id":"3dee1d54ab4978c4","type":"link out","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"CT-Slider","mode":"link","links":["e8ac6dc6c350c07d"],"x":365,"y":550,"wires":[]},{"id":"34a8317f129a07da","type":"function","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"CT Slider","func":"const send = {\n \"page\": 2,\n \"id\": 6,\n \"obj\": \"slider\",\n \"x\": 220,\n \"y\": 80,\n \"w\": 30,\n \"h\": 260,\n \"bg_color\": \"#fae578\",\n \"bg_grad_color\": \"#95e9fc\",\n \"bg_grad_dir\": 1,\n \"bg_main_stop\": 0,\n \"bg_grad_stop\": 255,\n \"bg_color20\": \"#FA8072\",\n \"bg_opa20\": 255,\n \"bg_opa10\": 0,\n \"min\": 0,\n \"max\": 100\n}\nmsg.payload = send\nmsg.topic = \"hasp/plate/command/jsonl\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":550,"wires":[["3dee1d54ab4978c4"]]},{"id":"fa5905bf43e9e050","type":"inject","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":195,"y":580,"wires":[["e400ed406cc5ed20"]],"l":false},{"id":"ba88e701d190bb43","type":"link out","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"CT-Slider","mode":"link","links":["e8ac6dc6c350c07d"],"x":365,"y":580,"wires":[]},{"id":"e400ed406cc5ed20","type":"function","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"Color pick","func":"const send = {\n \"id\": 2,\n \"obj\": \"cpicker\",\n \"x\": 400,\n \"y\": 80,\n \"w\": 300,\n \"h\": 300,\n \"border_width\": 0,\n \"radius\": 0,\n \"pad_top\": 5,\n \"pad_right\": 5,\n \"pad_left\": 5,\n \"pad_bottom\": 5\n}\nmsg.payload = send\nmsg.topic = \"hasp/plate/command/jsonl\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":580,"wires":[["ba88e701d190bb43"]]},{"id":"e6a0e81fed5ca0cb","type":"inject","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":195,"y":610,"wires":[["a7e02f5fc9774474"]],"l":false},{"id":"6e36443a397ad2c6","type":"link out","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"CT-Slider","mode":"link","links":["e8ac6dc6c350c07d"],"x":365,"y":610,"wires":[]},{"id":"a7e02f5fc9774474","type":"function","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"Gauge","func":"const send = {\n \"page\":2,\n \"id\": 3,\n \"obj\": \"gauge\",\n \"x\": 400,\n \"y\": 100,\n \"w\": 280,\n \"h\": 260,\n \"radius\": 50\n}\nmsg.payload = send\nmsg.topic = \"hasp/plate/command/jsonl\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":270,"y":610,"wires":[["6e36443a397ad2c6"]]},{"id":"469abad14528b583","type":"inject","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":195,"y":640,"wires":[["9e515a582b572839"]],"l":false},{"id":"c23b1605938dd4e4","type":"link out","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"CT-Slider","mode":"link","links":["e8ac6dc6c350c07d"],"x":365,"y":640,"wires":[]},{"id":"9e515a582b572839","type":"function","z":"27d6323ed6b7a6c0","g":"4dda5e85960d3138","name":"Foto","func":"const send = {\n \"page\": 2,\n \"id\": 34,\n \"obj\": \"img\",\n \"src\": \"L:/IMG_4850.png\",\n \"auto_size\": 1,\n \"w\": 800\n}\nmsg.payload = send\nmsg.topic = \"hasp/plate/command/jsonl\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":270,"y":640,"wires":[["c23b1605938dd4e4"]]},{"id":"b7b4fc84.41ca7","type":"mqtt-broker","name":"Localhost","broker":"192.168.1.251","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]

```

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [28 December 2023 09:23 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/64 "2023-12-28T09:23:55Z")

</div>

Are people on the Forum still experimenting with the ESP32-2432S028R as things seem to have gone rather quiet? I must admit I've not done anything with mine (after plugging it in and checking it worked).

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [28 December 2023 11:57 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/65 "2023-12-28T11:57:08Z")

</div>

Sadly still in its box - not had time to look at it at all yet ☹

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [28 December 2023 12:07 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/66 "2023-12-28T12:07:52Z")

</div>

Touché  
Just like a lot of my "impulse buys".  
I thought I'd try "talking to it" using Python - but (so far) have failed to find a Python library for it.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [28 December 2023 12:12 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/67 "2023-12-28T12:12:53Z")

</div>

Well, there are updated examples for a number of different firmwares now. Including ESPHome which is what I use for my ESP devices. If I can ever stop myself from working on UIBUILDER, I'll be doing that.

I really need to update all my ESPHome devices anyway.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [20 February 2024 20:50 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/68 "2024-02-20T20:50:00Z")

</div>

Just poking this topic again so it doesn't get closed and in hope of more examples to crib from...

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [20 February 2024 23:47 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/69 "2024-02-20T23:47:40Z")

</div>

I'm sure its supported by openHasp.

So if you get it flashed with that, I think I've seen something somewhere to get it working with NR 😜

> [@Hasp\["1"\].page\[0\].tab\[0\].btn\[0\].value\_str - too complex or run of the mill?](https://discourse.nodered.org/t/hasp-1-page-0-tab-0-btn-0-value-str-too-complex-or-run-of-the-mill/85091/16):
>
> I have decided to stick with this layout format as it seems to work well. In efforts to further reduce the need for data entry, I have added functionality to read a "props" property in each level of the hierarchy. This means that something like "btnStyle" can be added at the top level and will be applied to every button on that particular screen, without needing to enter it anywhere else. But it can also be set at different levels, then it applies to items below that level. If set on page the…

> [@Using openHASP with Node-Red](https://discourse.nodered.org/t/using-openhasp-with-node-red/81457/47):
>
> In tandem with the changes I made to the "page layout" file, I have added the ability to override aspects of the auto formatting code. These can be set in the props values and modify the way that the buttons are arranged. By default based on a given container size, X number of buttons are arranged to fit into a grid of x columns by y rows. If this is not symmetrical then by default it creates more columns than rows. This behaviour can now be switched around so there are more rows than colum…

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [23 February 2024 16:42 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/70 "2024-02-23T16:42:24Z")

</div>

So now I have scaling working in my **"haspBoard" (TM)** 🤣 project, I can test your little screen resolutions.

@jbudd this is running on my 480x480, but setup as 320x240. It's a bit small but quite usable.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f6ea0aadf49a117a0eccb053117b272854f4366e.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/6/a675b2498f7b3579cdd761daa43e43299e08fd04.png)

So I would recommend you give [openHASP](https://www.openhasp.com/0.7.0/) a try on these screens.

PS I don't have shares in openHasp I just really like @fvanroie's project 😉

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [24 February 2024 03:58 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/71 "2024-02-24T03:58:31Z")

</div>

Alas I have installed openHasp, it creates an access point HASP-9a6de0 but the screen is blank so I can't see the login password.

I expect the openHasp binary `d1-mini-esp32_ili9341_full_4MB_v0.6.3_497f611.bin` was the wrong one.

The documentation for this device says  
ESP32-2432S024C uses ESP32-WROOM-32. Driver chip ILI9341

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [24 February 2024 20:18 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/72 "2024-02-24T20:18:22Z")

</div>

I'm sure someone could help out at -

> **[Join the Unofficial Nextion User Forum Discord Server!](https://discord.com/invite/VCWyuhF)**
>
> Check out the Unofficial Nextion User Forum community on Discord - hang out with 1735 other members and enjoy free voice and text chat.

The access point password is haspadmin I think, if you connect then you can setup the hasp via a browser interface.

As you say you may have the wrong binary if there is no display.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [24 February 2024 21:29 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/73 "2024-02-24T21:29:39Z")

</div>

Thanks for the link @Sean-McG.

From there I was able to find firmware at [https://github.com/elik745i/ESP32-2432s024c/blob/master/build\_output/firmware/esp32-2432s024c\_full\_4MB\_v0.7.0-rc8\_e6be9c9.bin](https://github.com/elik745i/ESP32-2432s024c/blob/master/build_output/firmware/esp32-2432s024c_full_4MB_v0.7.0-rc8_e6be9c9.bin) which I flashed with Tasmota PyFlasher.

Now I have a dark screen with "Plate01" on it and a really irritating throbbing red LED  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/1/91554346806c83def839e330c914216e9579d9f1.png)  
(screen capture courtesy of Hasp web interface)

A major step forward I feel...

This particular device is 2.4" capacitive touch and I was able to enter my wifi credentials using the on screen keyboard in portrait mode!

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [25 February 2024 01:06 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/74 "2024-02-25T01:06:37Z")

</div>

Good news 😉

You may have to ask "elik" about the LED as I assume that's a custom build they made ?

I feel sure I read that there is an official build for those screens, but can't seem to find where now.

Anyway, if you would like to give my flow a whirl let me know, it's not finished yet but functional enough for you to have a play.

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [26 February 2024 00:34 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/75 "2024-02-26T00:34:34Z")

</div>

@jbudd @dynamicdave I found the openHasp build for this screen its at [nightly.openhasp](https://nightly.openhasp.com/)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b219b6ff98619dee74a04804e680d54e42653f9c.png)

Use Full firmware for first flash or OTA firmware via hasp web gui.

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [2 March 2024 02:15 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/76 "2024-03-02T02:15:41Z")

</div>

@jbudd @dynamicdave Did you have any luck with the "official" build ?

Since I got no volunteers 😭, I just ordered the 7" 800\*480 [version](https://vi.aliexpress.com/item/1005004952726089.html) so I can test at different resolutions.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [2 March 2024 09:10 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/77 "2024-03-02T09:10:31Z")

</div>

Official OpenHasp?

I bought a slightly different board than the "Official" CYD.  
Probably foolishly I traded 0.4" for a capacitive touch screen.  
Mine fits the RGB LED on the front of the board, which may eventually be a positive feature.  
It's the ESP32-2432S024C, not included in the 15 precompiled binaries at [https://install.openhasp.com/](https://install.openhasp.com/)  
However I installed OpenHasp from the link I posted above.

In the OH File editor I can see pages.jsonl. With these contents

```auto
{
    "page": 1,
    "id": 10,
    "w": 240,
    "obj": "label",
    "text": "%hostname%"
}
{"page":1,"id":20,"obj":"btnmatrix","x":10,"y":20,"w":220,"h":150,"options":["#FF0000 Red Text#","#0000FF Cyan Text#","\n","#FFFF00 Yellow Text#"],"toggle":1,"one_check":1}

```

which gives this  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/50877eed547106d62263c34f4403a1a7c0c4f024.png)

That's as far as I have gone so far. It doesn't send MQTT yet. Touching a button changes it's appearance but touching again doesn't reset it. No doubt these are easily fixed if I get round to reading up on OH.

@yogy's example above looks very promising on an 800x480 board, I can no doubt crib from that for 320 x 480

---

<div class="post-metadata">

### Author: ![yogy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yogy/32/32191_2.png) [@yogy](https://discourse.nodered.org/u/yogy)
#### Post date: [2 March 2024 09:40 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/78 "2024-03-02T09:40:49Z")

</div>

> [@Sean-McG](#):
>
> Since I got no volunteers 😭, I just ordered the 7" 800\*480 [version](https://vi.aliexpress.com/item/1005004952726089.html) so I can test at different resolutions.

I have a 800x480 sunton and I responded earlier in a thread from you with some remarks but I was in the wrong thread as you stated.  
I want to try your code, but you have not published it here as far as I can see (possibly github?)

Because our "Chinese friends" often change firmware without notice or changing product codes, the result can be that you order a week later the same product on aliexpress, you have a good chance you get one from a new batch with altered firmware.  
Many of projects such as openhasp rely on reverse engineering or scarce info and must add new compiled firmware.  
If not, the user has to have the knowledge to do it him/herself.  
Keep that also in mind.

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [2 March 2024 15:48 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/79 "2024-03-02T15:48:51Z")

</div>

I shared the hasp flow here, post any questions in that thread please 😉

> [@Using openHASP with Node-Red](https://discourse.nodered.org/t/using-openhasp-with-node-red/81457/50):
>
> This is the flow so far if anyone would like to give it a try and provide some feed back. [haspflow.zip.txt](https://discourse.nodered.org/uploads/short-url/pvES6F7JnYeiZ5bj0zKuPoHdPoP.txt) (35.7 KB) Remove the .txt extension and then unzip. Copy the text and import into NR. Set all MQTT nodes to your own server. On the hasp device go to HASP Design and choose Material Dark theme, then in MQTT settings set the hostname (topic) to "1". Reboot hasp and hopefully you should see some content wink In NR there a a green coloured group, the Setup Pages Layout contains a large …

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [13 March 2024 16:20 UTC](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413/80 "2024-03-13T16:20:04Z")

</div>

I **know** that you all have these screens collecting dust on your desks 😀

So put them to use !

Any volunteers to give my flow a try on these screens ? (requires openHASP firmware)

Would really appreciate some feedback, before I spend any more time on it 😜

[Previous page](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413.md?page=3)

[Next page](https://discourse.nodered.org/t/nice-and-cheap-esp32-colour-display/82413.md?page=5)
