Electron: CLI Serial Monitor in Workbench (Windows 10)

electron
Tags: #<Tag:0x00007fe21f920a00>

#1

Good evening,

I’m working on a project with the electron, but cannot seem to get any traction.

I’m using Workbench on Windows 10. I’ve flashed the LED blink tutorial and watched the light blink. Now I’m moving on to integrating other things, but I cannot seem to get Serial output to work using Workbench.

I’m connected through the USB that I use to flash. Windows device manager shows COM4 in use in ports. When I jump into the CLI inside VSCode: particle serial monitor states serial monitor opened successfully… then nothing.

The only thing the code does is Serial.begin(9600) in setup() then in loop() Serial.println(“Test”); delay(5000).

That’s it. But there isn’t anything coming across serial. Firewalls all disabled. Windows Defender disabled. I’ve tried cycling through the modes. Blinking blue. Nothing. Anything else: nothing.

Any ideas where I’m going wrong here? Is the usb that allows local flashing input only?


#2

particle serial monitor does not automatically connect / disconnect, so you’re probably just missing the message. Also, it takes a few seconds from the time setup() runs and you enable serial until you can see messages on the console.

I’d suggest two things. First use nmon (search the forum here for it), and second add a delay of 3-5 seconds to setup().


#3

Post your full code here and we can help more.


#4

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

void loop()
{
Serial.println(“test”);
delay (5000);
}


#5

I believe I have found the problem, which will probably kill this project.

I’ve been working with the antennae off. So blinking green light.

And it won’t do anything like that.

But I connected the antennae to get “breathing cyan” (or whatever color light bluish green is), and I get serial output.

Is this normal behavior? Because a board that works with a cellular connection is great. A board that only works in the presence of a cellular connection is useless, for us.


#6

Do you mean with the antenna disconnected? If so, this can permanently damage the Boron. You should never attempt connection (which is automatic by default) without an antenna connected. If you want to run without a cellular connection look into SYSTEM_MODE(MANUAL); on this forum.


#7

This is because you are operating in SYSTEM_MODE(AUTOMATIC); which is the default. It will block your code until Cellular connection is established (hence blinking green). Without an antenna installed it likely will never establish a connection, and the signals will reflect back down the RF line, damaging your device over time. Either connect an antenna, or use SYSTEM_MODE(MANUAL); and only attempt cellular connection when an antenna is attached.


#8

Electron. Not Boron.

Why would the default mode be a damaging mode when shipped with a disconnected antennae?


#9

Electron or Boron is the same in this regard. Particle ships products meant to be easy to use, and part of that is making the default mode 1) use an internal SIM, 2) connect to the cloud automatically, and 3) provide an easy to use cloud service. All of the documentation warns not to run without an antenna attached. This is not an issue specific to Particle. Any RF system transmitting without an antenna attached will get reflections and can possibly be damaged.

Particle ships a small antenna with their devices. Just connect it. It’s small.


#10

It definitely didn’t jump out at me, can you show me where in the documentation?

Admittedly, how easy is “easy to use” if one has to read 1,000 pages of technical documentation?

Would it be possible for me to submit a code suggestion, more of a “smart default mode,” where the damaging action is performed at most a maximum number of times, before it stops doing that, and enters non-blocking, non-damaging mode until reset?

That would seem like a simple, win-win and minor code change.


#11

Correct, but particle serial monitor --follow does :wink: