Serial stops working


#1

I am logging data through the Serial output, for long periods…for days, weeks.

I am using Particle CLI “particle serial monitor --follow”. It works fine, but after awhile, the serial port disconnects and wont reconnect.

The Particle is still online, and is still sending Publish events. Checking the particle in the Console, all health checks come back fine.

DeviceOS 1.2, but this also happened on 1.1

The only way for me to get it to work again is to power cycle the Particle.

Has anyone else experienced this? It seems as though the “Serial” class in the DeviceOS stops working and maybe needs to be reinitialized? I dont see any API to check if this needs to be done, and I wouldn’t want to continuously call Serial.Begin in the loop() would i?


#2

I would try this with a different serial port tool - something like this. I use this daily and have had multiple particle devices running for days/weeks with no issues


#3

While I’ll give that a try, I don’t think it has anything to do with the client side. Even after rebooting the PC, the virtual COM port for the Particle still won’t open. Leading me to believe it’s really an issue on the Particle side.


#4

Interesting - I have never had an issue so far (about 4 month of exposure to this platform so far) - how do you initialise the serial port (in Setup()) ? Are there any loggers also using serial port or multiple threads that attempt to access the serial?


#5

So I think the problem is a windows 7 issue with virtual com ports, and virtual com port drivers not handling and “surprise” disconnects properly.

https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/79b19850-663f-4568-a908-37c4b2d7f20a/virtual-serial-port-from-usb-device-disconnect-reconnect-then-cant-open-port?forum=wdk

It appears, the Particle USB driver 1.0.0.0 is not handling the IRP_MN_SURPRISE_REMOVAL event.

Does anyone know the proper procedure to get this reported to Particle?


#6

Here would be a good start

:slight_smile: