I had this attached to another related post, but it was ignored, likely as no one was interested in the other post. However, I’d like to be able to read output from Log.info() calls via USB, but without supplying power via USB. The project involves powering the device via battery, so I don’t want USB power.
I purchased a USB adapter that supposedly does not pass power, only data. However, the Particle device is not recognized by my MacBook if power isn’t being provided via USB.
Is there a technique that’s best practice for reading Serial.print() and/or Log.info() calls when not supplying power via USB?
@no1089 , thanks for the suggestion. I’ll give it a try when I’m next in the office. Do you have a recommendation for a usb/serial adapter that you’ve had success with?
One more thing I would like to mention, not 100% sure but you can use Serial1.print() functionality etc. just worries about Log.info() etc. as is strictly connected with Serial
UPDATE
never mind I found the answer for myself you can easily use it with Serial1LogHandler
Gen 3 devices cannot use a USB port that does not supply power. The nRF52 uses the presence of USB power to determine whether to turn on the USB block in the MCU. If there is no USB power, the USB module in the MCU is turned off.
You can use Gen 2 devices with no USB power.
Serial1 is usually the best alternative if you need to measure current, and also for catching log messages immediately after waking from sleep.
@dreamER , I acquired the Pololu board you recommended and changed SerialLogHandler to Serial1LogHandler. I connect TX and GND from my Argon board to RX and GND respectively on the Pololu board. I connected my MacBook to the Pololu board with a USB cable. However, I’m getting “No serial port identified” when I do a particle serial monitor.
I did a ls -al /dev and found some ports with the current time stamp. However, adding them to particle serial monitor --port didn’t help. I’d appreciate any guidance.
@ctmorrison you have to specify from which port you would like to pull data.
Connect Pololu adapter to your MacBook and then try: brew install lsusb and then: lsusb
when you discover your adapter e.g: /dev/ttyS0 (I’m Linux guy, no clue about Mac )
try: particle serial monitor --port /your/discovered/usb_to_serial (e.g: particle serial monitor --port /dev/ttyS0)
Well…I think so. I believe I had tried to monitor any other device that had the appropriate timestamp, but without success. I then installed the driver and it worked…as soon as I picked the appropriate device. The only way I’d know for sure would be to remove the driver and try again. But, I don’t have the time to do that right now.