Serial.print() stops until unplug replug USB

Simple loop()
Serial.println(i++);
delay(1000);

Stops printing to Termite app after about 60 seconds.

Unplug USB
Plug USB back
click to connect in Termite

Continues printing.
I notice cellular data the moment it stops on speakers.
Sometimes it does not stop? When there is no speaker click.
Please help!

Bump. Anybody else seeing this? Just me?

Not with the code I’d come up with reading your description - but this might be due to the fact I’d avoid not-to-does.

Why not just post your actual code to let us test the same code?

BTW: You keep mentioning a speaker. What kind of and how have you wired it? What signals are you sending in and how?

Speakers are inductive loads and may give you grief when not treated well :wink:

Sorry, I’m still a newbie with posting code. Those are the exact 2 lines in loop(). Obviously I skipped over the int i and Serial.begin(115200) to make it compile and run. The speaker and amp are connected to my laptop headphone jack with a badly shielded cable. Whenever the Electron sends data it clicks loudly since it is near the speaker cable. The same thing happens no matter what code I use to print to USB. No matter what values I print even a constant. No matter what terminal software I use. I simplified it and tested it this way, before I posted. Resetting termite, restarting termite, rebooting Electron, none of them cause the data to display again. I must unplug the USB cable. It always stops exactly when the speaker clicks. That should be a hint for us. I tried unplugging the stereo cable, same problem, without the clicks. So you see the exact code does not matter. But it is exact above, just without the formatting

code here

I’d have to duplicate your error, but haven’t been able to.
What ublox has your Electron (U260, U270 or G350)? I can only try with the latter two.

U260, but I’m not sure that matters either?

I wouldn’t expect so but since I can’t see this on mine, I just thought to ask.

I’m guessing the radio signal somehow induces a voltage on the USB cable?

It could be something else like the radio transmitter kicks on and sucks power from the battery and USB and your laptop has a reset-able “fuse” on the USB when you draw too much current for it.

1 Like

IF that is the case, it is a design flaw and should be addressed?

USB can be used for more power than the 500mA limit the the original spec allowed these days, so no, I don’t think it would be a design flaw at all. Just different specs.

I am not sure what your problem is–I just wanted to point out there are many possibilities.

I have tried this on 3 differrent PC’s and laptops. Different cables. Different code. The only constant is the Electron.

The USB driver has gone through a significant overhaul in preparation for the next release. You can get this from the feature/0.5.x branch if you are building locally. We will be making this available as a pre-release in our online tools soon - would be great to have your testing and feedback when that’s done.

1 Like

Do you think my problem is in the Windows USB driver?