TLDR: We setup an RPi to communicate with and control to our Riden RD6018. This will allow us to script and automate testing of van electrical components down the road.
Why bother getting an RPi talking to a Riden RD6018
Why? Because you can script and automate testing. Why an RPi? Because I don't trust hooking up my prized laptop to unknown equipment. Thats about it. It required a little poking around and some familiarity with the command line.
Getting an RPi talking to a Riden RD6018
After messing around, this is the straight path that got a headless RPi talking to the RD6018:
Install a clean Raspian Lite image using Raspberry Pi Imager. CTRL+SHIFT+X to preconfigure the image for SSH and wifi.
Boot up, find the RPi's IP, and SSH in. Note, some of the following commands will require sudo, but I wasn't paying close attention.
apt update
apt upgrade
apt install git
(Raspian Lite doesn't come with it)apt-get install raspberrypi-kernel-headers
(This was needed to make in the following steps)git clone https://github.com/natecostello/CH341SER.git
(This is the RIDEN USB Linux Driver)cd CH341SER/
make
make load
cd ~
apt install python3-pip
pip3 install -U minimalmodbus
git clone https://github.com/natecostello/rd6006.git
cd rd6006/
python3 setup.py install --user
Connect the RD6018 to the RPi, and power it up
python3 -m serial.tools.list_ports
/dev/ttyAMA0
/dev/ttyUSB0
python3
>>> from rd6006 import RD6006
>>> r = RD6006('/dev/ttyUSB0')
RD6012 or RD6018 detected
>>> r.status()
== Device
Model : 6018.1
SN : 00004257
Firmware: 1.34
Input : 68.0V
Temp : 29°C
TempProb: 21°C
== Output
Voltage : 5.0V
Current : 0.0A
Energy : 0.0Ah
Power : 0.0W
== Settings
Voltage : 5.0V
Current : 18.1A
== Protection
Voltage : 62.0V
Current : 18.2A
== Battery
Capacity: 0.0Ah
Energy : 0.0Wh
== Memories
M0: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
M1: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
M2: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
M3: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
M4: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
M5: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
M6: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
M7: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
M8: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
M9: 5.0V, 18.100A, OVP:62.0V, OCP:18.200A
- Woo