[Solved] Using PuTTY as a serial connection

Hi,
I’m attempting to use putty to get a serial window working. I’ve followed the tutorial in Docs and downloaded the patch etc. When the core is in listening mode (Flashing blue) the core appears in device manager and using the terminal I can get the device ID. When I reset the core and try and access it using the same details, it doesn’t work. the error I get is: “Unable to open connection to COM3 Unable to open serial port”. Would be much appreciated if someone could help me out, thank you.

I believe the problem lays in resetting the Core when there’s still a connection. I’ve noticed the same behavior with the arduino IDE. Could you try disconnecting putty beforehand, or restarting it after the Core, and see how that goes?

putty is disconnected inbetween using the core in listening mode and the core being reset, if that’s what you mean. I have also had the similar problem when trying to use the IDE but when the core isn’t in listening mode, the IDE seems to not acknowledge the core is connected. I assume this is the same problem.

Solved, was an error in coding line

  while(!Serial.available()) SPARK_WLAN_Loop();

was before line

Serial.begin(9600);
1 Like

@OddieCAT, though Cis still in the code, it really should be replaced with Spark.process(). :smile:

UPDATE: It turns out that SPARK_WLAN_Loop() is the correct function to call. @BDub and @mdma are presently assessing whether Spark.process() should be used.

2 Likes

I am having the same issue that started this post. Although the solution posted is not appropriate for what is going on. The Photon is COM3 on my Win 7 machine. I flash and test the Photon and use puTTY to obtain debug information. Then I update the firmware, re-flash the Photon, and start a new puTTY session. Since the Photon will disconnect and reconnect COM3 when it reboots after flashing, I close the puTTY session and start another. But I can’t start another debug session because I get the same “Unable to open connection to COM3 Unable to open serial port”.message. I have to reboot the Win 7 machine to start another debug session which certainly takes forever. Can’t do many debug runs if you have to reboot the main computer each time. I attempted to disable and enable the COM3 port using the device manager on Windows. But it just hung trying to disable COM3. Although aborting the process and trying again did show COM3 as disabled. Enabling the port also hung and stopping and starting the manager once again, showed the device enabled again. But it still would not allow access to COM3.

Any suggestions on what else to try? I am not sure where the COM3 driver for the Photon is coming from. Maybe there is another driver to use that might not cause COM3 to hang up like it is now.

Have you tried closing the PuTTY session before reflashing?
Does COM3 come back then after the flashing?

I have found (“by accident”) as setting in PuTTY that would terminate the session once the Photon goes offline and ever since never got the “Can’t connect” message again.

@ScruffR - is that the Session “Close window on exit” setting? I had it set to “Only on clean exit” and have changed it to “Always”.

I can also insure PuTTY is closed before flashing and see what happens.

1 Like

The point is, I have set this on one machine that way and want to do the same on another, but whatever I try it doesn’t do it the same way whatever I tried.
I have not yet checked every checkbox or radio button in PuTTY on both machines, so I seem to have lost that Philosophers’ Stone :blush:

@ScruffR Putty/Settings/Connections/Keepalives??

1 Like

My super plain term could be an alternate option. Mostly because it auto-reconnects. :smirk:
http://www.curioustech.net/serialmon.html

1 Like

hello sir,
if you are using particle dev on your PC, please try to connect with your port in middle of program uploading. After established connection, you won’t be able to connect with your port.

i have faced same problem, so i tried this, and it’s work fine.

Could someone please help me with a similar issue? Using Windows 10 and Putty. All worked fine and then I noticed I was using a different com port to get things working. Then no com port worked. I changed PC and all fine again until the com port changes, then it doesn’t work at all. I have tried restarting both PCs. With my photon connected via USB, I see nothing in Device manager. When I click View/Show Hidden Devices, I see Ports 4 and 5 associated with the photon but both greyed out. I have tried uploading the driver but my PC confirms I am using the most recent. How can I get this working again please? I use putty as my output window to understand what the code is doing so this has effectively stopped my development. Best regards, James

Does the device appear at all when you plug it in?
Do you hear the connected sound in Windows?
What driver are you using? With Win10 you should not use the Particel drivers but Windows’ own drivers - if you use the Particle drivers remove them from your system.
If you want to prevent the permanent reassignment of the COM port you can use the advanced settings in DevMgr to set the desired port and from then on the device should stick with that port number.

No device shown in device manager and no sound when I plug in. How do I disable the particle drive and install the windows driver please? Also how do I assign a permanent port please? Thanks for helping me.

The instructions for fixing the serial driver under Windows 10 are here:

That’s a symptom that may suggest to try another USB cable :wink:

Thanks, these tips got me up and running again