scottbez1 / splitflap

DIY split-flap display
https://scottbez1.github.io/splitflap
Other
3.09k stars 256 forks source link

Software QOL Changes #171

Closed dmadison closed 2 years ago

dmadison commented 2 years ago

Three small quality of life changes to the software script:

scottbez1 commented 2 years ago

Looks good. I'm curious about the serial interrupt though - are you running this on Windows by any chance? On Ubuntu I'm able to interrupt a serial read/readline when I just tested now. It seems like this may be a bug in pyserial just on Windows?

I'm not opposed to setting a timeout as a workaround, but it does require more caution when working with the serial functions going forward. It's not an issue right now since it's just doing naive readlines, but the other thing I wanted to mention on this topic is that I'm planning a complete overhaul of the serial protocol (at least for programmatic communication) in the next month or two, so heads up that I will probably not merge any PRs related to the current serial protocol after this one.

The plan is to migrate to packetized protobuf messages (via PacketSerial and nanopb) to get typing and a proper schema instead of the mess of hand-crafted json strings... I will most likely retain some form of plaintext protocol (and retain the json parsing in the python scripts for backwards compatibility, at least for a little while), since it's kind of nice for basic testing and debugging. The plaintext protocol will have a special character command to transition into protobuf binary mode.

dmadison commented 2 years ago

I was testing and ran into serial interrupt issues on both Windows and Linux (Raspbian). I wonder if it might be driver related?