LowPowerLab Forum

Hardware support => CurrentRanger => Topic started by: elirann on January 02, 2022, 08:32:16 AM

Title: data logging using usb connection [solved: need R3 firmware]
Post by: elirann on January 02, 2022, 08:32:16 AM
Hello,

I'm a new Current ranger user. I was trying to connect the current ranger to my
laptop via usb and get the current samples \ current reading from a simple circuit I made.

With Python script I used from here:

https://github.com/MGX3D/CurrentViewer

I was trying to send this command to the Terminal:

python current_viewer.py -p COM21

But I'm getting an error (GUI failed to load):
"...Fatal: Could not connect to USB/BT COM port COM21. Check the
logs for more information"

Does anyone know why I can't connect to the port and the GUI failed to load?

I checked my port number and it's correct. I also tried to use other micro-usb cable
and it didn't help. (By the way the current samples can be seen on the OLED just fine)
I connected the USB cable through USB-Isolator.

Any tips or simple guide to record the current data over time?
Even with Arduino in someway? (I don't have the Bluetooth module so I didn't try it yet)
I'm a completely new with this device.

Thanks in advance.
Title: Re: data logging using usb connection
Post by: Felix on January 02, 2022, 08:06:57 PM
I should note that I have not created the software but I can try to answer questions.
You will need python3, see the docs (https://github.com/MGX3D/CurrentViewer). For instance I have both python 2 and 3 so calling python invokes python2, instead I need to call python3 or current_viewer will fail.

For logging, the device outputs a serial stream, which you can consume in whatever way you'd like, you are not restricted to one tool or another.
Title: Re: data logging using usb connection
Post by: elirann on January 03, 2022, 04:02:59 AM
Hey,

I have already tried to run the script as I mentioned (On Python3).
But I have an error. Can you please be more specific with your reply?

Thanks again
Title: Re: data logging using usb connection
Post by: Felix on January 03, 2022, 10:34:24 AM
If calling python invokes python3 then you're OK.
The way you're using the command seems correct. Why it won't work I do not know. Try lower capitals, "com21".
Title: Re: data logging using usb connection
Post by: elirann on January 09, 2022, 03:27:14 AM
Thanks I finally solved it by updating the firmware to CurrentRanger_R3.
CurrentRanger_R1 probably not supporting it.
Title: Re: data logging using usb connection
Post by: Felix on January 10, 2022, 09:00:37 AM
Ah yes!
That's an important detail. R1 was not yet that advanced to include the logging formats required by CurrentViewer.
Thanks for the update.