Nextion WIFI Touch Display

tmp4E3Nextion BezelThis award-winning project ** is a development of previous (home control 2016) work on the Nextion touch serial displays and offers a WIFI-controlled (MQTT) touch display which can be used with the full range of Nextion displays from the little 320*240 display you see here, up to the 7” model.  A word of thanks to everyone who voted for us in the 1st annual competition – the design was beaten to top place by the excellent ESP8266 Basic interpreter and rightly so as that is a great addition to the ESP8266 programming arsenal.

The background to this project is the ESP8266 software we developed for general use over many month, which loosely started off as a MQTT demonstration and grew over time to become general purpose ESP8266 software written in C to make good use of the various IO pins of the ESP8266 and MQTT as a communication protocol.  The peculiarities of the Nextion display is that it is normally communicated with serially. The serial lines of the ESP8266 are really needed for programming and debugging and also put out some debug info on power-up at 78k so that was really a non-starter and so a software UART was added to the code to provide a second serial line at 56Kbaud to control the Nextion.

There is a video of this example display here. The example image shown above right is merely a prototype as we await Rear View of the WIFI serial boarddelivery of a new 3D printer at which time we’ll put together a better front bezel. In this case I need a thermostat for a holiday rental installation and used this here merely as an example of what a serial WIFI display could be used for. The techniques I’ve used are applicable to a wide range of products.

The board mounts onto the back of any of the various displays with simple double-sided adhesive foam and as you’ll see in this example connects to the Nextion serial connector.

So the basis here is that we have an MQTT controlled touch display with haptic feedback and visual indication of button change of state.

Nextion DisplayIn this example there are only two states for each button i.e. on and off and as the Nextion Editor cannot handle rounded transparent PNG images we use another way., The editor has a feature called “crop image” in which you can select an overall backdrop image but on demand replace any rectangular area with a window through to another image. So all that is required in this case are 2 images as shown below, one featuring everything turned off – the other with everything turned on.  I should point out that at the time of writing a major update to the Nextion editor is in the works! More on that in a future article.

Compared to trying to match background colours to simulate transparent PNG files, this method works extremely well. Of course you don’t have to use PowerPoint but I find it produces the best results for the least work.

Powerpoints for Nextion Powerpoints for Nextion

If you look at the two slides/images above you’ll see the difference and how a series of rectangular windows to the second image could give the impression that we have both on and off states for individual buttons – and even pressed states in the case of the up/down buttons.

Nextion EditorOf course – using our code is probably well over-kill and may not suit your purposes – really all you need do is ensure you have a software UART on the ESP which is able to run at up to 56kbaud – you could use a slower baud rate as long as you don’t wish to fire TOO much information at the Nextion display (though it the most likely area of issue would be returned data – you should have a software UART that is running under interrupts).

We keep our instructions to and from the Nextion displays down to a minimum of complexity. In the image on the right you’ll see how this all looks inside the Nextion Editor.

On the right we define hotspots for touch sensitivity – which COVER the various buttons and those hotspots can be defined not only to return a value when pressed but also to change to make use of the “crop image” feature of the Nextion – to show part of ANOTHER image when required – and that is the second image of the two above.

For the likes of the up and down buttons – a touch press event in the editor like get “nodered~down” suffices to send out a message back – I’ve used a tilde to separate topic and payload in the message to be sent back out so that in this case it will be sending an MQTT message topic:”nodered” and payload:”down” – so you could send messages to Node-Red to communicate with controllers – OR you could control them directly by using the right topic and payload.  In the case of indicators, nothing is done at the display end – sending a message from Node-Red to, for example “led1” to tell it to use an alternative image is sufficient to make it look “on”.

Alternatively we may be simply displaying text. The Nextion does text in various sizes fairly well whereas image handling is not quite so good (no transparent PNG files yet and hence the “crop image” method). Even with a graduated background this method works well.

The board features reset and programming buttons to make life easy, an FTDI-compatible programming connector on the left and all the general IO pins are brought out to 0.1” on the right – this board will have many more uses than simply this display! What else does the software (which compiles under Windows – Unofficial Development Environment) do? Just about everything – RGB LEDs, PWM, general IO, software clock – there’s a WORD doc file with the project


Here is the link for the EAGLE files for the PCB, PNG files of same, a bill of materials for parts and Nextions own 3d printer file for a simple bezel (we will endeavour to produce a better one for our own use an include it in the coming weeks, time permitting). Also included my own demo PowerPoint file as used here.

Here is the link to the  source code for the general purpose ESP code which includes commands to handle this display and to send out MQTT commands.  This is has been put together using the Windows unofficial Development environment using Eclipse.

Generalised software:

tmpC40BThere is of course (optionally) a LOT more to this board than just using the Nextion Displays… if you choose to use our software (which should compile without issue in Windows using the Unofficial Development environment) you can expect to be able to control the other ports via MQTT and serial. See the home control project on the blog – or the documentation file. I’ve just successfully tested the above boards to control GPIO0, 2,4,5,13,15 and 16 as outputs. GPIO2 is attached to the DS18B20 tracks on the board and simply dropping in a DS18B20 on the board will allow for temperature control (averaged and to the nearest degree C). You can also use DHT11 (not recommended as not very accurate) or DHT22 (more expensive but WAY better). Defines are in the user_config.c file.

Hackitt Boards

Using a standard FTDI and the Eclipse environment it is not necessary to use the reset button – simply press the programming button and start programming – then release. The reset is handled by a cap on the board and some Python software in the project. A future version will likely do away with the need to press the (GPIO0) programming button.

** April 16 2016 announcement – the project won second prize in the 1st Annual ESP8266 Design Contest over at

May 4th Update: Haptic feedback – when the board is being used in “Nextion” mode – we use GPIO12 as a beeper – simply fasten one of those cheap round haptic feedback devices to it and glue that to the back of the board.

September 18th Update: if you are using the board with the RGB LED and you have that attached – don’t solder in the ordinary LED – they both go to the same place and it is one or the other.

February 2017 Update: Some users have reported issues at higher speeds. If you have issues – try using 19k2. Given the low amount of information going back and forth, this will generally have little if any effect on performance.


