Closed JeffHochberg closed 5 years ago
The Nextiondriver is written to use the 'normal' Nextion communication protocol to talk to the display and the 'modem' setting uses a MMDVMHost protocol to talk to the display. The TFT upload script needs a serial port directly to the Nextion which uses a simple, not very robuust protocol. So no, at this moment it will not work via the NextionDriver and surely not when the display is connected to the modem.
I have a version of the NextionDriver running which is able to update the display when connected to a serial port of the Pi. You will have to put a .tft file for the display in the DataFilesPath directory and start the process by touching a button on the display itsself. At this moment, it is working, but does not yet switch to 115200bd when you use layout < 4. Will be in the repository one of the following days.
Code to load .tft file in display is added.
It would be awesome if the display update mechanism would work through the "modem" connection. I don't know if the channel is sufficiently transparent to accomplish that or not.
The goal is to avoid having to disassemble the multi-layer laser-cut case to swap in a microsd card to do the upgrade..
The update protocol for the Nextion is not very robust. You need rather good controlled timing and the ability to send 4k bytes blocks. Even if this were possible and it is possible to flush it through the communication channel to the modem, it is imperative that the modem has a serial return channel from the display back to NextionDriver to receive all display answers. I think most modems do not have this return channel at this time.
There's a Python script that one can use to upload a TFT display file to the Nextion so you don't have to disassemble whatever case/enclosure your device is stored within every time you want to update the screen. Details of the Python script are available here:
https://github.com/g4klx/MMDVMHost/blob/master/Nextion_G4KLX/nextion.py
The script does not work at all when NextionDriver is set to 'modem'. In fact, I can't seem to get the script to work at all if the NextionDriver is enabled.
Does the NextionDriver use serial I/O? Should it be possible to use this script?