-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read still 777777 #54
Comments
https://github.com/Seithan/EasyNextionLibrary#function-documentation NOTE: As these commands are using the Serial port to read and write, it is more preferred not to run them in the loop() without delay(); or some other method of not running them with the frequency of the loop and use them only when it is needed. Using them in a loop, a delay in the loop can be noticed, especially when reading from the Serial. A Serial buffer overflow can also be caused. |
I have the same issue, I didn't get the controller to send any data. I tried a lot of different configurations by sending the print at different times. The Data always is 777777. I also checked if I can only read the data while I'm on the same page but this also did work. Maybe we can find a solution. I'm using an NodeMCU ESP8266 but I will try it on my ESP32 S2 Mini and the Arduino Uno. |
I tested it on ESP32. Still read 777777. I tested 4800 - 115200 baudrate. And still the same. 777777. Write is ok, trigger is ok, but when I need read values, return 777777. I use HW Serial2 on ESP32. I try on 3 different ESP32 board. Still same, 777777. |
What if we can read the data on a seperate SoftwareSerial connection we switch to while the trigger is recogniced? And send the data as a printh because the next data char have to be the data? |
Why do you closed the issue? Do you have a solution? I really want to get your library working for my university project. It would be super kind to get an answer. |
@18Markus1984 Can you provide more information? |
So, for example, in this HMI is set global variable va1: HMI . How read this variable? myNex.readNumber("va1.val")); not function. Still reads 777777. Thanks. |
Any solution yet? I am trying to read rtc0 in setup with 500 delay after. I have tried other variables with the same result - all 7. |
I belive I have found the problem and have a solution. At line 245 in EasyNextionLibrary.cpp, the checking of the incoming data for the end of data flag(s) is incorrect. The code is looking for either FF or FFFFFF. I have it is FFFFFF which matches. However the code wants 3 bytes of code before setting the _endOfCommandFound flag. When FFFFFF comes in, it is a end of command flag, but all at once. A solution is to make 2 seperate if statements so the FFFFFF will immediately set the _endOfCommandFound flag and break. I have done limited testing, but it work for me. Thus the new code looks like:
|
https://github.com/Seithan/EasyNextionLibrary#usefull-tips be at the page you are currently on. Always use a prefix with the page name for global variables |
I finally got it working. My problem was it to use the "printh 23 02 54 00" in the button, where I also added the "page page1" to go to the next page. I think that creates a problem between the Arduino and the display. The solution was to add sliders to set the values after the slider was moved. Maybe that can help somebody. Also this Wiki page is pretty nice and organized: https://wiki.iteadstudio.com/index.php?title=Nextion_Instruction_Set&oldid |
I think this is not a permanent solution. If you want to try something, consider trying the following: In line 178, change the Let me know if this works better |
I will try it but I am not sure how that will help. I am having more problems with getNumber. I am almost always get 777777. Also there are many times when the trigger doesn't fire. I am at the end of the project deadline so I have to get this working. |
If you want, you can send me the .ino and .HMI files of your project, so I can have a closer look at it and help you |
I appreciate the offer but I am making progress. There some timing issues I may have introduced that delayed triggers. 2 Suggestions
|
I had issues with 777777 from .readNumber( ) statements in trigger events when I had page switching code in the touch release event from the button press which sent the trigger command to the Arduino. I moved the page switching code into the Trigger function and the 777777 errors went away. |
I have HMI with page0 and page1. Writing data is ok, nextion lissen and trigger works perfectly, but i can't read any variable. I try any variables, local, global but still return 777777:
myNex.writeStr("page 1") Serial.println(myNex.readNumber("n0.val"));
I think reading works when nextionlisten works on the touch pad. Why readings of variables still return 777777?
Thanks for any ideas.
Platform: ESP32/platformio/arduino framework
The text was updated successfully, but these errors were encountered: