ESP8266 and Nextion Updates

This one will be on-going.. so the plan was to write a blog about the latest version of our little ESP-12 board and it working with the new Nextion display board.

But as happens in life from time to time, it all went wrong at the Nextion end. However…

BoardOur board: We have updated our little ESP8266 board. Minor to be sure – we’ve added the ability to use an RGB serial LED as the indicator and some other minor items like fixing a missing track on the RGB LED. This board works – no cut tracks, no extra wires  – it is absolutely bang-on. In the image to the right you can see the RGB LED bottom left (LED2), extra grounds (bottom) compared to the last model but one – and of course the DHT22 connector introduced in the last revision.

The adc divider is now on the underside of the board and the “adc-div” is around 4k7 for 20v peak – I use it to measure battery voltage. for software see the home control 2016 project in this blog.

The files for this board are here including Eagle and images for viewing. https://www.dropbox.com/sh/5yw140y6l7f6b8s/AAAbi4dGwyMTGmGPrK6_F5mxa?dl=0

The Nextion: I received the latest board from iTead, the NX4024K032_11 which is supposed to be faster and better than the old model Nextions (which, for those reading this freshly – are touch-sensitive serial display boards suitable for a wide range of projects) and I updated the Nextion editor to the latest version.

I had a little difficulty at first because their downloadable editor now insists you tell it the exact model of board – I’d not seen that before. So off I went and made a display with a single button which would send back “Hello” when pressed.

Took me a couple of attempts as I had the serial wiring the wrong way around – anyway, eventually I did the update.  It did not seem to be returning quite what I’d imagined it would so I went in to make changes in the editor. This time around, I could not blow the update. The editor kept coming back saying “Forced interrupt!” no matter what I did. As it happens I have a virgin older design of board – the NX3224T024 – I did the same thing –  and lo – THAT is now dead. I’ve written to the designers and am awaiting an answer, nothing in the last couple of days and I’ve seen others with this problem. Right now the only way to get around it is to put the compiled file from the Nextion editor into an SD card, insert that into the Nextion board and apply power at which point it copies the image across. A LOT faster than using serial but then a lot more messy if you are making frequent changes. On the other hand it means I don’t have to keep disconnecting the board from our test board.

What can I say, everything works as it should do – our board can send commands to the Nextion display and accept input back. For test conditions I set our board to serial2 at 56k {set_serial:2} and created a blank template on the Nextion with 2 buttons – one of which has the pressed command get “nodered~up” and the other get “nodered~down”.  When our board sees incoming with a tilde – it splits the string into two – i.e.  topic and payload – and hence sends a message up or down to the topic nodered via MQTT – easily picked up in Node-Red by the MQTT node.

So no surprises – all works – I did spot a minor error in my manual for the “to_nextion” command – now fixed. So all tested – both old and new Nextion boards, able to both send and receive info to the little blue board.

Facebooktwitterpinterestlinkedin

21 thoughts on “ESP8266 and Nextion Updates

  1. Hi,
    I’m trying to make battery-powered board for an outside temperature monitoring and tried to get information about battery power. Used adc/voltage commands, but it seems there is something strange is going on.

    When there are no 4K7 and 20K resistors soldered to the bottom side – the readings from voltage command are:
    ARPS_00008B07/fromesp/voltage=4.93
    ARPS_00008B07/fromesp/voltage=6.02
    ARPS_00008B07/fromesp/voltage=7.97
    ARPS_00008B07/fromesp/voltage=10.85
    ARPS_00008B07/fromesp/voltage=11.44
    ARPS_00008B07/fromesp/voltage=14.87
    ARPS_00008B07/fromesp/voltage=15.31

    After I soldered resistors, I got:

    ARPS_0018E1BF/fromesp/voltage=0.18
    ARPS_0018E1BF/fromesp/voltage=0.27
    ARPS_0018E1BF/fromesp/voltage=0.29
    ARPS_0018E1BF/fromesp/voltage=0.31

    How can I translate this values to something more related to an actual voltage?

    1. Ok, so – resistors – you should not use the input without resistors – especially at any significant voltage. It does not surprise me that the FIRST set of outputs you have above are as they are – floating all over the place.

      We set the resistors such that the unit would work for voltages including the output from a 12v accumulator. So for example the MQTT returning the voltage might for a 12v car battery read “13.8”

      Depending on your supply, lead lengths etc, it is entirely reasonable that the unit would be showing a fraction of a volt output when sitting doing nothing. The values and variations seem a TAD high but within reason.

      With the resistors if you fasten the input to 5v you should see something near “5.0”

      1. Thank you for you reply. I soldered another node with 4K7 +20K resistors and connected it to a FTDI with 5V power output, however voltage readings are strange anyway:
        ARPS_00008B07/fromesp/voltage=0.14
        ARPS_00008B07/fromesp/voltage=0.16

  2. I am trying to have a few of your version 4 boards made. I downloaded the eagle files from the posted link, but I have a hard time to produce the Gerber files. Before I waste more time, are the Gerber files anywhere available for download?

    Thanks Ruediger

  3. all night been trying to get this !
    read this:
    In order to output a literal backslash, you need to escape it. That means \\ will output a single backslash (and \\\\ will output two, and so on). The reason “aa ///\” doesn’t work is because the backslash escapes the ” (which will print a literal quote), and thus the string is not properly terminated. Similarly, “aa ///\\\” won’t work, because the last backslash again escapes the quote.

    var Mymsg = { payload: “{to_nextion:\”t1.txt=\\\””+msg.payload +” C\\\”\”}”};
    return Mymsg;

    everyday is a school day!

  4. Hi
    I am trying to send temperature to my nextion display but node red functions don’t like the backslashes. if i inject {to_nextion:”t1.txt=\”helloworld\””} this works fine, but i cant put the temperature from another node into the function.
    var Mymsg = { payload: “{to_nextion:t1.txt=”+msg.payload +” C”}; this is as close as i can get, as soon as i put a \ anywhere near it i get an error. i have very limited java script, knowledge, just bumbling along, learning as i go.
    i’m sure the solution is quite simple
    many thanks Chris

  5. Hi Peter,
    I wonder why do you use Nextion instead a cheap 7 ” tablet (40 $) to control IOT devices ?
    A web page or a native android application can display the same controls as Nextion.
    A tablet have a camera, microphone, speakers, very useful in many situations.

    1. Hi

      I’ve had this question before… because by the time I learn some arcane Linux commands to get something like drag and drop and image substitution which I get from Nextion – then find a way to get the thing to power up ultra-reliably into the display without a load of other stuff going on – it all gets to be a bit tedious. Also for my needs I’d also need a reliable MQTT client talking to whatever I used – something that would always recover from power failure or loss of WIFI. I guess for some that will be a way to go.. indeed I use Imperihome for lots of stuff – I have that powering up into the display…. and that works – but for a lot of smaller stuff I prefer the Nextions – or rather I will when we get to the bottom of my current issue with the editor. I got an email this morning to say someone will look at it tomorrow.

      $40 implies around, what, £30 – any tablet at that price is going to be painfully slow.

  6. I did the layout for these PCB switches http://www.ebay.co.uk/itm/301806427774

    They are currently £1.59 for 100 off including post from Hong Kong. If you’re in the UK, the Hong Kong post generally takes less than a week.

    Otherwise, there’s this supplier on Ebay in the UK – http://www.ebay.co.uk/itm/100pcs-3-6-2-5mm-Tactile-Push-Button-Switch-Tact-Switch-Micro-Switch-2-Pin-SMD-/222061732900?hash=item33b3e92424:g:9FUAAOSwoudW8Vlt

    The price is higher at £4.99 for 100, but you’ll get them more quickly if you’re in a hurry!

  7. I had the same problem with the forced interrupt error after upgrading to the Nextion Editor V35. I was using a CH340 usb-ttl at the time. I switched to an older Prolific usb-ttl (2008 driver on Windows 8), that worked fine. Then I switched back to the CH340 and haven’t been able to get the error again. Maybe not related to usb-ttl hardware but that is my experience.

    1. Not being able to program the units via editor software has happened to me a couple of times. Using the compiled file on an sd did the job. I find it a much quicker way with larger files. Might do it for you?

    2. Thanks for that Allan – but I scrubbed the latest version – went back to that 033 version – exactly the same issue – updated it to 035 – issue still there.

      I’m using the same FTDIs I’ve always used… and never EVER had this before – but at least I now know it is not the version number that’s at issue – NOR the older boards as I have two different boards now exhibiting exactly the same issue….

      1. I have just upgraded to 035 on Windows 7 and no issues with uploading to an NX4024T032, using an FTDI module with 2.8.30.0 drivers.
        Lets hope this matter is resolved soon.

        1. Glad its working for you – I’m on Windows 10 64 bit but then it was all working until now. Meanwhile the SD programming route works – and it is fast.

          1. At least you still have access to the devices.
            I’m still on Windows 7 Pro (64bit), but will need to make a decision soon about Windows 10, before my free period expires…. dont like the snooping.

Comments are closed.