Skip to content
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

Baud issues #26

Open
JYunusov opened this issue Feb 11, 2022 · 3 comments
Open

Baud issues #26

JYunusov opened this issue Feb 11, 2022 · 3 comments

Comments

@JYunusov
Copy link

Hi, I am currently trying to upload .tft file to nextion display using raspberrypi zero through serial. But I get an error:

Any help will be appreciated, thanks!

pi@raspberrypi:~ $ nextion-fw-upload /dev/ttyS0 hello.tft
2022-02-11 14:29:31,833 INFO nextion.nextion.client Connecting: /dev/ttyS0, baud: 2400
2022-02-11 14:29:31,841 INFO nextion.nextion.protocol.base Connected to serial
2022-02-11 14:29:33,646 WARNING nextion.nextion.client No valid reply on 2400 baud. Closing connection
2022-02-11 14:29:33,651 ERROR nextion.nextion.protocol.base Connection lost
2022-02-11 14:29:33,656 WARNING nextion.nextion.client Baud 2400 did not work
2022-02-11 14:29:33,660 INFO nextion.nextion.client Connecting: /dev/ttyS0, baud: 4800
2022-02-11 14:29:33,667 INFO nextion.nextion.protocol.base Connected to serial
2022-02-11 14:29:34,645 WARNING nextion.nextion.client No valid reply on 4800 baud. Closing connection
2022-02-11 14:29:34,649 ERROR nextion.nextion.protocol.base Connection lost
2022-02-11 14:29:34,654 WARNING nextion.nextion.client Baud 4800 did not work
2022-02-11 14:29:34,657 INFO nextion.nextion.client Connecting: /dev/ttyS0, baud: 9600
2022-02-11 14:29:34,664 INFO nextion.nextion.protocol.base Connected to serial
2022-02-11 14:29:34,933 INFO nextion.nextion.client Address: 30611
2022-02-11 14:29:34,936 INFO nextion.nextion.client Detected model: NX4024T032_011R
2022-02-11 14:29:34,939 INFO nextion.nextion.client Firmware version: 78
2022-02-11 14:29:34,942 INFO nextion.nextion.client Serial number: DE602478A74A6831
2022-02-11 14:29:34,945 INFO nextion.nextion.client Flash size: 4194304
2022-02-11 14:29:34,999 INFO nextion.nextion.client Successfully connected to the device
2022-02-11 14:29:35,001 INFO nextion.nextion.client About to upload 168299 bytes
2022-02-11 14:29:35,193 WARNING nextion.nextion.client Additional sleep configuration failed: Variable name invalid for command: usup=1
2022-02-11 14:29:35,197 INFO nextion.nextion.client Reconnecting at new baud rate: 115200
2022-02-11 14:29:35,251 ERROR nextion.nextion.protocol.base Connection lost
2022-02-11 14:29:35,259 INFO nextion.nextion.protocol.base Connected to serial
2022-02-11 14:29:35,631 INFO nextion.nextion.client Device is ready to accept upload
2022-02-11 14:29:41,764 ERROR root Failed to upload firmware
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/nextion/protocol/base.py", line 37, in read
return await self.queue.get()
File "/usr/lib/python3.9/asyncio/queues.py", line 166, in get
await getter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.9/asyncio/tasks.py", line 492, in wait_for
fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/nextion/console_scripts/upload_firmware.py", line 14, in upload
await nextion.upload_firmware(args.file, args.upload_baud)
File "/home/pi/.local/lib/python3.9/site-packages/nextion/client.py", line 394, in upload_firmware
res = await self.read_packet(timeout=timeout)
File "/home/pi/.local/lib/python3.9/site-packages/nextion/client.py", line 221, in read_packet
return await asyncio.wait_for(self._connection.read(), timeout=timeout)
File "/usr/lib/python3.9/asyncio/tasks.py", line 494, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

@yozik04
Copy link
Owner

yozik04 commented Feb 11, 2022

A solution to that is very welcome =)
This tft upload is kinda like a demo. I've managed to upload it once on my device and have not tried anymore.
Nextion does not share documentation how to upload tft (at least when I looked for it some years ago)

@EyitopeIO
Copy link

Nextion upload protocol documented here last year: https://itead.cc/nextion/nextion-hmi-upload-protocol/

@yozik04
Copy link
Owner

yozik04 commented May 19, 2022

Want to make a pull request? 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants