Closed tbrodbeck closed 2 years ago
Hi Till,
Try to change async def event_handler(self, type_, data):
to def event_handler(self, type_, data):
and comment out last line with await
in that function. Does it work this way, with sync event_handler?
Hi @yozik04 yes it works with the sync event handler! That is already good new. Nevertheless, I would prefer having it async
Very strange. Because I use async version of that function and no problems. Are you using venv?
I have no idea why. But I just tested it again today and it works in the same environment...
(Just the STARTUP
is still not showing up, but I do need it)
I found the connection to the Nextion display sometimes a little bit unpredictable. Sometimes I cannot even create a connection and need to reboot the controller. So I guess, maybe there was an issue from the hardware side.
STARTUP
event only appears when unit reboots while you are connected. Your connection speed might be too high. Try to lower baud rate on Nextion side.
Okay thanks. I will try that if I encounter issues again! Thanks for your quick support :)
Hi. This library looks really promising. And everything works for me but one thing: the events.
So, I just create a Minimum non-Working Example from your instructional script ans saved it as nextionTutorial.py:
Then I ran
python nextionTutorial.py
which yields the following output:You can see here, that eveything works fine - for example it could read the string About from
b_about.txt
.But no events whatsoever get registered. I do not get a printout of the
STARTUP
event and neither do I when I press buttons on the screen.Thanks in advance for any help!
My System:
OS: Raspbian GNU/Linux 11 (bullseye) armv7l Host: Raspberry Pi 4 Model B Rev 1.2 Kernel: 5.10.92-v7l+ Shell: bash 5.1.4 Python 3.9.2 nextion==1.8.1 nest-asyncio==1.5.4 pyserial-asyncio==0.6 Nextion Display: NX8048P070-011C