USB Serial on Photon not working [SOLVED]

Running firmware 0.3.4. Photon attaches to PC without problems. Photon was issued with comm port but Windows says it is a Teensy on my machine. I tried it on my Mac also. I can also see the comm port being attached and detached when I plug the Photon in and out of the USB port.

Serial.println doesn’t seem to send anything out in the serial port. I haven’t tried receiving though. I tried it with Serial1 which is the port that is on the header pins and that works. To bypass this problem I am using this port at the moment but I don’t want to have to attach an FTDI 232 cable to do this.

Can someone advise what I could be doing wrong?

Hi,

Not sure if this will help but I remembered it popped up the other day.

Link to signed driver note

Best regards,
Clive

@macbum, the Photon firmware is compiled with V0.4.1 and not 0.3.4.

Did your photon do a firmware update when it first connected to the :cloud:?

@kennethlimcp, I think it did an update when it connected to the cloud the first time. The compiler says I am building sith Spark FW 0.3.4 though. How do I check the firmware version?

I installed the signed driver and it now says Photon but the USB serial still doesn’t work.

Ok i believe you looked under the settings for Web IDE which is only reflecting for the core and not Photon so ignore that for now.

@mdma will have to assist you from here.

Please hold the setup button for 3 seconds to put the Photon in listening mode.

You should then see the Photon appear under Ports (COM & LPT) in Device Manager.

Let me know how it goes!

@mdma I can already see it under Device Manager before but Serial.println still doesn’t seem to show anything. I can open the comm port in Windows using PuTTY but I don’t see anything coming in. That is the weird part.

What does putting it in listening mode do for USB Serial?

Putting it in listening mode simply calls Serial.begin() and waits for WiFi configuration commands, such as i to show the device ID.

Can you verify for sure that your app is running and that you have called Serial.begin() in setup()?

Did you do Serial.begin(9660)?

I am pretty sure I initialized it correctly.

Here is the snippet.

Serial.begin(9600);
Serial.println("Photonic_Blaster Serial Port is working!");

Serial1.begin(9600);
Serial1.println("This is the Photonic_Blaster NTP Client!");

I can see output from the Serial1.println but not the other one.

Curious! What are you using to read Serial1?

I used an FTDI 232 serial cable. This is connected to the TX and RX pins on the header of the Photon. This works. Just not the USB Serial which is puzzling the hell out of me!

Try only Serial.begin(9600) without Serial1.begin()

Another thing you can try is to hit disconnect and connect on the terminal program and see if data comes in.

Seems ok on my side but not sure what’s going on for yours.

Are you using WEB IDE and selecting the Photon to perform OTA?

Tried that. Didn’t work. I am using WEB IDE at the moment. How do I specifically select Photon for OTA? Everything else I have tried so far seems to work. I am pretty sure the code is working. It’s just the USB Serial that is not working. I also tried the USB Serial on my Mac and it doesn’t work either. Strange!

Can you try a minimal program that writes to Serial, like this:

void setup()
{
   Serial.begin(9600);
}

void loop()
{
    RGB.control(true);
    RGB.color(0,255,0);
    delay(1000);
    Serial.println("Hello world!");
    delay(1000);
    RGB.color(255,0,255);
}

Other things to check:

  • Remove any USB hubs
  • try a different cable

Ah… I think I have figured out what’s wrong now. It has to do with the comm driver detaching and attaching itself. Whenever new code is flashed, it causes the port to be detached and then it re-attaches when the new code runs, however PuTTY thinks the serial comm port is still active but it is not. After I terminated the PuTTY and reconnect to the port it works! ! It’s such a pain to have to make it work this way… but it works now. I have tried it several times now.

Thanks guys for your patience and working this out with me.

3 Likes