today I tried desperately to read values from a nextiondisplay in my python code. Writing to it works, but i simply can't manage to get python to read from it. My code looks like this:
def ser_escape():
escape='\xff'.encode('iso-8859-1')
ser.write(escape)
ser.write(escape)
ser.write(escape)
import serial
import pynextion
EndCom= "\xff\xff\xff"
ser = serial.Serial(port='COM4',baudrate=9600)
test=b't0.txt="MyText"'
ser.write(test)
ser_escape()
ser.flush
ser_escape()
ser.flush
ser.write(b'get t0.txt')
print (ser.read())
ser_escape()
ser.close()
The output is just: b'\x1a'
Which isn't anything close to the behaviour expected - at least not from me.
Relating to this document: https://www.itead.cc/wiki/Nextion_Instruction_Set#get:_Get_variable.2Fconstant_value_with_format
I should be able to use "get "variable""
to receive the Information stored there.
I'd be happy if some1 could help me out here.