Nextion display plugin

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
nick-head
Normal user
Posts: 48
Joined: 15 Nov 2016, 11:09
Location: North East UK

Re: Nextion display plugin

#71 Post by nick-head » 13 Dec 2016, 20:52

Well,

Just tried it with ESPEasy 147 on a nodemcu v 1.0 and it does the same.

Can't understand this a tall
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.

vmfs1968
Normal user
Posts: 42
Joined: 18 Oct 2015, 23:51

Re: Nextion display plugin

#72 Post by vmfs1968 » 13 Dec 2016, 23:29

nick-head wrote:Well,

Just tried it with ESPEasy 147 on a nodemcu v 1.0 and it does the same.

Can't understand this a tall
I am compiling without problems
You have to inside the ESPEasy file _104.ino

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#73 Post by BertB » 14 Dec 2016, 21:25

nick-head wrote:Hi,

I am using the previously mentioned Nextion Plugin (104) and came across a problem.

I cannot output to a n? number if it's below 100, unless I put zero's in front to
make a 3 digit number. Like 001, 073 etc.

Any idea what I am doing wrong ?

Regards

Nick

PS, I am using an ESP8266 NodeMCU V0.9. This maybe the problem, I will try on a 1.0 later on and report back
I have the same problem. Need to dig into this.

nick-head
Normal user
Posts: 48
Joined: 15 Nov 2016, 11:09
Location: North East UK

Re: Nextion display plugin

#74 Post by nick-head » 01 Jan 2017, 19:03

Anyone found out why this is happening ?
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#75 Post by BertB » 01 Jan 2017, 21:05

nick-head wrote:Anyone found out why this is happening ?
Yes. I tried to put the entire file in the ESP8266nu/ESPEasyPluginPlayground. Hope I took the right steps.
In the mean time, hereunder the new code.

Code: Select all

#include <Arduino.h>
#include <SoftwareSerial.h>

//#######################################################################################################
//#################################### Plugin 117: Nextion <info@sensorio.cz>  ###########################
//#######################################################################################################

#define PLUGIN_117
#define PLUGIN_ID_117 117
#define PLUGIN_NAME_117 "Display: Nextion"
#define PLUGIN_VALUENAME1_117 "code"
unsigned long Plugin_117_code = 0;
int8_t Plugin_117_RXpin = -1;
int8_t Plugin_117_TXpin = -1;

SoftwareSerial *nextion;

