PuTTY or other serial monitor that automatically reconnects Windows


#1

Hey all,

I’m looking for a way to capture debug logs across device sleep cycles and reset cycles.

I am trying to identify a bug in my code that seems to happen after several reset cycles over a long period of time. The problem I am encountering is that PuTTY hangs and won’t reconnect when my Electron resets or goes through a sleep cycle.

I found this other post with a custom python script that supposedly can reconnect, but I don’t know Python and would prefer to continue using PuTTY if possible:

Is it possible to make PuTTY automatically re-establish a lost serial connection? If not, is there an easier way than the python script the above post?

My other thought was perhaps sandwiching another microcontroller between my PC and my Electron that would intercept the Electron debug messages and re-transmit them to the PC, so that the serial connection is always up. Would this be the easiest?


#2

I use Linux Minicom for my Photon and Cores.
The Photon needs to be running before starting minicom, but after that the Photon can be restarted/reflashed and minicom will pick up the Photon when it restarts.

See also: Serial monitor auto-connect?


#3

@timx Thanks for the reply.

The post you linked to had the answer.

TeraTerm is da bomb!!!


#4

If anyone’s interested, I wrote a small program that does this exactly for this reason. It builds on MacOS, but would probably also work in Liniux, perhaps with a few tweaks.


#5

I had the same issue using Terra Term when an Electron Woke up and I was running the serial debug output code.

Sometimes TeraTerm would catch the debug output when it woke up and sometimes it would miss it.

Does it work for you every time?


#6

Hi All,

The source of the problem is the way windows functions: When your device resets it disconnects the port Windows and or Putty will not automatically reconnect.

I have found a great hardware fix for this and it is the use of the jim.sh/ftx serial to usb adapter (you can buy it on amazon) it can be configured so it is powered from the usb port such that when your device resets the chip on the adapter will not lose power hence it will not break the connection between the usb port and the adapter.


#7

By the way, since February 2017 the Particle CLI has had the ability to reconnect using:

particle serial monitor --follow

#8

I haven’t experimented with sleep modes yet.

Sometimes the serial connection gets frigged when the Electron can’t connect to the cell network (sucking lots of juice on transmits). Unplugging and replugging the USB cable fixes this without restarting TeraTerm or the Electron.