problem displaying on a Nextion screen

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
cyclone
New user
Posts: 6
Joined: 06 Mar 2020, 12:43

problem displaying on a Nextion screen

#1 Post by cyclone » 06 Mar 2020, 13:47

Dear all;

I'm developing a small system control used to 'control' my garden shelter, this system is based on an ESP with Esp Easy R148 and a Nextion display screen (in fact the chinese version of the Nextion).

Two DS18B20 probes are connected to the ESP, and temperature is monitored without any problems,and send to domoticz again without any problem.

The problem occurs when I'm trying to send the Temperature value directly on the screen, inserting commands into the Line
nextion-line.JPG
nextion-line.JPG (18.23 KiB) Viewed 17801 times
, I tried different combinations like t1.txt="[DS18B20#Temperature]", without any success, the t0 text is displaying [DS18B20#Temperature] but not the right value...

After I tried to display some informations, using the command : nextion,t1.txt="%systime%" or nextion,t1.txt="%ip%" expecting to have on the display or the time or the ip address of the esp, as a result on the screen I've : %systime% or %ip% displayed....

has anyone ever had this problem? what are the right commands ?

I'm using right now the Release R148 for esp easy, do I've to switch to ESP mega ?

Many thanks for your help !

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

Re: problem displaying on a Nextion screen

#2 Post by Wiki » 06 Mar 2020, 17:10

I am running two nextion with mega 20191208 development attached to wemos d1mini witbout problems, but I am sending the values out of rules like
Nextion,page0.t1.txt="[Sensor#value]"

Code: Select all

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

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

Re: problem displaying on a Nextion screen

#3 Post by TD-er » 06 Mar 2020, 17:44

Not sure if those system variables were present in the R148 build.

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

Re: problem displaying on a Nextion screen

#4 Post by ThomasB » 06 Mar 2020, 17:57

Not sure if those system variables were present in the R148 build.
Good catch. R148 was released about the same time that the Titanic disaster occurred. Time to upgrade.

And besides upgrading to the latest Mega release, I HIGHLY recommend you use the plugin's new Hardware Serial feature. My opinion is that this is essential to achieving reliable touch screen entry. But if the ESPEasy application is only for displaying/updating text (no touch entry) then soft serial is OK. See the wiki for details to using hardware serial.

- Thomas

cyclone
New user
Posts: 6
Joined: 06 Mar 2020, 12:43

Re: problem displaying on a Nextion screen

#5 Post by cyclone » 08 Mar 2020, 22:10

Dears ;

many thanks for your answer, I'm trying to installa this version 20191208, and it's OK right now, but the "display Nextion" is not in the device list... so

my stupid question is now how to install this ' device' into the ESP ?

Many thanks

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

Re: problem displaying on a Nextion screen

#6 Post by TD-er » 08 Mar 2020, 22:31

Have you tried the "testing" builds?
See: https://espeasy.readthedocs.io/en/lates ... al-plugins

cyclone
New user
Posts: 6
Joined: 06 Mar 2020, 12:43

Re: problem displaying on a Nextion screen

#7 Post by cyclone » 08 Mar 2020, 23:41

many thanks ! now I've to setup the ESP !

cyclone
New user
Posts: 6
Joined: 06 Mar 2020, 12:43

Re: problem displaying on a Nextion screen

#8 Post by cyclone » 10 Mar 2020, 23:42

OK, now it's possible to send the temperature on the main screen, this part is OK, but a new problem occurs, it's impossible to receive the Idx - identification number - when a button is pressed on the display.

This was working with R148 but with the new version, using the same pins (D2 & D4), I cannot succeed to have this feedback.

Is with this new version mandatory to use specific pins ? or make a setup particular ?

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

Re: problem displaying on a Nextion screen

#9 Post by ThomasB » 11 Mar 2020, 00:40

The Nextion plugin has changed. So please review the wiki.
https://www.letscontrolit.com/wiki/inde ... le=Nextion

You can use the serial log and see the touch data received from the Nextion. Check the values to confirm they are being received (and are correct).

BTW, you're using SoftSerial to communicate with the Nextion. In the Mega release the SoftSerial does not work well for decoding touch actions due to interrupt latency corrupting the serial byte decoding. This can be resolved by using the Hardware Serial feature that is available in the Nextion Plugin. See the wiki for the requirements.

- Thomas

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

Re: problem displaying on a Nextion screen

#10 Post by Wiki » 18 Apr 2020, 15:13

Sending "°C" to Nextion display results in displaying "°C". Sending "{D}C" Same result.

Any ideas?

Code: Select all

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

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

Re: problem displaying on a Nextion screen

#11 Post by TD-er » 18 Apr 2020, 15:38

That sounds like missing that unicode entry in the font.
ESPEasy does replace both to the unicode value of the degree symbol.
For the LCD and OLED plugin we have a wrapper to replace those special characters to the ones supported by the font definition on those devices (or library in case of the OLED)

If the Nextion has a degree sign in its font and you can supply me with the proper code of that character, then I can make a wrapper for the Nextion plugin to patch that character.

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

Re: problem displaying on a Nextion screen

#12 Post by Wiki » 18 Apr 2020, 19:05

Thanks for the fast reply.

Part of the Nextion editor is a font generator, with which I am able to generate fixed fonts. The codec of the fonts I am working with is iso-8859-1. So the code should be B0 I think.

List of the supported codecs:
NextionFonts.jpg
NextionFonts.jpg (36.35 KiB) Viewed 14991 times

Code: Select all

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

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

Re: problem displaying on a Nextion screen

#13 Post by TD-er » 18 Apr 2020, 19:22

Hmm I begin to think we may need a replacement feature to just enter hexadecimal values which will then be replaced by its binary byte value.

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

Re: problem displaying on a Nextion screen

#14 Post by ThomasB » 18 Apr 2020, 20:14

Ordinarily you would use \xB0 in the Nextion text string. But the \ escape char breaks the rules parser.

- Thomas

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

Re: problem displaying on a Nextion screen

#15 Post by Wiki » 19 Apr 2020, 02:08

Due to the fact that some of the sending devices are pimped SONOFFs with added BMP280 which are not updateable without a lot of pain for flashing them I took the risc to update the Nextion editor from 0.53 to 1.60.1. Why risc? Itead states clearly that if your project was developed with 0.53 or earlier you should stay with the old version due to being partly incompatible.

I tried to install the version in parallel, no success.

But: The font editor of the new version is able to generate in UTF-8. And that made the deal: sent "°C" is displayed as "°C". And all the rest seems to run perfectly.

Caution: The compiled .tft file explodes. Under 0.53 the project took roughly 3MB, under 1.6.0.1 around 12(!)MB. And the generated font looks different between the two versions (same font source), upper line 1.60.1, lower line 0.53:
Font 1.60.1 0.53.JPG
Font 1.60.1 0.53.JPG (11.29 KiB) Viewed 14970 times
If interested I colud summaize the observed differences in another thread, but it will take time....

Code: Select all

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

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

Re: problem displaying on a Nextion screen

#16 Post by Wiki » 19 Apr 2020, 02:24

Eehm, the code size explosion is relative. At first I generated the complete font set in UTF-8. The font generator allows to choose the characters to be included in the generated font. I have done this and the code size is almost back to the old one.

Code: Select all

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

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

Re: problem displaying on a Nextion screen

#17 Post by TD-er » 19 Apr 2020, 09:41

Yep, the Unicode character set is "a bit" larger than ASCII (or even extended ASCII).

The screenshot you showed looks like it is using anti-aliasing.
That may also increase the font size as it uses more than 1 bit per pixel then.

Is the render speed comparable? (hard to compare from memory if you don't have a 2nd display to compare it with)

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

Re: problem displaying on a Nextion screen

#18 Post by Wiki » 19 Apr 2020, 12:49

Yep, this time I have set the option of anti aliasing just for cuiosity. But nevertheless the characters are different, to be seen better with the zroe (I have posted the wrong example, was too early in the morning): the new zero is slashed, the old one not. Up to now I didn't have had a look at the zero of the source font, I will do this later today.

I cannot notice any speed difference. The Nextion is too fast, it is a nice device. Changing text happens instantly, even ie in the phone call list where I am rolling over the complete list to place an incoming call in the top line.

[edit]
the old fonts have been complete sets of iso-8859-1 code sets, no plain ascii. Thats why I am so astonished about the explosion, I expected twice the size, not more than four times.
[/edit]

Code: Select all

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

Post Reply

Who is online

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