boolean Plugin_117(byte function, struct EventStruct *event, String &string) {
  boolean success = false;
  static byte displayTimer = 0;

  switch (function) {

    case PLUGIN_DEVICE_ADD: {
      Device[++deviceCount].Number = PLUGIN_ID_117;

      Device[deviceCount].Type = DEVICE_TYPE_DUAL;
      Device[deviceCount].VType = SENSOR_TYPE_QUAD;
      Device[deviceCount].Ports = 0;
      Device[deviceCount].PullUpOption = true;
      Device[deviceCount].InverseLogicOption = false;
      Device[deviceCount].FormulaOption = false;
      Device[deviceCount].ValueCount = 4;
      Device[deviceCount].SendDataOption = true;
      Device[deviceCount].TimerOption = true;
      Device[deviceCount].GlobalSyncOption = true;

      break;
    }

    case PLUGIN_GET_DEVICENAME: {
      string = F(PLUGIN_NAME_117);
      break;
    }

    case PLUGIN_GET_DEVICEVALUENAMES: {
      strcpy_P(ExtraTaskSettings.TaskDeviceValueNames[0],PSTR(PLUGIN_VALUENAME1_117));
      break;
    }
    
    case PLUGIN_TEN_PER_SECOND: {
      char __buffer[80];

      uint16_t i;
      uint8_t c;
      while (nextion->available() > 0) {
        delay(10);
        c = nextion->read();
        
        if (0x65 == c) {
          if (nextion->available() >= 6) {
            __buffer[0] = c;
            for (i = 1; i < 7; i++) {
              __buffer[i] = nextion->read();
            }

            __buffer[i] = 0x00;

            if (0xFF == __buffer[4] && 0xFF == __buffer[5] && 0xFF == __buffer[6]) {
              Plugin_117_code = ((__buffer[1] >> 8) & __buffer[2] >> 8) & __buffer[3];
              UserVar[event->BaseVarIndex] = __buffer[1] * 256 + __buffer[2];
              UserVar[event->BaseVarIndex + 1] = __buffer[3];
              String log = F("Nextion : code: ");
              log += __buffer[1];
              log += ",";
              log += __buffer[2];
              log += ",";
              log += __buffer[3];

              addLog(LOG_LEVEL_INFO, log);
              sendData(event);
            }
          }
        } else {

          if (c == 's') {
            i = 1;
            __buffer[0] = c;
            c=0;
            while (nextion->available() > 0) {
              __buffer[i++] = nextion->read();
              Serial.write((char)__buffer[i]);
            }
            Serial.println();
            __buffer[i] = 0x00;

            UserVar[event->BaseVarIndex] = __buffer[2];
            UserVar[event->BaseVarIndex+1] = __buffer[3];
            UserVar[event->BaseVarIndex+2] = __buffer[4];
            UserVar[event->BaseVarIndex+3] = __buffer[5];

            String log = F("Nextion : send command: ");
            log += __buffer;
            log += UserVar[event->BaseVarIndex];
            addLog(LOG_LEVEL_INFO, log);
            
            ExecuteCommand(VALUE_SOURCE_SYSTEM, __buffer);
          }
        }
      }

      if (Settings.TaskDevicePin3[event->TaskIndex] != -1) {
        if (!digitalRead(Settings.TaskDevicePin3[event->TaskIndex])) {
          Plugin_117_displayOn();
          displayTimer = Settings.TaskDevicePluginConfig[event->TaskIndex][2];
        }
      }

      success = true;
      break;
    }

    case PLUGIN_ONCE_A_SECOND: {
      if ( displayTimer > 0) {
        displayTimer--;
        if (displayTimer == 0)
          Plugin_117_displayOff();
        }
        break;
      }


    case PLUGIN_WEBFORM_SAVE: {

      String plugin1 = WebServer.arg("plugin_117_timer");
      Settings.TaskDevicePluginConfig[event->TaskIndex][0] = plugin1.toInt();
      String plugin2 = WebServer.arg("plugin_117_rxwait");
      Settings.TaskDevicePluginConfig[event->TaskIndex][1] = plugin2.toInt();
      String plugin3 = WebServer.arg("plugin_117_events");
      Settings.TaskDevicePluginConfig[event->TaskIndex][2] = plugin3.toInt();
      String plugin4 = WebServer.arg("plugin_117_sensortype");
      Settings.TaskDevicePluginConfig[event->TaskIndex][3] = plugin4.toInt();

      char deviceTemplate[8][64];
      for (byte varNr = 0; varNr < 8; varNr++) {
        char argc[25];
        String arg = F("Plugin_117_template");
        arg += varNr + 1;
        arg.toCharArray(argc, 25);
        String tmpString = WebServer.arg(argc);
        strncpy(deviceTemplate[varNr], tmpString.c_str(), sizeof(deviceTemplate[varNr]));
      }

//      Settings.TaskDeviceID[event->TaskIndex] = 1; // temp fix, needs a dummy value

      SaveCustomTaskSettings(event->TaskIndex, (byte*)&deviceTemplate, sizeof(deviceTemplate));
    
      success = true;
      break;
    }


    case PLUGIN_WEBFORM_LOAD: {

      char tmpString[128];

      char deviceTemplate[8][64];
      LoadCustomTaskSettings(event->TaskIndex, (byte*)&deviceTemplate, sizeof(deviceTemplate));
      for (byte varNr = 0; varNr < 8; varNr++)
        {
          string += F("<TR><TD>Line ");
          string += varNr + 1;
          string += F(":<TD><input type='text'li size='50' maxlength='50' name='Plugin_117_template");
          string += varNr + 1;
          string += F("' value='");
          string += deviceTemplate[varNr];
          string += F("'>");
        }

      string += F("<TR><TD>Display button:<TD>");
      addPinSelect(false, string, "taskdevicepin3", Settings.TaskDevicePin3[event->TaskIndex]);

      sprintf_P(tmpString, PSTR("<TR><TD>Display Timeout:<TD><input type='text' name='plugin_117_timer' value='%u'>"), Settings.TaskDevicePluginConfig[event->TaskIndex][2]);
      string += tmpString;

      success = true;
      break;
    }

    case PLUGIN_INIT: {

      LoadTaskSettings(event->TaskIndex);
//      if ((ExtraTaskSettings.TaskDevicePluginConfigLong[0] != 0) && (ExtraTaskSettings.TaskDevicePluginConfigLong[1] != 0)) {
//      if (Settings.TaskDevicePin1[event->TaskIndex] != -1) {
//        pinMode(Settings.TaskDevicePin1[event->TaskIndex], OUTPUT);
//       digitalWrite(Settings.TaskDevicePin1[event->TaskIndex], LOW);
//        delay(500);
//        digitalWrite(Settings.TaskDevicePin1[event->TaskIndex], HIGH);
//        pinMode(Settings.TaskDevicePin1[event->TaskIndex], INPUT_PULLUP);
//      }

      displayTimer = Settings.TaskDevicePluginConfig[event->TaskIndex][2];
      if (Settings.TaskDevicePin3[event->TaskIndex] != -1)
          pinMode(Settings.TaskDevicePin3[event->TaskIndex], INPUT_PULLUP);

      if (Settings.TaskDevicePin1[event->TaskIndex] != -1)
        {
          Plugin_117_RXpin = Settings.TaskDevicePin1[event->TaskIndex];
//          pinMode(Plugin_117_RXpin, INPUT_PULLUP);
//          attachInterrupt(Plugin_117_RXpin, RF_ISR, CHANGE);
          success = true;
        }

      if (Settings.TaskDevicePin2[event->TaskIndex] != -1)
        {
          Plugin_117_TXpin = Settings.TaskDevicePin2[event->TaskIndex];
//          pinMode(Plugin_117_TXpin, OUTPUT);
        }
      
      if (!nextion) {
//        nextion = new SoftwareSerial(13,14);
        nextion = new SoftwareSerial(Plugin_117_RXpin , Plugin_117_TXpin);
      }

      Serial.print("pin: ");
      Serial.println(Settings.TaskDevicePin1[event->TaskIndex]);

      nextion->begin(9600);

      success = true;
      break;
    }

    case PLUGIN_READ: {
        char deviceTemplate[8][64];
        LoadCustomTaskSettings(event->TaskIndex, (byte*)&deviceTemplate, sizeof(deviceTemplate));

        for (byte x = 0; x < 8; x++) {
          String tmpString = deviceTemplate[x];
          if (tmpString.length()) {
            String newString = parseTemplate(tmpString, 0);
            Serial.println(newString);

            sendCommand(newString.c_str());
            }
        }
        success = false;
        break;
      }


    case PLUGIN_WRITE: {
      String tmpString = string;
      int argIndex = tmpString.indexOf(',');
      if (argIndex)
        tmpString = tmpString.substring(0, argIndex);
      if (tmpString.equalsIgnoreCase(F("NEXTION"))) {
        argIndex = string.indexOf(',');
        tmpString = string.substring(argIndex + 1);

        sendCommand(tmpString.c_str());

        Serial.println(tmpString);
        success = true;
      }
      break;
    }
  }
  return success;
}




void Plugin_117_displayOn() {
}

void Plugin_117_displayOff() {
  
}

void sendCommand(const char *cmd) {
  nextion->print(cmd);
  nextion->write(0xff);
  nextion->write(0xff);
  nextion->write(0xff);
}

nick-head
Normal user
Posts: 48
Joined: 15 Nov 2016, 11:09
Location: North East UK

Re: Nextion display plugin

#76 Post by nick-head » 01 Jan 2017, 21:52

Nice one Bert,

I am just in the process of uploading to the ESP.

Right, uploaded. Had to remove original plugin as it has redefinitions of SoftwarSerial and other things.

OK, done.

Can't find RX/TX as before. Can't even make it produce anything on the screen.

Totally different interface. Will have to look later, I may have done something wrong at my end.
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#77 Post by BertB » 01 Jan 2017, 22:42

nick-head wrote:Nice one Bert,

I am just in the process of uploading to the ESP.

Right, uploaded. Had to remove original plugin as it has redefinitions of SoftwarSerial and other things.

OK, done.

Can't find RX/TX as before. Can't even make it produce anything on the screen.

Totally different interface. Will have to look later, I may have done something wrong at my end.
I found that the originale interface did not work anymore, so I had to change it.
1st GPIO is now Rx and 2nd GPIO Tx.
Sorry for the inconvenience, but please do not forget, I am only trying to persuade more professional programmers to make ik more beautiful :)

IDX/Var is not yet functional and neither are Display button and Display Timeout.

You can send commands and data to it:
http://espeasy-ip/control?cmd=NEXTION,rest ====> resets the display
http://espeasy-ip/control?cmd=NEXTION,dim=50 ====> dims the backlight to 50%
http://espeasy-ip/control?cmd=NEXTION,page0.n0.val=12 ====> sets the value of n0 on page 0 to 12
http://espeasy-ip/control?cmd=NEXTION,page0.t5.txt="hoi" ====> sets the text of t0 on page 0 to hoi
Attachments
P104_IF.png
P104_IF.png (58.8 KiB) Viewed 112090 times

nick-head
Normal user
Posts: 48
Joined: 15 Nov 2016, 11:09
Location: North East UK

Re: Nextion display plugin

#78 Post by nick-head » 01 Jan 2017, 22:56

No problem Bert,

I have only been experimenting with the plugins for a few days and I have learnt a few things.

I have great respect for any developers who commit their time to produce "free" software based
on ideas generated by many people.

I am using ESPeasy in my home automation system and I have a lot to learn.

Thanks for your time and help.

Nick
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.

nick-head
Normal user
Posts: 48
Joined: 15 Nov 2016, 11:09
Location: North East UK

Re: Nextion display plugin

#79 Post by nick-head » 01 Jan 2017, 23:19

That has cured the <100 problem Bert, works absolutely fine now.

now I have to find something to do with it now.

Thanks Bert, your a star.

Regards

Nick
ESP32, Arduino's,Raspberry Pi's, ESP8266's, Nextion's, Sonoff's, LightWaveRF's, RFXCom 433, and a headache
And a HackRF One, as a present to myself.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#80 Post by BertB » 01 Jan 2017, 23:23

nick-head wrote:That has cured the <100 problem Bert, works absolutely fine now.

now I have to find something to do with it now.

Thanks Bert, your a star.

Regards

Nick
Glad tot be of help,

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#81 Post by Jeff » 05 Jan 2017, 22:07

Hello,
Congratulations for this development. I bought a direct nextion when i discovered it. :D
I try this plugin for a few days and I can not. :(
I created a page, a text box, a value box and a gauge.
I have compiled the last plugin on this page 8 and others before.
I plugged the RX on GPIO13- D7 and TX on GPIO14-D5
It does not communicate, I try the lines or the rules.
Ex line 1: page0.n0.val = 20
Line 2 : page0.t0.txt="[ds18b20#TEMPERATURE]"

Rules :
On ds18b20#TEMPERATURE do
NEXTION,t0.txt="[ds18b20#TEMPERATURE]"
endon

What I forgot ? Thanks

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#82 Post by BertB » 06 Jan 2017, 08:09

Hi, sorry to hear it does not work for you.
I assume you can see the setup page in devices in ESPEasy?
And that you can set GPIO 1 and GPIO 2
And that you did not mix up Tx and Rx?

What hardware do you use?

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#83 Post by Jeff » 06 Jan 2017, 13:39

Thx for your help.
I use a wemos d1 mini.
I paste the sketch in espeay.ino with plugin p117... I compile, it's good. I upload.
Yes i can see the configuration page with the gpio.
I configure the gpio for the rx and tx, not error.
I made a page on the nextion with try a block t0, n0, z0...
I write on in the line 1, line 2....and with rules to try...

What is the wiring ? Need a special library, i have nextion library and i didn't error when i compile, special serial 9600 ou?
Configuration espeasy : domoticz mqtt, spi, configuration pin ?

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#84 Post by BertB » 06 Jan 2017, 13:53

I do not use the Nextion library.
The Nextion itself is a basic model.

The Nextion requires 5 volt power and the ESP 8266 can only handle up to 3.3 volt.
On the Tx pin of the Wemos, you can connect the Rx of the Nextion.
On the Rx pin you need a voltage limiter, because the voltage of the Nextion Tx pin is 5 volts.
For that purpose I use a small signal, high speed diode and a resistor. 1n4448 or so will do fine.


Kathode to Tx of Nextion.
Anode to Rx of Wemos
Resistor of some 10 k or so from Rx of Wemos to + 3.3 volt of Wemos.

You can also try an use the Nextion IDE with a USB to serial converterd to test the Nextion.

User avatar
Binder
Normal user
Posts: 10
Joined: 06 Jan 2017, 13:17
Location: Germany

Re: Nextion display plugin

#85 Post by Binder » 06 Jan 2017, 14:32

Hi Bert,

I think I'm having a similar (or the same) problem as Jeff.

I tried your plugin with a plain esp-12f or a nodemcu-V2.
The pins I use are GPIO13 und 14 (D7 and D5).

The pins itself are functional: for a test I changed the device to a switch and shortened them to ground. success.

Then I connected an FTDI to the pins and there is nothing. It doesn't matter if I use the URL with control?cmd=NEXTION,dim=0 or something in the device configuration. The control window always stays empty. It seems the plugin does not use the configured pins.

The hardware must be ok. For the next test I uploaded the firmware esplink, and then I saw communication on the wire.

Do you have another idea what I can check?

regards
Pete

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#86 Post by BertB » 06 Jan 2017, 14:34

I will start with a fresh wemos to test.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#87 Post by BertB » 06 Jan 2017, 14:47

You could also try to change a part of the code and re compile:

Change:
if (!nextion) {
// nextion = new SoftwareSerial(13,14);
nextion = new SoftwareSerial(Plugin_117_RXpin , Plugin_117_TXpin);
}

into:

if (!nextion) {
nextion = new SoftwareSerial(13,14);
// nextion = new SoftwareSerial(Plugin_117_RXpin , Plugin_117_TXpin);
}

Per haps something goes wrong with the pin assignment.
SPI has to be disabled.

User avatar
Binder
Normal user
Posts: 10
Joined: 06 Jan 2017, 13:17
Location: Germany

Re: Nextion display plugin

#88 Post by Binder » 06 Jan 2017, 15:23

Hi Bert,
it works now. Thanks for your quick workaround.

regards

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#89 Post by Jeff » 06 Jan 2017, 20:57

Thank you for the time.
I understand a little better but I still have questions.
The tx and the rx of the nextion, is it connected to the tx and the rx of the wemos or the GPIO 13 and 14 of the wemos ?
The 5v on the 3.3v, I had not seen my mistake
level.png
level.png (13.94 KiB) Viewed 121361 times
D3 : 1n4007
R2 : 10K

I have ordered a level swicher since, 60 days have not arrived!
The pins itself are functional: for a test I changed the device to a switch and shortened them to ground. success.
It work
You can also try an use the Nextion IDE with a USB to serial converterd to test the Nextion.
It work

I recompiled, tried my editing on 13 and 14 with your proposition but nothing, I tried other GPIOs, nothing either.

My program nextion is it good ? I draw a txt (t0), a number (N0) and a jauge (Z0) !

I go to ski tomorrow, we will see my return :D

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#90 Post by BertB » 07 Jan 2017, 18:08

For only sending data from the Wemos to the Nextion, Rx on the Wemos (Blue wire) is not required.

This is how I connect my nextion.
You can choose to feed it from a strong (Nextion requires sufficient power) usb or an external 5 volt DC power supply.
I tested it with a 1n4448 and a 1n4004 diode.
the colors are the colors of the Nextion cable, where:
blue = Tx (Nextion)
yellow = Rx (Nextion)
red = + 5v
black = gnd

It can be necessary to add capacitors.
Nextion1_Sbb.jpg
Nextion1_Sbb.jpg (42.8 KiB) Viewed 121315 times

Allycat1972
Normal user
Posts: 25
Joined: 19 Apr 2016, 11:12

Re: Nextion display plugin

#91 Post by Allycat1972 » 08 Jan 2017, 14:12

Hi everyone.

So glad this has been developed. I am going to replace my previous incarnation of Heating Thermostat (using a sonoff TH) with this Nextion. I have used Scargills PCB and screen design (modified) with a relay board and small PSU from a phone charger.

The advantage of Scargills board is that is has all the breakouts purposely positioned and also screws to the back of the Nextion screen making it compact.

I added the MQTT Import utility so I can pick up my Heating setpoint and display it along side the Temperature and Humidity from the DHT22 mounted at the bottom. I also brought up the Relay status (light on the right)
IMG_2143.JPG
IMG_2143.JPG (105 KiB) Viewed 120111 times
IMG_2144.JPG
IMG_2144.JPG (137.02 KiB) Viewed 120111 times

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#92 Post by Jeff » 08 Jan 2017, 18:39

BertB wrote:For only sending data from the Wemos to the Nextion, Rx on the Wemos (Blue wire) is not required.

This is how I connect my nextion.
You can choose to feed it from a strong (Nextion requires sufficient power) usb or an external 5 volt DC power supply.
I tested it with a 1n4448 and a 1n4004 diode.
the colors are the colors of the Nextion cable, where:
blue = Tx (Nextion)
yellow = Rx (Nextion)
red = + 5v
black = gnd

It can be necessary to add capacitors.

Nextion1_Sbb.jpg
Thank you for help me.
My wiring was not good for Tx. I use an external 5 volt power.
I'll try to my come back.

If some would like to share their hmi project, it would be great.

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#93 Post by Jeff » 15 Jan 2017, 22:50

Yes it work :mrgreen:
Thanks @BertB

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#94 Post by Jeff » 16 Jan 2017, 21:04

Hello,

I know how to handle texts and retrieve values ​​via mqtt :D
How do you do the buttons to send a command to domoticz ?

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#95 Post by BertB » 16 Jan 2017, 22:50

I am trying to get the input from buttons as follows:
For example, in the Nextion, I have put the following lines in the Tough Release Event section of a button:
if(va1.val==0)
{
va1.val=1
print "|s"
print "idx=99&switchcmd=On"
printh 0a
}else
{
va1.val=0
print "|s"
print "idx=99&switchcmd=Off"
printh 0x0a
}
I use variable va1 as a toggle state memory.
Anyway, the idea is that the Nextion sends idx=99&switchcmd=On en idx=99&switchcmd=Off.

Those values I can now project in the variables of the Nextion plugin. Now I am trying to send those values to Domoticz.
Since I am a self tought programmer, this is not a fast creation process.

Herunder is the accompaniing plugin code. I still do not get it in the playground.

Code: Select all

#include <Arduino.h>
#include <SoftwareSerial.h>

//#######################################################################################################
//#################################### Plugin 117: Nextion <info@sensorio.cz>  ###########################
//#######################################################################################################

#define PLUGIN_117
#define PLUGIN_ID_117 117
#define PLUGIN_NAME_117 "Display: Nextion"
#define PLUGIN_VALUENAME1_117 "code"
unsigned long Plugin_117_code = 0;
int8_t Plugin_117_RXpin = -1;
int8_t Plugin_117_TXpin = -1;

SoftwareSerial *nextion;

boolean Plugin_117(byte function, struct EventStruct *event, String &string) {
  boolean success = false;
  static byte displayTimer = 0;

  switch (function) {

    case PLUGIN_DEVICE_ADD: {
      Device[++deviceCount].Number = PLUGIN_ID_117;

      Device[deviceCount].Type = DEVICE_TYPE_DUAL;
      Device[deviceCount].VType = SENSOR_TYPE_QUAD;
      Device[deviceCount].Ports = 0;
      Device[deviceCount].PullUpOption = true;
      Device[deviceCount].InverseLogicOption = false;
      Device[deviceCount].FormulaOption = false;
      Device[deviceCount].ValueCount = 4;
      Device[deviceCount].SendDataOption = true;
      Device[deviceCount].TimerOption = true;
      Device[deviceCount].GlobalSyncOption = true;

      break;
    }

    case PLUGIN_GET_DEVICENAME: {
      string = F(PLUGIN_NAME_117);
      break;
    }

    case PLUGIN_GET_DEVICEVALUENAMES: {
      strcpy_P(ExtraTaskSettings.TaskDeviceValueNames[0],PSTR(PLUGIN_VALUENAME1_117));
      break;
    }
    
    case PLUGIN_TEN_PER_SECOND: {
      char __buffer[80];

      uint16_t i;
      uint8_t c;
      String Vidx;
      String Nvalue;
      String Svalue;
      String Nswitch;
      
      while (nextion->available() > 0) {
        delay(10);
        c = nextion->read();
        
        if (0x65 == c) {
          if (nextion->available() >= 6) {
            __buffer[0] = c;
            for (i = 1; i < 7; i++) {
              __buffer[i] = nextion->read();
            }

            __buffer[i] = 0x00;

            if (0xFF == __buffer[4] && 0xFF == __buffer[5] && 0xFF == __buffer[6]) {
              Plugin_117_code = ((__buffer[1] >> 8) & __buffer[2] >> 8) & __buffer[3];
              UserVar[event->BaseVarIndex] = __buffer[1] * 256 + __buffer[2];
              UserVar[event->BaseVarIndex + 1] = __buffer[3];
              String log = F("Nextion : code: ");
              log += __buffer[1];
              log += ",";
              log += __buffer[2];
              log += ",";
              log += __buffer[3];

              addLog(LOG_LEVEL_INFO, log);
              sendData(event);
            }
          }
        } else {

          if (c == '|') {
            i = 1;
            __buffer[0] = c;
            c=0;
            while (nextion->available() > 0) {
              __buffer[i] = nextion->read();
              Serial.write((char)__buffer[i]);
              if (__buffer[i]==0x0d) break;
              i++;
            }
            Serial.println("end");
            __buffer[i] = 0x00;

            String tmpString = __buffer;

            int argIndex = tmpString.indexOf("idx=");
            int argEnd = tmpString.indexOf('&');
            if (argIndex)
            Vidx = tmpString.substring(argIndex + 4,argEnd);

            switch (__buffer[1]){
            
              case 'u':

                argIndex = tmpString.indexOf("nvalue=");
                argEnd = tmpString.indexOf('&',argIndex);
                if (argIndex)
                  Nvalue = tmpString.substring(argIndex + 7,argEnd);

                argIndex = tmpString.indexOf("svalue=",argIndex);
                argEnd = tmpString.indexOf(0x0a);
                if (argIndex)
                  Svalue = tmpString.substring(argIndex + 7,argEnd);
                
                break;

              case 's':
      
                argIndex = tmpString.indexOf("switchcmd=",argIndex);
                argEnd = tmpString.indexOf(0x0a);
                if (argIndex)
                  Nvalue = tmpString.substring(argIndex + 10,argEnd);
                if (Nvalue=="On")
                  Nswitch='1';
                if (Nvalue=="Off")
                  Nswitch='0';

                break;
      
            }

//    }
//        tmpString = tmpString.substring(0, argIndex);
//      if (tmpString.equalsIgnoreCase(F("NEXTION"))) {
//        argIndex = string.indexOf(',');
//        tmpString = string.substring(argIndex + 1);
//
//        sendCommand(tmpString.c_str());
//
        
//        success = true;
            Serial.println(tmpString);
            Serial.println(Vidx);
            Serial.println(Nvalue);
            Serial.println(Svalue);
            Serial.println(Nswitch);

            UserVar[event->BaseVarIndex] = Vidx.toFloat();
            UserVar[event->BaseVarIndex+1] = Nvalue.toFloat();
            UserVar[event->BaseVarIndex+2] = Svalue.toFloat();
            UserVar[event->BaseVarIndex+3] = Nswitch.toFloat();

            String log = F("Nextion : send command: ");
            log += __buffer;
            log += UserVar[event->BaseVarIndex];
            addLog(LOG_LEVEL_INFO, log);
            
            ExecuteCommand(VALUE_SOURCE_SYSTEM, __buffer);
          }
        }
      }

      if (Settings.TaskDevicePin3[event->TaskIndex] != -1) {
        if (!digitalRead(Settings.TaskDevicePin3[event->TaskIndex])) {
          Plugin_117_displayOn();
          displayTimer = Settings.TaskDevicePluginConfig[event->TaskIndex][2];
        }
      }

      success = true;
      break;
    }

    case PLUGIN_ONCE_A_SECOND: {
      if ( displayTimer > 0) {
        displayTimer--;
        if (displayTimer == 0)
          Plugin_117_displayOff();
        }
        break;
      }


    case PLUGIN_WEBFORM_SAVE: {

      String plugin1 = WebServer.arg("plugin_117_timer");
      Settings.TaskDevicePluginConfig[event->TaskIndex][0] = plugin1.toInt();
      String plugin2 = WebServer.arg("plugin_117_rxwait");
      Settings.TaskDevicePluginConfig[event->TaskIndex][1] = plugin2.toInt();
      String plugin3 = WebServer.arg("plugin_117_events");
      Settings.TaskDevicePluginConfig[event->TaskIndex][2] = plugin3.toInt();
      String plugin4 = WebServer.arg("plugin_117_sensortype");
      Settings.TaskDevicePluginConfig[event->TaskIndex][3] = plugin4.toInt();

      char deviceTemplate[8][64];
      for (byte varNr = 0; varNr < 8; varNr++) {
        char argc[25];
        String arg = F("Plugin_117_template");
        arg += varNr + 1;
        arg.toCharArray(argc, 25);
        String tmpString = WebServer.arg(argc);
        strncpy(deviceTemplate[varNr], tmpString.c_str(), sizeof(deviceTemplate[varNr]));
      }

//      Settings.TaskDeviceID[event->TaskIndex] = 1; // temp fix, needs a dummy value

      SaveCustomTaskSettings(event->TaskIndex, (byte*)&deviceTemplate, sizeof(deviceTemplate));
    
      success = true;
      break;
    }


    case PLUGIN_WEBFORM_LOAD: {

      char tmpString[128];

      char deviceTemplate[8][64];
      LoadCustomTaskSettings(event->TaskIndex, (byte*)&deviceTemplate, sizeof(deviceTemplate));
      for (byte varNr = 0; varNr < 8; varNr++)
        {
          string += F("<TR><TD>Line ");
          string += varNr + 1;
          string += F(":<TD><input type='text'li size='50' maxlength='50' name='Plugin_117_template");
          string += varNr + 1;
          string += F("' value='");
          string += deviceTemplate[varNr];
          string += F("'>");
        }

      string += F("<TR><TD>Display button:<TD>");
      addPinSelect(false, string, "taskdevicepin3", Settings.TaskDevicePin3[event->TaskIndex]);

      sprintf_P(tmpString, PSTR("<TR><TD>Display Timeout:<TD><input type='text' name='plugin_117_timer' value='%u'>"), Settings.TaskDevicePluginConfig[event->TaskIndex][2]);
      string += tmpString;

      success = true;
      break;
    }

    case PLUGIN_INIT: {

      LoadTaskSettings(event->TaskIndex);
//      if ((ExtraTaskSettings.TaskDevicePluginConfigLong[0] != 0) && (ExtraTaskSettings.TaskDevicePluginConfigLong[1] != 0)) {
//      if (Settings.TaskDevicePin1[event->TaskIndex] != -1) {
//        pinMode(Settings.TaskDevicePin1[event->TaskIndex], OUTPUT);
//       digitalWrite(Settings.TaskDevicePin1[event->TaskIndex], LOW);
//        delay(500);
//        digitalWrite(Settings.TaskDevicePin1[event->TaskIndex], HIGH);
//        pinMode(Settings.TaskDevicePin1[event->TaskIndex], INPUT_PULLUP);
//      }

      displayTimer = Settings.TaskDevicePluginConfig[event->TaskIndex][2];
      if (Settings.TaskDevicePin3[event->TaskIndex] != -1)
          pinMode(Settings.TaskDevicePin3[event->TaskIndex], INPUT_PULLUP);

      if (Settings.TaskDevicePin1[event->TaskIndex] != -1)
        {
          Plugin_117_RXpin = Settings.TaskDevicePin1[event->TaskIndex];
//          pinMode(Plugin_117_RXpin, INPUT_PULLUP);
//          attachInterrupt(Plugin_117_RXpin, RF_ISR, CHANGE);
          success = true;
        }

      if (Settings.TaskDevicePin2[event->TaskIndex] != -1)
        {
          Plugin_117_TXpin = Settings.TaskDevicePin2[event->TaskIndex];
//          pinMode(Plugin_117_TXpin, OUTPUT);
        }
      
      if (!nextion) {
        nextion = new SoftwareSerial(13,14);
//        nextion = new SoftwareSerial(Plugin_117_RXpin , Plugin_117_TXpin);
      }

      Serial.print("pin: ");
      Serial.println(Settings.TaskDevicePin1[event->TaskIndex]);
      Serial.println(Settings.TaskDevicePin2[event->TaskIndex]);
      Serial.println(Plugin_117_RXpin);
      Serial.println(Plugin_117_TXpin);

      nextion->begin(9600);

      success = true;
      break;
    }

    case PLUGIN_READ: {
        char deviceTemplate[8][64];
        LoadCustomTaskSettings(event->TaskIndex, (byte*)&deviceTemplate, sizeof(deviceTemplate));

        for (byte x = 0; x < 8; x++) {
          String tmpString = deviceTemplate[x];
          if (tmpString.length()) {
            String newString = parseTemplate(tmpString, 0);
            Serial.println(newString);

            sendCommand(newString.c_str());
            }
        }
        success = false;
        break;
      }


    case PLUGIN_WRITE: {
      String tmpString = string;
      int argIndex = tmpString.indexOf(',');
      if (argIndex)
        tmpString = tmpString.substring(0, argIndex);
      if (tmpString.equalsIgnoreCase(F("NEXTION"))) {
        argIndex = string.indexOf(',');
        tmpString = string.substring(argIndex + 1);

        sendCommand(tmpString.c_str());

        Serial.println(tmpString);
        success = true;
      }
      break;
    }
  }
  return success;
}




void Plugin_117_displayOn() {
}

void Plugin_117_displayOff() {
  
}

void sendCommand(const char *cmd) {
  nextion->print(cmd);
  nextion->write(0xff);
  nextion->write(0xff);
  nextion->write(0xff);
}

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#96 Post by Jeff » 16 Jan 2017, 23:15

With the advice of @majklovec page 4 I managed to understand how to send commands to domoticz.
It's simple.
1) Try to make a button in the Nextion and check on "Touch release event" - "Send component id"
See the event sent
I create a button, when i push in the logs

Code: Select all

2726562 : Nextion : code: 
2726563 : EVENT: NEXTION#code=6.00
2726566 : EVENT: NEXTION#=0.00
2726569 : EVENT: NEXTION#=0.00
2726571 : EVENT: NEXTION#=0.00
In a rule

Code: Select all

on NEXTION#code=6.00 do
sendtohttp 192.168.1.19,8080,/json.htm?param=switchlight&type=command&idx=52&switchcmd=On
endon
log :

Code: Select all

2765418 : EVENT: NEXTION#code=6.00
2765421 : ACT : sendtohttp 192.168.1.19,8080,/json.htm?param=switchlight&type=command&idx=52&switchcmd=On
2765479 : EVENT: NEXTION#=0.00
2765482 : EVENT: NEXTION#=0.00
2765484 : EVENT: NEXTION#=0.00
Domoticz log :

Code: Select all

2017-01-16 23:13:14.416 User: Admin initiated a switch command (52/Led buanderie/On)
I'm happy :mrgreen:
Last edited by Jeff on 17 Jan 2017, 22:40, edited 1 time in total.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#97 Post by BertB » 17 Jan 2017, 12:23

Ah ... I am going to try that tonight

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#98 Post by BertB » 17 Jan 2017, 23:28

This works very well too.

