A swiss army knife for data extraction and analysis of power system log files
Messing with power hardware is risky. Poking dodgy wires in strange holes can wake giants. This code is highly experimental and based on tons of guesswork. This is an incomplete list of possible dangers, but ... If you burn down your house / garage / bunker or release the magic smoke from your kit, that's on you. You have been warned.
Walk away now if this makes you uncomfortable.
- Local control and freedom from the tyranny of the cloud
- It's the only way forward
- Collecting and decoding EG4 Modbus TCP streams
- Extracting and decoding EcoFlow CAN bus log files
- Replay of discrete user events to control devices via CAN bus
Related hardware: solar generators, inverters, etc
- clone this repo (git skills)
- nodejs 20 or newer (and knowing what that is)
- raspberry pi with a CAN adapter (or windows equivalent)
- any EcoFlow product with a CAN bus
- patience, curiosity, grit, and a dash of outrage
Wattzup is written in Javascript. There is no Python here. AI may or may not be able to rewrite / reinterpret this for you.
git clone https://github.com/gridspace/wattzup
npm run setup
collect some data over the network from your inverter:
node src/main-modbus.mjs collect --hosts=[your-inverter-ips]
analyze the packets dumped to the inv-logs dir:
node src/main-modbus.mjs analyze [path-to-packet-data-file]
things to note. the collector usually receives bursts of packets and
numbers them for the group they arrive in. with the exception of the first
burst of packets, the EG4 info data is usually in packet .0001
the first packet received when you connect to the inverter is the hold data
which are the inverter settings. this gets the .0001 label because the
collector does no packet analysis and this could differ for your inverter.
this modbus code has only been tested with the EG4 6000XP with the wifi dongle. when any hosts connects to the dongle, all other connections are dropped by the dongle.
let's jump right into the deep end with an example of processing some PowerKit can log files to look for PV input toggle events. canlog takes either a pipe of data from stdin (with the - argument) or a single file name. this example cats the output of several files into canlog
cat <filelist> | node lib/can/canlog - \
--rec \
--chan=B \
--typs=A3:05,A3:50,F4:05,F4:50,CB:03 \
--nodes=34001,50001 \
--dvs4=0351,0506
this prints the headers and records (--rec) for messages that match all critera:
- channel
Bmessages - any of several given record types
- any of several given node ids
- any of several given dv4 ids
canlog defaults to the candump log format. if you want to use the .csv format produced by SavvyCAN, then use the --csv command line option.
see canlog usage for more details
use the --hex option to print the raw payloads.
when you isolate a stream using --str, add --hex=diff to show values changing over time.
use the --pivot feature and dump data into a google sheets table to find user events in the streams of data. this requires a whole todo of its own.
- adding record types to lib/structs.json
- setup processes for getting CAN data out of devices
- sample log files for new devices
- join the Discord server
