ZCube / turing-smart-screen-golang

Turing Smart Screen library for Golang.
MIT License
1 stars 1 forks source link

"Expected 6 bytes, got 0" #1

Open EliRibble opened 1 month ago

EliRibble commented 1 month ago

I'm running the simple example with a EDIY 3.5 inch lcd connected. got the following output:

$ out/example-simple 
Port: /dev/ttyACM0, (1a86:5722, USB35INCHIPSV2)
2024/09/13 14:32:57 Modem status bits: {"CTS":true,"DSR":false,"RI":false,"DCD":false}
2024/09/13 14:32:57 Opened port /dev/ttyACM0
2024/09/13 14:32:58 Error: Expected 6 bytes, got 0

I'm assuming I either have a clone device operating out-of-specification or it's some device type that was not originally considered.

I'm going to see if I can get it sorted.

EliRibble commented 1 month ago

Turns out the failure is in lcd_a.go when reading in the 6 bytes used for the revision.

EliRibble commented 1 month ago

Okay, I got the turing-smart-screen-python running and talking to my screen, then figured out what it was doing. Turns out that while it can read 6 bytes for the revision, my screen returns no bytes at that point and the applicable code uses an else: block because the response is an empty list of bytes (b'').

I'll make a PR with what I believe are the right changes.