marko67
New user
Posts: 7
Joined: 20 Jan 2017, 06:40

Re: Nextion display plugin

#99 Post by marko67 » 20 Jan 2017, 07:13

Hello
It is my First Time here. I use one Wemos with a 2,8" Nextion. I have found this Forum to handle it with espeasy.
I have install r147 rc08 yesterday. Everything ok by flash. Now when i Look in to the devices i dosn't finde Nextion display. What is wrong?
The second thing i'll not understand.... the Arduino code that is post here in these thread have i to install at the Wemos too??

I will use ESP and Nextion with Fhem.

Thanks for helping

Marko

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#100 Post by BertB » 21 Jan 2017, 18:23

Hi Marko,
Yes, you have to copy the code in this thread into a file named _P117_Nextion.ino.
I use wordpad for that.
Save that file in the ESPEasy folder.
Start the Arduino IDE, complie and flash.

That should be it.

User avatar
Binder
Normal user
Posts: 10
Joined: 06 Jan 2017, 13:17
Location: Germany

Re: Nextion display plugin

#101 Post by Binder » 22 Jan 2017, 07:51

@Marko,
and don't forget to use PIN13 as RX and PIN14 as TX.
Or change it in the code directly. As a workaround it is a static setting.

marko67
New user
Posts: 7
Joined: 20 Jan 2017, 06:40

Re: Nextion display plugin

#102 Post by marko67 » 22 Jan 2017, 13:19

Hello and thank you for helping BertB an Binder. I have one error after compiling

E:\ESP-WeMos\Neue\Software\ESP-Easy\4\Source\ESPEasy\_P117_Nextion.ino: In function 'boolean Plugin_117(byte, EventStruct*, String&)':

_P117_Nextion:28: error: 'SENSOR_TYPE_QUAD' was not declared in this scope

Device[deviceCount].VType = SENSOR_TYPE_QUAD;

Can you tell me what is wrong?

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#103 Post by BertB » 22 Jan 2017, 13:27

This type is defined in the ESPEasy.ino.

#define SENSOR_TYPE_SINGLE 1
#define SENSOR_TYPE_TEMP_HUM 2
#define SENSOR_TYPE_TEMP_BARO 3
#define SENSOR_TYPE_TEMP_HUM_BARO 4
#define SENSOR_TYPE_DUAL 5
#define SENSOR_TYPE_TRIPLE 6
#define SENSOR_TYPE_QUAD 7
#define SENSOR_TYPE_SWITCH 10
#define SENSOR_TYPE_DIMMER 11
#define SENSOR_TYPE_LONG 20

lines 179-189

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#104 Post by BertB » 22 Jan 2017, 15:34

I changed the code a bit, again.
Unfortunately I can still not put it in the ESPEasyPluginPlayGround.
For some reason I cannot upload any more pics, zo, there is a link below.


The changes are that it better communicates with the Nextion.

I adapted the Hollyberry HMI file.
Image

First I added two variables va0 and va1 and unchecked the Send Component ID of
Bt0, b0 and down buttons.
Next I put some code under the buttons:
Under Tough Release Event of bt0:
if(va1.val==0)
{
va1.val=1
print "|s,i99,sOn"
printh 0a
}else
{
va1.val=0
print "|s,i99,sOff"
printh 0x0a
}

Under Tough Release Event of down:
va0.val--
if(va0.val<0)
{
va0.val=0
}
cov va0.val,t3.txt,0
print "|u,i230,n,s"
print t3.txt
printh 0a

Under Tough Release Event of b0:
va0.val++
if(va0.val>30)
{
va0.val=30
}
cov va0.val,t3.txt,0
print "|u,i230,n,s"
print t3.txt
printh 0a

With this you get a thermostat that can up and down settings of t3, between 0 and 30.
After update it sends a message to the ESP.

Bt0 now is a toggle switch with which I switch a lamp. Just for testing.
B1 only sends the Component ID, but you cannot distinguish on or off.

Next I have made a textbox component in Domoticz, with idx 310. It gets all the messages from the ESPEasy via the HTML interface. Nice to have as a log device.
Sorry, can’t test it with mqtt or others.
I also have a kaku or coco switch with idx 304 and a zwave Thermostat setpoint with idx 79

This is how I have set up the device in ESPEasy:

Image

I also added some rules to the ESP.

