Get 'clean' Serial output with Particle Serial Monitor

Hi all,
I use particle-cli serial monitor and I often get Serial output in ‘random’/dirty order; debugging it becomes very hard.
It specially happens when I’m using Serial and Log together like in last example from @rickkas7 (https://github.com/rickkas7/SpiffsParticleRK/blob/master/examples/6-list-files-SpiffsParticleRK/6-list-files-SpiffsParticleRK.cpp)

I’m using ElementaryOS terminal but I found the same output with xterm.
Also let me suggest the Devs to specify the --follow flag in the doc. It’s super useful and I’ve just discovered it today :stuck_out_tongue:

What’s the problem?
Tnks

I sometimes see a similar issue with the Boron LTE (several different ones) on my iMac. It seems to corrupt the USB stack somehow, because often I lose all the Bluetooth devices on the Mac as well. It always coincides with some operation on the Boron (flashing via DFU, plugging/unplugging the USB, etc.) A reboot is required to get it back to normal. This does not happen on my Macbook Pro.

@Gorgo, are you using the Serial object and the Log object at the same time? Notice that @rickkas7’s example does NOT use Serial directly for outputting and instead uses Log.info(). This is because using Serial directly will clash with the logging system. Thus the dirty output.

Sorry @peekay123, it happened to use them together in other apps, but in the screenshot case I was running the ricckas’s example, that - you’re right - uses only Log. :thinking:

Ping @rickkas7

Change this line:

SerialLogHandler logHandler(LOG_LEVEL_TRACE);

to

SerialLogHandler logHandler;
1 Like