Jake, That's a great idea. We need to figure out what the name of the device for the arduino keypad controller is and use that instead of the "try them all in a loop" code we have now.
But really need to go to the root source of the problem, which is why is the port going away in the first place. Is the Arduino crashing and resetting itself? Is something on the RaspPi messing with the port? If we can solve that problem, then things will get much more stable.
Thoughts:
- Arduino might crash randomly if power over USB is marginal. We tried to run it off of a powered USB hub instead of directly off the RaspPi USB, but that made things worse, I think because the hub we used is ancient and not very good. It might be good to try a different powered up?
- Arduino code might have a software bug? I looked at the code, but didn't see anything obvious like a divide by zero or indexing an array out of bounds, but more eyes on that code might turn something up.
- If a second process on the RaspPi did an open() on the serial port already opened by the baron.py process, would that cause the Arduino to reset? Is there a way to check for this? Are calls to open() logged by the system someplace?
-steve