128 thoughts on “Nextion WIFI Touch Display

  1. A year or so I ordered what I thought was the Nextion display…Turns out I purchased a TJC4024T032 a product that Nextion will not support and is to be sold in China only.

    – the Nextion Editor and UsartHMI will remain closed source.
    – TJC devices are intended for the Chinese market
    – Nextion devices are intended for the International Market
    – support for TJC devices will be supported by TJC.
    – support for Nextion devices is delivered by Itead.

    Since I’m unable to find firmware to convert the two displays for english use. I’m happy to give them to someone that might be able to use them for the shipping cost.
    I’m located in the San Francisco bay area.

    Paul Hampton

  2. Sorry you lost me with your curt reply Peter?
    Pictures of large unpopulated pcb’s are show in the HA blog but I ask again, can these be purchased and poulated?
    Not sure how clearer my original question could be?
    This blog really requires good coding skills. Ok something I dont have. I can follow instrctions (eventually) to download and upload to devices.
    I get excited about the posibilites, then find everyone starts talking in Martian (Petes reply an example).
    I am fine at electronics (50 yrs). Is there a starting point?
    Most of what I read/view is clearly for the enlightened.
    Sorry, but it looks a bit like a clicky group, where one is frightened to put therir hand up and say ‘sorry I dont understand that’, because it will show they arent on the same level.
    Anyone recomend some reading/YT viewing that can help me get started?

    1. Not meant to be curt, more concise. I don’t sell stuff. A long time ago we made some PCB gerbers for our own use and there’s a link in the site. Nothing to purchase.

    1. The Gerbers are there somewhere. Today you’re as well to get hold of WEMOS D1 – by the time you get the boards made in China and populate them….

  3. Hello Peter,

    I’m putting together a BOM for the parts needed in addition to the touch display circuitboard that I ordered from OSHPark. I’m having trouble however verifying a few items from the BOM you posted, since it looks to be an older version of the board. Specifically, the switches aren’t the OMRON version, but smaller tactile ones? I’ve found what I think would be serviceable switches, 4.70×3.5mm ones on Digikey. Does that sound right to you?

    Also, I wasn’t able to find R5 listed on the BOM, but it was in the SCH file as 20k. Is that accurate? Assuming one would use the ADC to measure battery voltage no more than 20VDC.

    Here’s a link to my cart, enough to create three fully populated boards. For components such as resistors and capacitors, I’ve set quantity=10 to get a better price. There is likely some room for improvement here, as the current price is $30 w/o shipping. This link could also be used by others to save repeat searching on Digikey.

    Thoughts? Looking forward to testing out a fully built board using a Nextion display!

      1. Thanks! I’m also using an ESP8266-12F, which has new pins broken out on the bottom of the board. That shouldn’t impact any current functionality, but may provide some useful additions on any future version of the control board.

  4. Hi Peter – a suggestion – if you update the H&B board add a micro usb socket for powering it easily once configured.
    Brilliant blog BTW !!

  5. Further to some comments elsewhere on the blog ( & some frustrating hours ) I have also found that I could not send text to the Nextion without reducing the baud to 19200.
    To add to my confusion I could receive notifications on button presses from the Nextion at 57600.

    1. I’ve not used this for some time – and of course, the SDK has changed etc… assuming it works at 19k2 – use it at that baud rate. I will amend the blog to recommend this.

      1. A thought – though I’ve never had any issue running the unit at 56k, there is one simple way to improve reliability at speed of the software UART… double the clock speed – there’s an instruction for that and it does not make that much difference to power consumption!

  6. I don’t suppose anyone in the UK has a couple of spare boards they’d sell? I’ve put an order in for 10 but am itching to get started.



      1. I’m already splitting them with a mate and I think they’re all earmarked. If we have any spare I’ll let you know, though

          1. Sorry, only just seen this. I’ll take 2 if you’ve got them please, Jonathan. Drop me an email to steve (at) efini (dot) co (dot) uk and I can sort out payment etc.



            1. Hi Mark

              If you want a couple of boards drop me an email at jonathan (at) weightman99 (dot) fsnet (dot) co (dot) uk


  7. Hi pete, could you post the nextion hmi project that you used.

    trying to get my head around how to set it up for my installation, and i think i could learn a thing or two by getting you example up and running.

    I have the nextion connected to mode-red ok and displaying text

    cheers in advance

  8. Hi Pete,
    I successfully assembled your board and flashed firmware. However there is constant blinking of the LED1 (maybe 0.5s interval) when board is powered up and running. Is it something intentional, or maybe some of my capacitors are soldered wrong? I tried to read circuit scheme, but my hardware debug skill is much more worse, than software.

    Debug report about flashed software:
    Code Version: 1.5.55
    SDK Version: 2.0.0(656edbf)
    RSSI: -48
    CPU frequency: 80Mhz
    Free Heap: 17728 bytes

    Thank you.

    1. I’m assuming that’s the status led. It’s supposed to flash. You didn’t give enough info to know if that’s a problem.

      1. Yes, status led. I simply power up board (Nextion one) from FTDI, it correctly responds to serial commands ({temperature?}), reads DHT22 data and works as expected. But this constant blinking of the LED seems like an unusual activity. There is no data transmission happening (at least serial terminal doesn’t show anything and FTDI’s RX/TX aren’t flashing) at the moment or something like that. Data transmission LED on the ESP blinks as expected, once a minute, when sends data to MQTT server.

        1. That could be the light that says “you are in programming mode” – erm – have a look on your mobile phone and see if the board is projecting a WIFI access point?? That would happen if GPIO0 or GPIO2 were held low after power up depending on what the web programming pin is set to (see manual) – the light WILL flash however just to let you know it is doing something – it is normally a bit more subtle than that. It has nothing to do with serial communications however.

          1. Thanks for the hint, I checked phone and checked configuration on ESP. It’s in Station mode and doesn’t projecting WIFI AP. Also it’s connected to my router and I can access web interface of the node (when {web_update} is on) from my local network. If I issue {rgb_ind:1} command, then the status led stops blink and RGB LED starts to blink with blue color once a second.
            I tried to turn on/off web-setup (thought maybe this blink shows me the node need to be setup through web) but id didn’t change anything.

            Here is my startup log:
            ESP Starting…
            GPIO4 and 5 are outputs.
            Current web programming pin: 2
            GPIO13 is a serial RGB LED indicator.
            Software version 1.6.3
            SDK Version: 2.0.0(656edbf)
            Use the {debug} command for more information.
            STATION mode
            Web page control disabled
            Connected as 192:168:0:100
            MQTT connecting
            MQTT Broker connected
            Device ID is ARPS_0000787A

            1. Can you clarify – are you using the esplogin node and is it showing the board as connected underneath, (it will do that until the next device connects).

                  1. Hm… I honestly don’t know. On left toolbar it’s called ‘esplogin’, but when I deploy it to scheme – it renames itself to Sunrise/Sunset, however it’s description still says – it’s ‘esplogin’. Here is screenshot with description:

                    View post on

                    1. Yes that looks right – so assuming you’ve removed the LED as it is redundant with the RGB LED there.. what is the actual problem?

                  2. Sorry, I can’t reply to your last post, so I’m answering here.
                    I desoldered regular led, as you recommended.
                    My actual problem now is constant blinking (now it’s once a second) of the RGB LED.
                    I stopped MQTT daemon on controller RPI to ensure – there is no heartbeat or something like that, but this blinking is still present.

                  3. Actually this is what I wanted to know 🙂
                    Is it possible to reduce this blink interval or control somehow?
                    I found out, that a RGB LED doesn’t light at all, when the board is restarted in ‘programming’ mode, so it looks like dead. Maybe it would be good to make it light steady (with red color for instance), like regular LED does?

            2. also – unsolder the ordinary LED -you should have EITHER the RGB LED or the normal one attached – looks like you have the RGB setting so the normal LED is irrelevant and the control signals are not for it.

  9. Hello Pete. Congratulations for developing such a nice combination of ESP8266 and Nextion display. I am using ESP8266 for more than a year and now I have started an online store
    I have a question, What is the size of Nextion display are you using in the picture above? Is that 3.2″ Nextion display? Moreover, I need your suggestion on the size of Nextion display, as I am launching WiFi relay board comprising ESP8266, four relays, DHT22 and builtin HiLink 5W power supply. What size of Nextion display will be sufficient to display four control buttons, Temperature and Humidity?

  10. Hi Pete,
    I’m trying to make a PCB using a CIRQOID with the EAGLE files you provide. Everything is correct, but the drilling file does not seem to be compatible with the software of the cirqoid machine.
    I need a drilling file with Excellon format to finish the job.

  11. Hi Artyom

    Well that explains the difference of view. For clarity – I have no interest in “consumers” as such – the blog is for developers and people having fun with electronics – learning as they go along – the work is for the sake of it – just because we can – I’ve spent much of my working life in the business of making things to standards, to work to the lowest common denominator and manufacturing cheaply. The only part of any of that I am now interested in is keeping my costs down and saving money for those who wish to follow what I’m doing or take some of my ideas. I’m also interested in other money-saving or ingenious ideas others have.

  12. Hi,

    what is the cost of hardware for this?
    I mean, that for the same purpose – MQTT over WiFi Touch panel, I use standard Android Tablet for 50$ with Commandfusion Software and MQTT Javascript driver.
    For single-page GUI Commandfusion is free and provides nice user interface design tool with all kind of buttons and gauges.
    This solution works quite stable for months already.

    1. $50 for tablet is way more than the cost of the smaller Nextion displays plus cheap ESP board – and a single page might well work for some – who will, no doubt follow this up – for me no good. I went to have a look at their site and there was only a pretty lacklustre video demo of the commandgui – nothing you can’t easily do with the Nextion free software which has no limits but technically remains less than ideal. Then I went looking at the price of Commandfusion. You can’t get any pricing from them until you are logged in and “approved”.

      No thanks.

      1. Well, OK, then you should add timing costs required to develop your solution, including time for reading the docs, writing code, soldering, making 3D, testing etc. Also not forget about supporting this solution in future – for example if in 5 years device will be broken. In case of tablet you need just buy new one for 50$. In case of Nextion+ ESP – are you sure that you will find exactly same pieces, and will not need to redesign whole thing?
        Such things are not obvious.

        1. Well….

          In 5 years time, the tablets will have changed, Android will have changed a LOT, whatever software you are using will have changed beyond all recognition and probably not even be supported any more etc… people in here generally LIKE soldering, there’s hardly any code to write as it has already been done.. In 5 years time I don’t expect to be using ANYTHING I’m using now – I will have moved on as will others as we’re having fun learning and building – who knows, the singularity may have arrived and our computers will be doing the building for us…. we could keep this up forever. If you wish to use an expensive tablet that’s fine. I have looked at several tablets and while I can’t speak for America, a tablet costing £35 or so is usually not worth having.

          Now, if we can get SQLITE node running on Android, that will give us the entire Node-Red setup of SQLITE, MOSQUITTO and MQTT running on the tablet – which IF it can be all made to run reliably, means it COULD form a complete solution without having to buy ANY new software to get multiple, unlimited pages of touch-information because Node-Red Dashboard can easily give us what we need for free without limits. In those circumstances I could see a tablet forming the central controller plus touch-display, talking via WIFI and MQTT to a bunch of ESP8266 control boards.

          1. I agree with you in terms of changes. But the difference is that you are looking on this more as a developer, while I’m looking like a consumer. I don’t want to invest in my HA more than minimum required. Also after 5 years I’m going to use same tablet as long as it lasts, because I don’t feel, that my requirements will change. Perhaps in terms of control I will move to full voice control, but for displaying some panel is still required.

  13. Part’re doing a great job I have uploaded your last frimwer I nextion connected to gpio4,5 baud to 57600 in esp and nextion have uploaded to nextion t0.txt and two buttons have set the command buttons and they work shipped via the port message, my problem is that the can not get it to send a textu t0 using your command {to_nextion “t0.txt = \” Hi there \ “”}

  14. ignore above, i just worked out that you can’t update button image it has to be a “crop” I was looking for an item that had picc & picc2 and the button was the only one with both !…But i didn’t need both !!

  15. hi pete
    on your nextion display, have you used a crop image button for led1 ? i cant get it to turn red i have picc set to 1 (the all off image ) and picc2 set to 0. i can touch the screen and turn it red (pressed image)but if i send led1.picc=0 in nextion editor i get nothing, what is the correct syntex? i can change text on the display ok. eg: t0.txt=”hello” works. i have also tried led1.picc=”0″. i have resorted to using the editor debug, with the display connected directly, as i was questioning myself as to the correct syntex in node red script.
    thanks Chris

    1. As I recall from the project – I ended up with a background with all the buttons turned off… I then used the crop image – same full screen size – with all the buttons turned ON – and selected areas around the buttons to selectively replace as needed. It seems a strange way to do things – but it does work.

      Erm, it is “pic” not “picc”.

  16. Hmmm! not too good so far, I upload the STL file and you can se it in the 3D viewer and it gives a price but when you add it to the cart it gives an error saying that the file is empty! I think there is a problem with the site. Prices look good when compared to Shapeways but not seen the postage cost yet.

    1. At last, sussed it, you need to not drag and drop your file, use the browse for file option and then it added the print to my cart, ordered let’s see what it’s like. $9.90 for postage

    1. That looks handy Phil and thanks for that – might be worth a short – depending on prices of course. Let me know how you get on.

  17. Hello,

    Can anyone link to a more simplified DIY tutorial for this specific setup?

    Can anyone sell me the latest board that mounts on the back of the nextion display with the attached components?

    I have been looking for a setup like this for 2 years! Thanks Pete (I donated $10)

    1. Hey thanks for that, Ron – another excuse for me to go on Ebay looking for new toys. I did an update to our board a couple of days ago but we don’t go built boards – it’s just a hobby for us (well, this part is anyway) and we make the layouts available to anyone who wants to go off to dirty PCBs etc and who can manage the larger sizes of surface mount. I appreciate it isn’t for everyone (though now I could never contemplate going back to bending resistors over and pushing them through holes).

  18. Hello Pete,

    thinking of trying to build one of this, but finding some troubles to identify the right items to order from Farnell or other sellers. Is there another BOM with the product numbers/codes specified available somewhere?



  19. I still don’t get it ….the nextion pcb has only one physical serial connection.
    The nextion documentation doesn’t describe how the pcb works and is not that great at describing how to use the screen designer. Anyway if the nextion pcb has only rx and tx why is there a second serial port if there is no physical connection?
    The Arduino compiler doesn’t ignore the defines. Nextion has the defines in the code examples they supply for a Arduino which does have serial and serial2 physical ports.
    I really don’t understand the nextion at all. I’m even having issues with designing a simple hello world application using their obtuse screen designer.

  20. I,m missing something here.
    The sp8266 has one hardware serial port defined in the esp8266 Arduino IDE as Serial.
    The nextion code has multiple embedded defines #define nexSerial Serial2
    I know there is a software IO for a second serial port but I don’t see a physical connection to the NX4024T032 PCB for a second serial port.
    How is an esp8266 hooked up to the nextion LCD? I’m confused.

    1. Simples – the ESP8255 has one hardware serial port – but it isn’t hard to define another in software using interrupts. The code is used for a wide variety of purposes – ignore the defines – it can all be set up in commands as per the DOC file. The software serial port feeds the Nextion display and takes back touch info from the Nextion display.

  21. Hi Pete,

    I’ve finally got round to soldering up one of the boards. And it works.

    I’ve blown your code to it and also done an OTA update.

    However as soon as i issue the {set_serial:2} it reboots. Serial output shown below.

    Any thoughts.
    SDK Version: 1.5.2(7eee54f4)
    CPU frequency: 80Mhz

    ets Jan 8 2013,rst cause:2, boot mode:(3,0)

    load 0x40100000, len 1344, room 16
    tail 0
    chksum 0x9c
    load 0x3ffe8000, len 660, room 8
    tail 12
    chksum 0xb8
    csum 0xb8

    rBoot v1.3.0 –
    Flash Size: 32 Mbit
    Flash Mode: DIO
    Flash Speed: 40 MHz
    rBoot Option: Big flash

    Booting rom 1.
    don’t use rtc mem data

    ESP Starting…
    Initialised software serial to 57600 baud.
    Current web programming pin: 2
    GPIO13 is an indicator.
    Software version 1.3.9

    Use the {debug} command for more information.
    STATION mode
    Web page control enabled
    Waiting for Access Point Phoenix
    Connected as 192:168:250:208
    MQTT connecting
    MQTT Broker connected
    Device ID is ARPS_00FE2D89
    Item published
    Time is 13:49:01 23/05/2016

  22. Pete
    thanks for the firmware changes. I can now get repeatable communications to my nextion board but unfortunately at only 19200 baud.

    1. Thanks John- I’ll check that when the new board turns up – strange – still – unless you’re planning something special 19k2 should still provide speedy output.

  23. No idea John and the only Nextion I have is bust (didn’t survive the journey to Spain due to me putting it in the outer pocket of my travel case) – I’m expecting a couple arriving from China any time in the next week or so – I’ll give it a shot then. But today I’ve been making improvements to the software generally…. Couple of things you could try – one is to double the clock speed – see if for any reason the processor is having trouble keeping up. I can’t imagine it but it is possible – doubling the clock speed should not affect timers – are you doing something else at the same time like PWM perhaps? Another is to lower the baud rate. In version 1.3.7 which you can get from source or from the ROMS – updated just a few minutes ago – get the updated manual and you’ll see the set_serial command now has new options. Of course you’d have to set the Nextion accordingly. Might be worth trying a slower baud rate?

    HOWEVER just to test, I’ve sent the string:

    {to_nextion:”hello and how are you today are you ok?”}

    several times to my logic analyser using mode {set_serial:2} i.e. 57600 and the logic analyser says yes every time.

    On power up there is more useful serial info including what baud rate if any you’re set to.

  24. Sorry to be a nuisance but I’m still not up and running.
    I am repeatedly sending serially to the ESP the message …..{to_nextion:”t0.txt=\”Hi there\””}
    I am monitoring the software serial output using putty and the results are strange. Sometimes the front of the message is truncated or corrupted ie the leading character “t”
    The consequence is that nextion display is only randomly getting updated.
    Any ideas?

    <0.txt="Hi there"ÿÿÿ:0.txt="Hi there"ÿÿÿ:0.txt="Hi there"ÿÿÿt0.txt="Hi there"ÿÿÿ:0.txt="Hi there"ÿÿÿ:0.txt="Hi there"ÿÿÿ40.txt="Hi there"ÿÿÿº0.txt="Hi there"ÿÿÿ:0.txt="Hi there"ÿÿÿ80.txt="Hi there"ÿÿÿ:0.txt="Hi there"ÿÿÿº0.txt="Hi there"ÿÿÿ:0.txt="Hi there"ÿÿÿt0.txt="Hi there"ÿÿÿº0.txt="Hi there"ÿÿÿ:0.txt="Hi there"ÿÿÿt0.txt="Hi there"ÿÿÿt0.txt="Hi there"ÿÿÿ40.txt="Hi there"ÿÿÿ:0.txt="Hi there"ÿÿÿ

  25. Pete
    I had been cutting and pasting the line:
    {to_nextion:”t0.txt=\”Hi there\””}
    and only now have discovered the illegal quote characters (unicode whatever)
    anyway after changing those I’m getting intermittent success almost like a not quite matched baud rate.
    Is the baud rate the standard 57600 or have you opted for an exact 56000
    On the Nextion debug screen I have been typing “bauds=57600”
    Is that correct?

    1. 57600 baud – ie standard baud rate. We’ve spent the day playing with this – as I realised I’d not allowed for /r /n /t or 0xZZ where ZZ is a hex 2-digit number. All in version 1.3.6 which is up there now in source and binary and I’ve added a “to_serial2” command which is the same but doesn’t put all the special Nextion commands in…. as for actual baud rate – it should be ok, I had a little Nextion showing time, date, temperature, humidity and a one-liner weather forecast updating every second and it ran for several days without issue….

      Yes WORD quotes – doesn’t like those…. I should trap them really.

  26. Sorry
    I haven’t set up the led crop on the Nextion.
    I was just trying a simple text test. I sent this serially from the ESP.
    {to_nextion:”t0.txt=\”Hi there\””}
    I assumed that the “to_nextion” bit diverted the message to the software serial ports and added the ff bits.
    I must be doing something wrong but I can’t work it out.

    1. Ermmm…. might be I got out of bed too early but I can’t get serial out of 4 and 5 either – just bear with me on this one…. I’ll come back to you.

    2. Check this – I did discover another bug but what you’ve described works perfectly – can you stick a scope or analyser or even a LED on GPIO4 or 5 depending on your board – to make sure there is an output when you send the commands….. and you need to have sent {set_serial:2} sometime previously (it will reboot the board) for this to work….

      Home Control and Nextion Updates

  27. I’m stuck
    Nextion all set up with a text box t0. set baud rate to 57600
    Esp-12 board all set up with set_serial:2
    4 wires connected between them. Solid 5V applied
    FTDI connected to ESP board.
    send serial command {to_nextion:”t0.txt=\”Hi there\””}
    Nothing…. what am I missing

    1. Here’s an example of one of mine if the editor doesn’t mess it up

      msg.payload=”{to_nextion:\”led1.picc=1″ + “\”}”;

  28. Great Job and I am sure this will progress in the right way; Just a question, I did not find any info (or maybe I missed) on how you are handling the haptic sensor feedback: I would like to have similar feedback but I had no idea how to achieve it; could you please help me to understand or drive me to proper resources?

    1. Haptic sensor – easy – just turn a port on and off… the device is just a tiny motor in a box. I’ve used GPIO12 and a little timer keeps the output high for a short time just enough for the device to wind up and vibrate briefly.

      1. This I though but my question was more hardware related, sorry if I did not explain well myself; which kind of tiny motor did you use? do you have any reference, part number or weblink for it ? 🙂

  29. Thanks Pete.
    This one is a steep learning curve. I think my issue is the baud rate and I did see mention of it but no reference as to how to change it. Unfortunately for me I think the ESP is dead as now all attempts at upload fail. I have tried 3 different USB ftdi devices. Strangely it shows some signs of life on the hardware serial output. Have you ever attempted to unsolder an ESP-12? Another small issue, LED1 showed no sign of life. I assume it should be flashing with comms.

    1. I’ve never had to fix one as I’ve never bust one – that is except for the one sitting in front of me with a huge crack across the screen thanks to not thinking to pack it carefully before heading off in the car to Spain with my bag at the bottom of everything.

      Baud Rate.. it probably does not help that if you look up Nextion baud rate – there are people who’ve clearly not studied the manual saying you can’t change it.
      The link above – a few lines down – you can chose to temporarily (until next power cycle) change or permanently change to 56k. Just change to 56k. Now this does NOT affect the baud rate for blowing the boards as that is done automatically, you can see it searching… for now I suggest you put the ESP to one side and make sure you can get their editor talking to the board – then once you’ve done that – you can change the baud rate, power cycle and make sure it works. I must update my serial terminal one day to handle the daft FF FF FF system they use for delimiters. I did ask them to make that programmable but no… ok well good luck – I hope I’ve provided some help here.

  30. Are the 2 binaries up to date as well?
    I have had some success individually with the display and the board, esplogon to mqtt etc but absolutely no marriage between them. I have set software serial to 2. I also have no success with long press on prog button to instigate web interface. I have tried numerous times to re-upload the binaries to the board but despite working before it now fails every time. (voltage is good) Curious?

    1. Manual last updated 5 minutes ago – that is up there with the source. I’ve just now ensured that the binaries are up to date. Serial2 has to be set to 2.. then of course you can use the commands to the Nextion at 56k – mind you you have to TELL the Nextion to use 56k as it’s normal mode of operation is 9600 – I think it says that in the BLOG – and of course you’ll need to have the Nextion setup to take notice of the commands… I think I gave an example – again if it works but it isn’t clear let me know.

  31. That’s not my SSID, I don’t know where it came from. I’ve uploaded the 2 binaries from your site and am now making some headway. Currently fighting with Nextion/Powerpoint.

  32. I’m probably being stupid but….a couple of questions
    Does the nextion and the home control board use the same firmware?
    I have compiled and uploaded “scargill-esp-mqtt-dev-fda7b363d10e” to my Nextion interface board.
    The serial output shows

    no DVES_HOME found, reconnect after 1s
    f r0, STATION_IDLE

    I have tried sending various commands eg {ssid:”kitchen_wifi”} but with no response.
    Does this support long press GPI0 and subsequent web interface?

    1. Yes the same software – updated yesterday –

      to use the software with the Nextion as described in the blog you need to setup the serial2 command otherwise the relevant IO are just used as simple I/O and not a serial port. That needs a reboot. I’m at a losss where “DVES_HOME” is coming from – is that your SSID? Did you put the right password in? The output after that I’ve never seen before. Make sure you’re working with the latest version.

    1. I’ve passed on your details to Paul. There is no member to member setup here – I’ve looked and the existing options don’t really do the job. I’m considering a forum so we can slot subjects in making it easier for people to focus on one issue.

  33. Hi
    I’ve no experience at all with Eagle files or Seeedstudio. Do Seeedstudio hold your files or do I have to send a zipped bundle, and if so which ones.

    1. They don’t hold the files – you just send gerbers (some places accept Eagle files). If Aidan is looking in he might be able to comment further.

    2. Hi John,

      I have a batch of 10 of Pete’s boards from Dirty PCB’s I only need 5 so if you want i can send you some.



  34. Hi, I’m new to home control and node red. I’m interest in setting up somting to automate some of my lighting and applances. You have post a lot of great info that inspire me to follow your steps . Btw. I have read a lot of article lately around the home automation topics in the internet. I found openhab have sonting that i need but still there are something that node red may have better control but I still a noob on both openhab or node red. I have one question that you may be able to answer me if you may. I have a samsung air conditioner an a daikin airconditioner in another room both have wifi connection i’d like to be abel to control both wifi enable air conditioner through may be mqtt and node red but i can not find any infomation on the wifi enable aircon controing with nodred any where but i found some binding for samsung and daikin on openhab can i borrow openhab binding to utilize in node red and forgive me how?
    Brest regards,

    1. I think Chumxeed – if you want people to help, you’re going to have to be more specific.

      1. To be specific, yes i want to control my 2 aircon ( daikin and samsung) centrally with node red. There are some solutions created as device binding in openhab as I discovered sof ar. How can i port those solution to node red is what i want.

  35. I am working on a similar project that uses an Adafruit Feather with the ESP8266.
    I am also wanting to use a Nextion display, can you elaborate on why the TX adn RX pines could not be used?
    I have just sent OSH Park my initial design and I routed TX and RX to a pin header so I could play with the Nextion. The Feather has a CP2104 USB-Serial converter onboard that I use to program and use serial monitor so I can see what the board is transmitting.
    Could this not also be used for the Nextion?

    1. Hi Matt

      TX and RX CAN be used – but then it is marginally more difficult to use them for debugging etc, also on power up the TX line throws out a load of debug stuff which you cannot turn off – and in my software I through out even more – so – as I had a few lines doing nothing anyway I figured a software uart was a good alternative – of course technically you could argue that a hardware UART can be faster but it is utterly irrelevant as you are simply not throwing that much info at the Nextions anyway, it’s not as if you can fire bitmaps at them. Yes, ANY micro can be used with a Nextion – it is just serial I/O.

      1. Excellent, I understand it would complicate monitoring due to the commands, Its really just managing your traffic.
        Is the anything wrong with leaving some debug serial traffic that the Nextion does not use, would it just ignore it?
        I also have some free pins I could potentially follow your lead.

        By the way, thanks for all the informative posts – You have helped and inspired me to tackle my own project, now talking MQTT and Node-Red!

        1. You could try the normal TX/RX, I just chose not to— would it ignore it? Well, it is at an odd baud rate on powerup 78k – it may or may not cause a problem – only one way to find out. Excellent – another convert to Node-Red – some day we will have legions (and that means… more NODES!!!!)

  36. Hi Peter,

    first of all let me thank you for sharing all these information! You are doing a great job!
    From the schematic I see that you connect RX and TX from the Nextion LCD direct to the GPIO of the ESP. Does that work without problems? The data sheet mentions something about a snap-back circuit (not really sure what that is) that protects the GPIO from voltages over 6V but still the max. voltage is 3.6V.


    1. We only got 10 made for our own use – I understand SEEED are doing a cheap deal on 10 boards – so cheap in fact that I doubt, if we had spares that we could compete!! All the info is on the blog.

      1. Note that we got the thinnest they have – so that they don’t add un-necessary depth to the Nextion. I’ve tested all the outputs – they work and I’ve JUST updated our software to allow toggling of GPIO16.

    2. Tony,
      If you use Seeed they have an offer on (£6.89 for 10 after conversion from $ and inc. del.) but if you can edit the board file you need to make the length slightly smaller as it was 50.01mm which triggers the seeed import to the next price bracket. This may not be an issue for seedstudio but I thought it safer to just tweak the board outline in Eagle (Pete, did you notice this ?)

      1. Thanks for the update. I don’t have any editing tools (or the skills) for this so I will wait for Pete to have a look!

      2. Give it until say 6:30pm tonight UK time – and the files will all be updated to the exact size.

  37. Good job !!!
    Out of curiosity… do you use the reset / program buttons instead of going the RTS/DTR way ? (or is it hidden in the 2 unmarked header pins) ?

    1. I usually power up with GPIO held to ground – I think on this version Aidan has made it so you can just hold gpio0 to ground – and a cap does the reset. I don’t get a working board until tomorrow (the last batch worked fine, this is an addition so they’ll be ok, the NEXT version may well have a cap and diode on so you don’t have to do the holding of gpio0 to ground – but really it’s no hassle for how often we’ll be programming them is my view.

  38. Pete,
    Thanks for the files, 10 off ordered from Seeedstudio.

    I can tell you that the front panel off my XYZ Junior looks a lot better than the one in your picture (no offence) 😉

    1. Dunno – my friend Aidan is in the process of procuring one – hopefully we’ll both then be able to make decent front panels – the bane of my life- making panels that look like amateur night out.

Comments are closed.