on Nextion#idx=99 do
if [Nextion#value]=1
sendtohttp 192.168.0.243,8080,/json.htm?param=switchlight&type=
command&idx=304&switchcmd=On
else
sendtohttp 192.168.0.243,8080,/json.htm?param=switchlight&type=
command&idx=304&switchcmd=Off
endif
endon

on Nextion#idx=230 do
sendtohttp 192.168.0.243,8080,/json.htm?param=udevice&type=
command&idx=79&nvalue=0&svalue=[Nextion#value]
endon

With the code below, you can now also send values.
As for now I distinguish |u for update and |s for switch

The code is far far away from perfect, but per haps it persuades to make better code and more functionality.

https://www.dropbox.com/s/bbn4atau9uppf ... n.ino?dl=0

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#105 Post by Jeff » 23 Jan 2017, 23:05

Very nice changes Berb :)

Thanks for the examples and explanation, it helps us :D

I have to wait for my new nextion, I have broken mine by dropping it :(

rhannink
New user
Posts: 7
Joined: 14 Nov 2016, 10:49

Re: Nextion display plugin

#106 Post by rhannink » 28 Jan 2017, 13:50

Hello,

Can get it to work, I connected a 3.2" advanced Nextion screen (TX to D7/GPIO13 and RX to D5/GPIO14) via a 3v3-5V level shifter.
I installed ESP easy R120 with the plugin 117, compiling and uploading is ok. I am using a NodeMCU v1.

In the ESP easy web interface I created a Sexton device with 1st GPIO 13 and 2nd GPIO 14.

In the line 1: field I added: page0.t0.txt="test"
In the line 2: field I added page0.n0.val=1234

I created a tft file for my Nextion containing a t0,t1,n0, b0 and b1 field.

But when I connect everything and boot, nothing shows up on the Nextion display. I sniffed the RX and TX line going to the Nextion, but no data what so ever shows up.

Any idea what I might do wrong here? Already tried another NodeMCU and other set of GPIO's, but nothing.

Gr. Remco

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#107 Post by BertB » 28 Jan 2017, 15:28

Hi. I never tested IT with a advanced version, so that can be a Challenge. If you don't get any data on rx or tx, you can try to make the tx and rx fixed. I showed how to do that some posts back.

tiit12
New user
Posts: 1
Joined: 09 Feb 2017, 11:57

Re: Nextion display plugin

#108 Post by tiit12 » 09 Feb 2017, 12:06

BertB wrote:For only sending data from the Wemos to the Nextion, Rx on the Wemos (Blue wire) is not required.

This is how I connect my nextion.
You can choose to feed it from a strong (Nextion requires sufficient power) usb or an external 5 volt DC power supply.
I tested it with a 1n4448 and a 1n4004 diode.
the colors are the colors of the Nextion cable, where:
blue = Tx (Nextion)
yellow = Rx (Nextion)
red = + 5v
black = gnd

It can be necessary to add capacitors.

Nextion1_Sbb.jpg
Are you sure, that levelshifter is necessary? As I understood, is Nextion a 3.3 V device (it has own 3.3V voltage regulator on board -- U1 6209A).

Tiit

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#109 Post by BertB » 09 Feb 2017, 15:08

You might be right. I will check tonight.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#110 Post by BertB » 09 Feb 2017, 20:01

@Tiit12
You are so right. I measured the signal with my oscilloscope and it never came above 3.3 volt.
So, I got rid of the diode. Thank you for the tip.

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#111 Post by Jeff » 21 Feb 2017, 22:20

Hello,

After hours of testing,I managed to get weather wunderground and wind, switch and alarm commands with domoticz state feedback and local temperature and domoticz temperature. :mrgreen:

Thank you for the nextion plugin !!!
Nextion_weather.jpg
Nextion_weather.jpg (33.33 KiB) Viewed 214633 times
This is my broken test nextion :(

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Nextion display plugin

#112 Post by BertB » 22 Feb 2017, 14:48

Nice!
And may be broken, but still going strong.

mike86
New user
Posts: 1
Joined: 15 Feb 2017, 09:34

Re: Nextion display plugin

#113 Post by mike86 » 14 Mar 2017, 11:22

Nextion Capacitive Multi-touch Displays for Pro HMI design in Hours
Nextion is launching a indiegogo campaign
for its new arrivals with capacitive multi-touch panel and a good looking shell.

It’s more convenient and easier to design Pro HMI for embedded system.

https://www.indiegogo.com/projects/next ... 6202680/zy

Image

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#114 Post by Jeff » 10 Apr 2017, 21:20

I tried the code of thermostat to @BertB but the code send on serial is bad.
See my log, an idea ?

Code: Select all

52140 : Nextion : send command: s11 49.00
52259 : Nextion : send command: s12 50.00
52471 : Nextion : send command: s13 51.00
52682 : Nextion : send command: s14 52.00
53107 : Nextion : send command: s,i99,sOn 105.00
54210 : Nextion : send command: s,i99,sOff!²105.00
I tried the old (playground) and newest (post page 11) version, no change :(

Now, i have this after compiling a fresh version espeasy

Code: Select all

29006 : Nextion : send command: |u,i230,n,s6 230.00
29006 : EVENT: NEXTION#code=230.00
29014 : EVENT: NEXTION#=6.00
29021 : EVENT: NEXTION#=0.00
29028 : EVENT: NEXTION#=0.00
97012 : Nextion : send command: |s,i99,sOn 99.00
97013 : EVENT: NEXTION#code=99.00
97021 : EVENT: NEXTION#=1.00
97028 : EVENT: NEXTION#=0.00
97035 : EVENT: NEXTION#=0.00
Nextion ide new version v0.46
Arduino ide 1.6.13

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Nextion display plugin

#115 Post by grovkillen » 11 Apr 2017, 10:16

Just want to add that I just got my 2.4" Nextion display the other day and I follow this thread with great interest! :P

I found this blog which is very informative about the Nextion/ESP symbiosis.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#116 Post by Jeff » 11 Apr 2017, 23:29

It works but i don't know really why ! :(
I've taked an old *.bin and it's ok !
I do a lot of testing, in the end I get lost :D
20170411_232631.jpg
20170411_232631.jpg (42.17 KiB) Viewed 214342 times
Edit : I tried with a Release candidates version espeasy (Firmware image R147_RC8) and the plugin Nextion page 11 of this topic and version nextion ide last v0.46
It work ! ;)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Nextion display plugin

#117 Post by grovkillen » 12 Apr 2017, 06:49

Is it possible to get the input from the display back into ESPEasy? Or is it only one way as of now? Looking good though! :-)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#118 Post by Jeff » 12 Apr 2017, 09:45

I want help you but i don't understand your question !
What display want you :)

You can look the post i made in french
https://easydomoticz.com/forum/viewtopi ... =24&t=3731

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Nextion display plugin

#119 Post by grovkillen » 12 Apr 2017, 10:23

Well, if you press a (virtual) button on the display, will that give that information (that the button is pressed) back to the ESP?

My question: is it possible to use the Nextion as input?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Jeff
Normal user
Posts: 26
Joined: 18 Nov 2016, 18:35

Re: Nextion display plugin

#120 Post by Jeff » 12 Apr 2017, 12:50

Yes very easy.
Have you see my post page 10 with code = ID button ?

Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests