Hey smart people
My project entails taking physical input to control hardware and software on my Windows 8 PC.
I'm using GoBetwino to interface the Arduino Nano 3 (328) and the PC.
All serial communication initially works as expected, except for the following situation:
A serial monitor/window is open, successfully sending/receiving serial data to/from Arduino. When the PC is put to sleep mode e.g. S3 (while the serial monitor is open), and woken up again, the serial monitor on the PC is non-responsive. The Arduino never loses power when the PC is in sleep mode, and I can see that the COM port is not reset after PC wake.
This situation applies to both the Arduino IDE serial monitor and with GoBetwino open.
Temporary solution
Re-opening the serial monitor/GoBetwino (close/open of COM port) AND physical reconnecting the Arduino is necessary for successful serial communication after a PC sleep/wake cycle.
I've tried:
Adding Serial.begin()
, Serial.flush()
and Serial.end()
to the relevant parts in my Arduino sketch controlling the sleep function (the Arduino knows exactly when the PC will sleep/wake-up) - no success.
I think the problem is....
Unfortunately I do not know enough of COM ports/serial communication on the Windows side of things, but possibly the problem is that the COM port is closed(?) when the PC is going into sleep mode, and not reopened when waking up.
Possible solution
I can implement a script on Windows that re-opens GoBetwino (thus re-opening the COM port), and attach a 120 Ohm resistor to the reset pin to avoid auto reset, but this doesn't solve the "Arduino must physically be reconnected"-problem.
Any ideas/comments/solutions?