yozik04 / nextion

Nextion serial client
GNU Lesser General Public License v3.0
25 stars 10 forks source link

Compatibility problems with Nextion Editor 1.61.1 #10

Closed Chronocento closed 3 years ago

Chronocento commented 3 years ago

Dear Jevgeni, hope you're enjoying summer, even in this difficult times given the COVID-19.

I'm here to bother you again because I noticed that your library appears to have some problems with the latest release of the Nextion Editor, version 1.61.1, whose changelog reads:

  1. New Audio* component (use internal resource or microSD)
  2. Add delimiter based split string instruction spstr
  3. Optimized Editor baudrate recognition
  4. Optimized escape character conflict in big5 encoding
  5. Optimizations for models T24, T28, T32 flash endurance
  6. Enhanced error checking for assignments where resource ID is invalid
  7. Optimized page swipe when changing pages
  8. Optimized get, print, prints and printh to single reply
  9. Optimized bkcmd handling

(Items marked with * are for Intelligent Series only)

I think the problem lies in point 8; I noticed it when I compiled my project with this latest version of the editor, and I got these errors upon connecting:

Command "get sleep" timeout. Connection lost

I tried reverting back to version 1.60.1, recompile, and everything worked as before.

What do you think?

yozik04 commented 3 years ago

My bet it is 9. =)

yozik04 commented 3 years ago

@Chronocento Please set nextion logger to debug level and send me all that is logged from start.

Chronocento commented 3 years ago

Here it is:

2020-07-30 17:38:52,516 - INFO - Connecting: /dev/ttyAMA0, baud: 115200 2020-07-30 17:38:52,520 - INFO - Connected to serial 2020-07-30 17:38:52,522 - DEBUG - sent: b'DRAKJHSUYDGBNCJHGJKSHBDN' 2020-07-30 17:38:52,526 - DEBUG - received: b'1a' 2020-07-30 17:38:52,568 - DEBUG - sent: b'connect' 2020-07-30 17:38:52,577 - DEBUG - received: b'636f6d6f6b20312c33303631342d302c4e58343833324b3033355f303131522c3135302c36313639392c444236393043313544333232333932442c3333353534343332' 2020-07-30 17:38:52,581 - INFO - Address: 30614-0 2020-07-30 17:38:52,583 - INFO - Detected model: NX4832K035_011R 2020-07-30 17:38:52,584 - INFO - Firmware version: 150 2020-07-30 17:38:52,584 - INFO - Serial number: DB690C15D322392D 2020-07-30 17:38:52,585 - INFO - Flash size: 33554432 2020-07-30 17:38:52,586 - DEBUG - sent: b'bkcmd=3' 2020-07-30 17:38:52,588 - DEBUG - received: b'01' 2020-07-30 17:38:52,590 - DEBUG - sent: b'get sleep' 2020-07-30 17:38:52,592 - DEBUG - received: b'7100000000' 2020-07-30 17:38:53,096 - ERROR - Command "get sleep" timeout. 2020-07-30 17:38:53,598 - INFO - Reconnecting 2020-07-30 17:38:53,599 - ERROR - Connection lost 2020-07-30 17:38:53,600 - INFO - Connecting: /dev/ttyAMA0, baud: 115200 2020-07-30 17:38:53,602 - INFO - Connected to serial 2020-07-30 17:38:53,603 - DEBUG - sent: b'DRAKJHSUYDGBNCJHGJKSHBDN' 2020-07-30 17:38:53,607 - DEBUG - received: b'1a' 2020-07-30 17:38:53,648 - DEBUG - sent: b'connect' 2020-07-30 17:38:53,657 - DEBUG - received: b'636f6d6f6b20312c33303631342d302c4e58343833324b3033355f303131522c3135302c36313639392c444236393043313544333232333932442c3333353534343332' 2020-07-30 17:38:53,659 - INFO - Address: 30614-0 2020-07-30 17:38:53,659 - INFO - Detected model: NX4832K035_011R 2020-07-30 17:38:53,660 - INFO - Firmware version: 150 2020-07-30 17:38:53,661 - INFO - Serial number: DB690C15D322392D 2020-07-30 17:38:53,662 - INFO - Flash size: 33554432 2020-07-30 17:38:53,662 - DEBUG - sent: b'bkcmd=3' 2020-07-30 17:38:53,664 - DEBUG - received: b'01' 2020-07-30 17:38:53,667 - DEBUG - sent: b'get sleep' 2020-07-30 17:38:53,669 - DEBUG - received: b'7100000000' 2020-07-30 17:38:54,173 - ERROR - Command "get sleep" timeout. 2020-07-30 17:38:54,675 - INFO - Reconnecting 2020-07-30 17:38:54,676 - ERROR - Connection lost

The sequence, as you can see, repeats continuously

yozik04 commented 3 years ago

Yes, I understand the problem now and it is pain to fix... They go against their spec. https://nextion.tech/instruction-set/

image

When instruction successful they must send 01ffffff according to their spec when bkcmd is set to 3

yozik04 commented 3 years ago

Hah actually they added new table: Return Codes not affected by bkcmd value, valid in all cases

So get and sendme are exceptions now.

yozik04 commented 3 years ago

According to unit tests it should be fixed

yozik04 commented 3 years ago

Did this solve the problem?

Chronocento commented 3 years ago

Hi Jevgeni, sorry for not having replied yet, I've been moved temporarily on other higher priority projects and I forgot to test and reply to you :( I hope to try your new version next week, and report back here

Chronocento commented 3 years ago

Sorry for being late! Just tested with a firmware compiled on Nextion Editor 1.61.1: works flawlessly! ;)

yozik04 commented 3 years ago

Then it was right decision to release 1.6.1 lib version.