Tools for monitoring an SDM630 3 phase meter and reporting output to PVoutput
Main C code is from Mario Stuetz in thread 123solar Eastron SDM630 DC
- Reads current values over MODBUS from a Eastron SDM630 digital meter and exports to an ini file
- Uploads data to PVOutput for analyses and graphing
- Can download weather data to include in upload
- Eastron SDM630 DC installed in main switchboard
- USB to RS485 adaptor.
- I used a USB to RS485 TTL Serial Converter Adapter FTDI interface FT232RL 75176 Module S
- Or a TCP-RS485 e.g. Q14870 USR-TCP232-304 or Q00194 USR-TCP232-24
- sdm630-usb requires ModBus Libraries
- Scripts are written in Python3
- Python3 script for PVOutput requires requests
-
If installing on Raspberry Pi, I suggest using a ram disk for storage to prevent wear on SD card. The downside to a ram disk is you will lose data if power is lost or Pi is rebooted before upload occurs.
-
Create a tmp directory mount point for RAM disk
sudo mkdir /var/tmp
-
Add the following to bottom of /etc/fstab
tmpfs /var/tmp tmpfs nodev,nosuid,size=1M 0 0
-
Mount the RAM disk to create it
sudo mount /var/tmp
-
-
Install libraries for modbus
sudo aptitude install libmodbus-dev libmodbus5
Compile with
gcc sdm630-usb.c -o sdm630 `pkg-config --cflags --libs libmodbus`
-
Copy files
sudo mkdir /opt/sdm630 sudo cp config/sdm630.conf /etc/ sudo cp import/* /opt/sdm630/ sudo cp output/* /opt/sdm630/
-
Edit /etc/sdm630.conf config file
- Add your PVOutput API Key and System ID.
- If you are not a PVOutput donor make sure you set PVextend to false.
- Enter Weather Underground API and Station ID.
Edit cron files using crontab -e
*/5 * * * * /opt/sdm630/sdm630-poll.sh
3-59/5 * * * * /opt/sdm630/pvoutput.py
2-59/5 * * * * /opt/sdm630/downloadWeather.sh
- SNMP extension to allow data collection by Cacti or other SNMP tools