1
USB Infrared Toy / [Solved] Cannot properly close() device connection from tran
I've attached an updated version of the script showing the example transmit sequence for people that want to play some further with python and the IRToy.
Open Source Hardware
This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.
...omitted...
File "C:Python27libsite-packagesserialserialwin32.py", line 177, in _reconfigurePort
raise ValueError("Cannot configure port, some setting was wrong. Original message: %s" % ctypes.WinError())
ValueError: Cannot configure port, some setting was wrong. Original message: [Error 31] A device attached to the system is not functioning.
File "/usr/lib/python2.6/dist-packages/serial/serialposix.py", line 175, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttyACM1: [Errno 5] Input/output error: '/dev/ttyACM1'
case 's':Just assuming the comment on irsService() is true I tried a few combinations of sending 0x00 at arbitrary times in the transmit sequence before closing the connection but without luck. I had a very short look in IRs.c to see how the transmit mode works but quickly decided this might be going to far and somebody else might have ran into this problem before.
OutByte = getc_cdc(); // now ok to remove byte from the USB buffer
mode = IR_S;
irsService(); // Fully self contained, does not return until exited via 0x00 command.