Nextion display plugin

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
Cdzn
Normal user
Posts: 58
Joined: 06 Oct 2020, 18:15

Re: Nextion display plugin

#501 Post by Cdzn » 01 May 2021, 11:25

Ath wrote: 01 May 2021, 11:05 Ah, the Level plugin. But still nothing specific to the Nextion.

For the Level control you can react on a sensor value changing from a specific threshold (hysteresis). You would need a rule like:

Code: Select all

on Level#Output do
  if %eventvalue% = 1
    // value within range
  else
    // value outside set range
  endif
endon
It can be used to display a warning on the Nextion (or any other type of output, like a buzzer, LED, OLED, or send an email).
I found solution and it works well. For other who wants thermostat with Nextion display.
Here is the rules in ESP-Easy

Code: Select all

on NEXTTEST#idx=505 do
  if [thermTEST#getLevel]>15
    config,task,thermTEST,setlevel,[thermTEST#getLevel]-0.5
    NEXTTEST,page0.t1.txt="[thermTEST#getLevel]" //by this we display on current temperature visible
endif
endon

on NEXTTEST#idx=504 do
  if [thermTEST#getLevel]<27
    config,task,thermTEST,setlevel,[thermTEST#getLevel]+0.5
    NEXTTEST,page0.t1.txt="[thermTEST#getLevel]"
  endif
endon
NEXTTEST#idx=505 and NEXTTEST#idx=504 is the button i created in Nextion editor (see logs in esp when u push the buttons and u will see the uniq IDX) and check "Send component ID" for both buttons

[thermTEST#getLevel] it`s the regulator level i called thermTEST. U should set getLevel for middle position. Thanks all for support and advice
Last edited by Cdzn on 01 May 2021, 16:23, edited 3 times in total.

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Nextion display plugin

#502 Post by Ath » 01 May 2021, 11:37

ok, great you solved it, sorry that I couldn't help better :).
/Ton (PayPal.me)

Cdzn
Normal user
Posts: 58
Joined: 06 Oct 2020, 18:15

Re: Nextion display plugin

#503 Post by Cdzn » 01 May 2021, 11:44

Ath wrote: 01 May 2021, 11:37 ok, great you solved it, sorry that I couldn't help better :).
You helped, just said I couldn’t do it how You imagine)

namxcap
Normal user
Posts: 14
Joined: 06 May 2021, 23:57

Re: Nextion display plugin

#504 Post by namxcap » 11 May 2021, 10:50

Hello all, i can read temperature from esp and send it to the Nextion display, i can send data from Nextion to esp.
Now i would like to push a button on the Nextion and set a new value in a Virtual Thermostat in Domoticz (idx and value) but i don't know how to do it, what is the command to send to esp ?
I read it's easy but i think i'm missing something .......

P.S.: The plugin needs to be installed ?

Thanyou

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Nextion display plugin

#505 Post by TD-er » 11 May 2021, 11:11

You can take several routes for this.
I think the simplest way is to add a task running a Dummy plugin.
This will then be filled via the rules and you can attack any controller to this dummy task which will then send the data to the connected controller(s).

In the rules, you must then act on the push from the nextion in the rules.

I am not that familiar with the Nextion plugin myself, but I guess you can receive an event from it when you push a button.
So on that event, you have to act in the rules.

I also don't know where your value comes from, but I guess it may be included in the event? Or can you fetch it from another task?
If it comes from the event, you should refer to it like this: %eventvalue1%
If it must be taken from a task, you should refer to it like this: [taskname#varname]

The value must then be set to a position in the dummy task and you must run the dummy task to 'flush' the values to the connected controller(s)
See https://espeasy.readthedocs.io/en/lates ... skvalueset
There is also a shortcut for TaskValueSet and TaskRun, which is called TaskValueSetAndRun
You must then know the task index and the variable index (see the linked documentation)

In the rules:

Code: Select all

on myevent do
  TaskValueSetAndRun,1,0,[taskname#varname]  // When fetching from another task
endon
The IDX you need, you have to set in the dummy variable next to where you link a Domoticz controller to the task.

namxcap
Normal user
Posts: 14
Joined: 06 May 2021, 23:57

Re: Nextion display plugin

#506 Post by namxcap » 11 May 2021, 18:27

i don't understand...

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Nextion display plugin

#507 Post by ThomasB » 12 May 2021, 01:23

Now i would like to push a button on the Nextion and set a new value in a Virtual Thermostat in Domoticz (idx and value) but i don't know how to do it, what is the command to send to esp ?
The Nextion plugin has a "Send to Controller" option. If this option is selected the idx and value data will be sent to your controller. Your controller must be installed in ESPEasy's Controllers tab. There are two different Domoticz controllers to choose from.

BTW, there are three different data formats for sending Nextion touch commands to ESPEasy. The format you select is your choice. Information is explained here (see Nextion Data Format Summary section):
https://espeasy.readthedocs.io/en/lates ... /P075.html

Perhaps you mean you need advice on how to process the touch event data in your ESPEasy rules. TD-er offered a way to use the "dummy" device plugin to do this. As an alternative, here is a rule example that detects Nextion's idx that ranges from 10 to 30. It does not use the dummy plugin; It is just a basic example I pulled from one of my installations that shows how to act on a range of touch events using a rule.

Code: Select all

on NEXTION#idx do
  if [NEXTION#idx]>=10 and [NEXTION#idx]<=30 // Only observe idx 10 to 30.
// Your rule actions go here.
  endif
endon
Regarding Domoticz, information on using ESPEasy Nextion with Domoticz is available here: https://www.letscontrolit.com/wiki/inde ... IONDisplay
Hopefully the information helps you. I'm not a Domoticz user so I can't offer any additional advice.

- Thomas

namxcap
Normal user
Posts: 14
Joined: 06 May 2021, 23:57

Re: Nextion display plugin

#508 Post by namxcap » 24 May 2021, 19:25

Hello .....
No way
I don't understand because this command:

http://192.168.0.50:8088/json.htm?type= ... etpoint=11

return this error:

Command unknown: http://192.168.0.50:8088/json.htm?type= ... etpoint=11

In a browser it works, but in letscontrolit command line it doesn't

namxcap

Cdzn
Normal user
Posts: 58
Joined: 06 Oct 2020, 18:15

Re: Nextion display plugin

#509 Post by Cdzn » 25 May 2021, 10:34

Because this is 2 different commands. Internal commands can be used only from command line. read this
https://www.letscontrolit.com/wiki/inde ... _Reference
Also for your project you will find here all of you needed
https://www.letscontrolit.com/wiki/inde ... 2C_HTTP.5D

And these link describes how you should read touch events

https://www.letscontrolit.com/wiki/index.php/Nextion

For domoticz switchig from ESPEasy use this command http://192.168.0.101:8084/json.htm?type ... etpoint=25, just put your Values for thermostat. You can compare this rule

on NEXTION#idx=505 do
if [thermTEST#getLevel]>15
config,task,thermTEST,setlevel,[thermTEST#getLevel]-0.5
NEXTION,page0.t1.txt="[thermTEST#getLevel]"
endif
endon

on NEXTION#idx=504 do
if [thermTEST#getLevel]<27
config,task,thermTEST,setlevel,[thermTEST#getLevel]+0.5
NEXTION,page0.t1.txt="[thermTEST#getLevel]"
endif
endon

with HTTP-request
I still in progress. If u find a solution remind me pls

Cdzn
Normal user
Posts: 58
Joined: 06 Oct 2020, 18:15

Re: Nextion display plugin

#510 Post by Cdzn » 25 May 2021, 14:26

Cdzn wrote: 01 May 2021, 11:25
Ath wrote: 01 May 2021, 11:05 Ah, the Level plugin. But still nothing specific to the Nextion.

For the Level control you can react on a sensor value changing from a specific threshold (hysteresis). You would need a rule like:

Code: Select all

on Level#Output do
  if %eventvalue% = 1
    // value within range
  else
    // value outside set range
  endif
endon
It can be used to display a warning on the Nextion (or any other type of output, like a buzzer, LED, OLED, or send an email).
I found solution and it works well. For other who wants thermostat with Nextion display.
Here is the rules in ESP-Easy

Code: Select all

on NEXTTEST#idx=505 do
  if [thermTEST#getLevel]>15
    config,task,thermTEST,setlevel,[thermTEST#getLevel]-0.5
    NEXTTEST,page0.t1.txt="[thermTEST#getLevel]" //by this we display on current temperature visible
endif
endon

on NEXTTEST#idx=504 do
  if [thermTEST#getLevel]<27
    config,task,thermTEST,setlevel,[thermTEST#getLevel]+0.5
    NEXTTEST,page0.t1.txt="[thermTEST#getLevel]"
  endif
endon
NEXTTEST#idx=505 and NEXTTEST#idx=504 is the button i created in Nextion editor (see logs in esp when u push the buttons and u will see the uniq IDX) and check "Send component ID" for both buttons

[thermTEST#getLevel] it`s the regulator level i called thermTEST. U should set getLevel for middle position. Thanks all for support and advice
Here is description how i used the rules

namxcap
Normal user
Posts: 14
Joined: 06 May 2021, 23:57

Re: Nextion display plugin

#511 Post by namxcap » 25 May 2021, 20:01

Cdzn wrote: 25 May 2021, 10:34 Because this is 2 different commands. Internal commands can be used only from command line. read this
https://www.letscontrolit.com/wiki/inde ... _Reference
Also for your project you will find here all of you needed
https://www.letscontrolit.com/wiki/inde ... 2C_HTTP.5D

And these link describes how you should read touch events

https://www.letscontrolit.com/wiki/index.php/Nextion

For domoticz switchig from ESPEasy use this command http://192.168.0.101:8084/json.htm?type ... etpoint=25, just put your Values for thermostat. You can compare this rule

on NEXTION#idx=505 do
if [thermTEST#getLevel]>15
config,task,thermTEST,setlevel,[thermTEST#getLevel]-0.5
NEXTION,page0.t1.txt="[thermTEST#getLevel]"
endif
endon

on NEXTION#idx=504 do
if [thermTEST#getLevel]<27
config,task,thermTEST,setlevel,[thermTEST#getLevel]+0.5
NEXTION,page0.t1.txt="[thermTEST#getLevel]"
endif
endon

with HTTP-request
I still in progress. If u find a solution remind me pls
But
http://192.168.0.101:8084/json.htm?type ... etpoint=25
does not work in a rule ....

Cdzn
Normal user
Posts: 58
Joined: 06 Oct 2020, 18:15

Re: Nextion display plugin

#512 Post by Cdzn » 31 May 2021, 13:28

namxcap wrote: 25 May 2021, 20:01
Cdzn wrote: 25 May 2021, 10:34 Because this is 2 different commands. Internal commands can be used only from command line. read this
https://www.letscontrolit.com/wiki/inde ... _Reference
Also for your project you will find here all of you needed
https://www.letscontrolit.com/wiki/inde ... 2C_HTTP.5D

And these link describes how you should read touch events

https://www.letscontrolit.com/wiki/index.php/Nextion

For domoticz switchig from ESPEasy use this command http://192.168.0.101:8084/json.htm?type ... etpoint=25, just put your Values for thermostat. You can compare this rule

on NEXTION#idx=505 do
if [thermTEST#getLevel]>15
config,task,thermTEST,setlevel,[thermTEST#getLevel]-0.5
NEXTION,page0.t1.txt="[thermTEST#getLevel]"
endif
endon

on NEXTION#idx=504 do
if [thermTEST#getLevel]<27
config,task,thermTEST,setlevel,[thermTEST#getLevel]+0.5
NEXTION,page0.t1.txt="[thermTEST#getLevel]"
endif
endon

with HTTP-request
I still in progress. If u find a solution remind me pls
But
http://192.168.0.101:8084/json.htm?type ... etpoint=25
does not work in a rule ....
Read this
https://www.letscontrolit.com/wiki/inde ... SendToHTTP

dokho
New user
Posts: 6
Joined: 11 Jul 2017, 18:32

Re: Nextion display plugin

#513 Post by dokho » 28 Dec 2021, 17:39

Hi !

Is it possible to send a mqtt msg when the nextion screen wake up ?

I use thsp and thup to put the screen in sleep mode but i want to update data when the screen wake up.


Someone have an idea ?


Regards,

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#514 Post by Smotek7 » 25 Mar 2022, 18:56

Hello,
I use a plugin for nextion.
I record the TFT file using an SD card.
Is it possible to create a virtual Com port in the PC and use Upload directly with the Nextion editor?
Or would it go through SER2NET?
So that I don't have to disassemble the display.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Nextion display plugin

#515 Post by ThomasB » 25 Mar 2022, 23:01

ESPEasy does not support Nextion OTA updates.

I don't recall anyone sharing a SER2NET workaround. So perhaps you can try it out and share the experience with us.

On my Nextion builds I have a slot for inserting the SD card. But if you must do OTA then consider using a WiFi enabled SD Card. Such as the Toshiba FlashAir (may not work since it is fussy, but best example I can offer).

- Thomas

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#516 Post by Smotek7 » 26 Mar 2022, 08:32

Thomas, thank you for your response.
WIFI SD will probably not be suitable, because after the update it must be removed so that the display works in normal mode.
I haven't used SER2NET yet.
I'll definitely try it when it's time.
The idea was really 2 tasks
Nextion plugin and SER2NET and when uploading to nexion I activate SER2NET here.
It would be great if it was directly supported by the Nextion plugin.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#517 Post by Smotek7 » 28 Mar 2022, 22:30

Hi,
I set up a Ser2Net task:
ser2net.JPG
ser2net.JPG (52.54 KiB) Viewed 90191 times
I will set up virtual COM in the PC. (COM23)
Communication tested via COM converter and Arduino monitor.

I will try to make the Nextion editor Upload,
connects to the display.
The start is OK.
Log:

Code: Select all

Connected! Com: COM23, baudrate: 2400, Model: NX4832K035_011R (RTP), firmware Ver: S163, Device serial number: DB60405353314B2F, CPUID: 61699, Flash Size: 33554432 (32MB) address: 0
Forced upload baudrate: 9600 Start uploading
Forced interrupt!
"Waiting Data ..." remains on the display

I don't know why communication doesn't continue.
Any idea?

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Nextion display plugin

#518 Post by ThomasB » 29 Mar 2022, 05:38

Your log shows that SER2NET found the Nextion. That's amazing.

The Nextion Plugin should be disabled while you use SER2NET. Otherwise the Nextion plugin will intercept the serial data and affect SER2NET communication.

Beyond that, you are in uncharted territory. So I suspect you will have to debug this on your own.

- Thomas

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#519 Post by Smotek7 » 29 Mar 2022, 08:13

The Nextion Plugin should be disabled while you use SER2NET. Otherwise the Nextion plugin will intercept the serial data and affect SER2NET communication.
I have tried this, only one task needs to be active.

I tried various Ser2Net settings.
My knowledge is not large enough for this.

It would be great if this feature was part of the Nextion plugin.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#520 Post by Smotek7 » 03 Apr 2022, 22:59

I couldn't move on.
I also tried ESP8266,
if there is no problem in ESP32.

Communication always crashes after initialization.
I assume this is related to the warning:
WARNING: Applications that send large data packets like P1 smart meters do not work properly with the current firmware version. This may change in the future as it depends on Arduino ESP8266 core 2.4.0 development.

Plugin P044 was created for greater data transfer.
I don't understand what the difference is, they are serial communications.

Does it make sense to spend time on that?

@Ath @Td-er
Can you advise me what to try?
Or it's a time-consuming thing.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Nextion display plugin

#521 Post by TD-er » 04 Apr 2022, 09:05

Always use HW serial for devices that send large messages.
Software serial is working fine for short messages, but it does cause a lot of interrupts which will also mess with other functions like WiFi.
For example receiving bursts of data from a GPS is also affecting performance of the ESP a lot when using SW serial.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#522 Post by Smotek7 » 04 Apr 2022, 09:50

TD-er
I probably don't quite understand how I can choose HW serial for the SER2NET plugin.
I have ESP32 on Uart2's Nextion connected. (I can't change this)
I want to send data there with a virtual Com PC port.
Or is it possible to directly access Uart2 via telnet port 23, for example?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Nextion display plugin

#523 Post by TD-er » 04 Apr 2022, 13:25

The ESPEasy build for ESP32 does not have software serial, thus if you are using an ESP32, it will always use HW serial.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#524 Post by Smotek7 » 04 Apr 2022, 15:29

Yes I use ESP32,
but why can I select any pins in SER2NET when it is HW serial?

The problem of communication with Nextion is the same for ESP32 and ESP8266.
Initialization takes place, the display responds.
Communication ends when I start sending data.
Display shows:
Waiting data ...
Nextion editor:
Forced upload baudrate: 9600 Start uploading

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Nextion display plugin

#525 Post by TD-er » 04 Apr 2022, 15:35

ESP32 does have 3 HW serial ports.
However, due to the GPIO matrix, one can assign almost any HW bus to almost any GPIO pin(s).

So you can set Serial2 to pin X and Y, as long as those are not used for something else. (e.g. normal switching, analog input, I2C, another HW serial port, etc)
The same for Serial0 and 1.
Usually one does not change the pins for Serial0 as that one is used for receiving commands and outputting log and it is often wired to the USB to serial chip on the board.
But with "Use Serial" unchecked on the tools->Advanced page, one can repurpose the Serial0 port on other pins to drive some other sensor or display like the Nextion.

Just make sure you only use each Serial port once, thus not use Serial1 (as an example) for 2 enabled tasks.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#526 Post by Smotek7 » 04 Apr 2022, 16:54

Now I understand
also why it is set in SER2NET Serial 0,1,2 and pins.

The question now why Nextion does not communicate when HW Serial is used.
I also tried to change the size of Bufer, but no change.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#527 Post by Smotek7 » 08 May 2022, 21:10

If someone searches for Nextion in a box, they will find it in Sonoff NSPanel.
Give it to EspEasy. And it works.
The only thing I can't play an HMI file via EspEasy is that I always have to disassemble it and upload it with a cable.
Both the buttons and the buzzer work.
SONOFF.jpg
SONOFF.jpg (34.2 KiB) Viewed 89354 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Nextion display plugin

#528 Post by TD-er » 08 May 2022, 21:36

Had not yet looked at those Sonoff NSPanel things, but they don't seem to be that expensive, given it houses a Nextion unit.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#529 Post by Smotek7 » 08 May 2022, 22:14

TD-er
I bought the US version for 57 € also with shipping on ALI.
And it has no resistive touch but capacitive.

Drmucki
New user
Posts: 2
Joined: 08 May 2022, 10:55

Re: Nextion display plugin

#530 Post by Drmucki » 29 May 2022, 18:35

Hi out there,

I am just trying to realize a pool control system with a Nextion-Display display and ESPEasy.
Everything works fine. Temperatures can be shown, buttons can be pressed, rules are showing the right status of the buttons and submitting the temperatures, getting by MQTT and DS18b20.
But what is not working is setting up the temperature and pass I to ESPeasy.

There are 2 buttons bt0 and bt1 (up and down) and in the middle of the Buttons is a Number field n0 and a variable va0 is used
by pressing the button up for example a Touch Press Event is :

va0.val=va0.val+1
if(va0.val>45)
{
va0.val=45
}
n0.val=va0.val
print "|u,i230,n,s"
print va0.val
print 0a


for the down button I use

va0.val=va0.val+1
if(va0.val<15)
{
va0.val=15
}
n0.val=va0.val
print "|u,i231,n,s"
print va0.val
print 0a


I want to receive the value (here the variable va0, which is changed by pressing the button) within ESPEasy.
But in ESPEasy only the idx changes when pressing the up and down buttons, the value stays zero.

I also tried to use nodered (which is my home automation system) to act via MQTT on the button presses, but this is too slow and gets screwed up.

Did anybody manage to send variables from Nextion-Display to ESPEasy which are not 0/1 and ON OFF ??

Thank you for your help in advance

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Nextion display plugin

#531 Post by Ath » 30 May 2022, 12:01

Drmucki wrote: 29 May 2022, 18:35 for the down button I use

va0.val=va0.val+1
if(va0.val<15)
{
va0.val=15
}
n0.val=va0.val
print "|u,i231,n,s"
print va0.val
print 0a


I want to receive the value (here the variable va0, which is changed by pressing the button) within ESPEasy.
But in ESPEasy only the idx changes when pressing the up and down buttons, the value stays zero.
Have you tried to send a literal value, instead of a variable, to check if that is received?
I've looked at the plugin code, but that hasn't changed in quite some time, and the script you used seems to reflect code from earlier in this forum thread, so I would expect that others have got it working.
/Ton (PayPal.me)

Drmucki
New user
Posts: 2
Joined: 08 May 2022, 10:55

Re: Nextion display plugin

#532 Post by Drmucki » 30 May 2022, 19:23

Ok. It is really simple when you know what it is....

The print|u with the "" is sending strinigs over the serial port, when you use print xy.val a value is sent, the hex values for text is different from an integer value.
So we have to convert the variable into a text (String) before we sent it after the print pipe expression.
covx is used for conversions between numeric and strings

so the following code does the job! Any variable stored in va0.val can be sent and is received as value within ESPEasy

va0.val=va0.val-1
if(va0.val>40)
{
va0.val=40
}
covx va0.val,t0.txt,0,0
print "|u,i230,n,s"
print t0.txt
printh 0a

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Nextion display plugin

#533 Post by Ath » 30 May 2022, 21:21

Thanks for posting the solution. Don't own Nextion hardware, so haven't studied the Nextion programming language or its syntax.
/Ton (PayPal.me)

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#534 Post by Smotek7 » 18 Sep 2022, 10:23

Hi,
can the characters "%" and "°" be sent to the display via http?
something like
http://192.168.1.129/control?cmd=disp,page3.t3.txt="26%"
http://192.168.1.129/control?cmd=disp,p ... xt="24.3°C"

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Nextion display plugin

#535 Post by TD-er » 18 Sep 2022, 11:26

See the system variables page for some special characters
{D} will (most of the time) be replaced by a degree symbol.
Not 100% sure the degree symbol is present in the Nextion font, but you can try it.

About the percent sign.
If you send the command via the tools page command field, the page will be reloaded and the URL including url-encoded characters will be displayed.
This way you can also use quotes and other characters which might need some special encoding to be used in a HTTP GET call.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#536 Post by Smotek7 » 18 Sep 2022, 16:11

@TD-er

{D} will display something like A^°
but you pointed me in the right direction
just enter "%" followed by the number of the ascii character
for example
%25 what is "%"
%B0 what is "°"
it works
Thank you

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Nextion display plugin

#537 Post by TD-er » 18 Sep 2022, 22:12

Great!
So the Nextion is using the old-fashioned Extended ASCII table.
That's good to know.

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: Nextion display plugin

#538 Post by Wiki » 24 Sep 2022, 14:28

Ha!

Well done, closes some open issues in my projects.

Never had the idea to try this out, Thankyou!

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

flightman
Normal user
Posts: 15
Joined: 17 Jul 2023, 17:48

Re: Nextion display plugin

#539 Post by flightman » 17 Jul 2023, 17:54

Hello
I just bought an NSPANEL UK.
I flashed it in "20230623 Display 4M" version.
When I set the device, nothing works (while the screen works well under tasmota).
Capture.PNG
Capture.PNG (51.34 KiB) Viewed 85110 times


NB: I have unchecked the box concerning the serial in advanced setting.
c1.PNG
c1.PNG (32.62 KiB) Viewed 85105 times


I checked with the Nextion software, the connection is indeed 115200 on my screen.

When I do in chrome "http://IP_OF_MY_NEXTION/control?cmd=NEXTION,dim=50"
It display : "NEXTION075 : WRITE = dim=50 OK"
But the screen stay Dark instead of showing me the page I configured via the NEXTION editor.


Could you tell me what I need to do to make it work?
Thanks in advance.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Nextion display plugin

#540 Post by ThomasB » 17 Jul 2023, 20:02

First, let me say that I have not used the Nextion plugin on a ESP32 (I use a ESP8266). And I don't use the NSPANEL (I use the common Nextion Display).

The ESPEasy Plugin info you posted looks correct to me. And if the test setup's wiring worked with Tasmota then you have confirmed that power and serial port wiring is valid.

But from what I read about the NSPANEL's command syntax, I don't expect it to work with the ESPEasy Nextion plugin. It appears that the NSPANEL commands are hex formatted whereas the Nextion uses traditional text strings. More info about the NSPANEL format can be read here: https://blakadder.com/nspanel-hacking/

But perhaps I am wrong. @TD-er or @Ath may join in and correct any bad info I have provided.

EDIT / UPDATE: Others have reported success when using ESPEasy with the NSPanel. So ignore my comments!

- Thomas
Last edited by ThomasB on 18 Jul 2023, 19:55, edited 1 time in total.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#541 Post by Smotek7 » 17 Jul 2023, 20:35

Do we have a magic formula?

You need to create rules

on system#boot to
gpio,4.0
endon

You can test the connection via the buzzer.
IP/control?cmd=tone,21,1300,200

flightman
Normal user
Posts: 15
Joined: 17 Jul 2023, 17:48

Re: Nextion display plugin

#542 Post by flightman » 17 Jul 2023, 20:44

Thanks to you both, I'll give it a try.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Nextion display plugin

#543 Post by TD-er » 17 Jul 2023, 22:47

Hmm seems like we might need to add some translation stuff for the NSpanel units.

I do have one here, but it is still in its original box, so haven't tried it myself yet.

flightman
Normal user
Posts: 15
Joined: 17 Jul 2023, 17:48

Re: Nextion display plugin

#544 Post by flightman » 18 Jul 2023, 08:02

Smotek7 wrote: 17 Jul 2023, 20:35 Do we have a magic formula?

You need to create rules

on system#boot to
gpio,4.0
endon

You can test the connection via the buzzer.
IP/control?cmd=tone,21,1300,200
Buzzer is ok and just modify the rules and it works

on system#boot do
gpio,4.0
endon

But always the same issue, when I writein chrome "http://IP_OF_MY_NEXTION/control?cmd=NEXTION,dim=50"
It display : "NEXTION075 : WRITE = dim=50 OK"
but nothing changes
same for other command
Last edited by flightman on 18 Jul 2023, 08:09, edited 1 time in total.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#545 Post by Smotek7 » 18 Jul 2023, 08:09

Did you reboot?

flightman
Normal user
Posts: 15
Joined: 17 Jul 2023, 17:48

Re: Nextion display plugin

#546 Post by flightman » 18 Jul 2023, 08:10

Smotek7 wrote: 18 Jul 2023, 08:09 Did you reboot?
There was an error "to" instead of "do" in the rule, I edited my post.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#547 Post by Smotek7 » 18 Jul 2023, 08:19

Now I noticed that you have Tx Rx on the contrary.
I think that it is wrongly marked in the HW display.
This is how I do it.
disp2.png
disp2.png (8.35 KiB) Viewed 85037 times
Yes, I use the Nextion plugin on NSPanel.
US version 1pc,
EU version 1pc (works approx. 1 year)

flightman
Normal user
Posts: 15
Joined: 17 Jul 2023, 17:48

Re: Nextion display plugin

#548 Post by flightman » 18 Jul 2023, 08:19

OK I changed my configuration and now it seems to work. (I manage to modify some text).
Thank you
But the "dim=" command causes no change.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#549 Post by Smotek7 » 18 Jul 2023, 08:21

flightman wrote: 18 Jul 2023, 08:10
Smotek7 wrote: 18 Jul 2023, 08:09 Did you reboot?
There was an error "to" instead of "do" in the rule, I edited my post.
Sorry, I'm using a translator, and it messed it up.

Smotek7
Normal user
Posts: 142
Joined: 01 Aug 2020, 16:18
Location: SK

Re: Nextion display plugin

#550 Post by Smotek7 » 18 Jul 2023, 08:28

I used DIM but can't find it.
I have to go. I'll try it when I come back.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 18 guests