I’m experimenting with a remote solar setup for a LoRa gateway and using a Victron SmartSolar solar charge controller. The Victron products seem superior in every way to other competitors, including providing a VE.Direct port, which when combined with their USB cable going in to the Pi based gateway lets me monitor solar panel output, battery performance, and more.
I’m interested in using a UDEV rule to detect when the USB cable is plugged in - including potentially kicking off a script that parses the VE.Direct serial messages and piping them to an MQTT server dynamically.
I just did a test by running udevadm monitor — environment in the host container and unplugging and plugging back in the Victron → USB adapter.
Thanks @mpous. I did see those docs originally, which got me up to this point.
I think my trouble is not knowing the best practice for which event to hook the rule up to. The output above wasn’t clear enough for me to know which of those events specifically I need to use.
Anyways, udev aside, the experiment is going really well.
(1) 50w Solar Panel
(1) Victron Smart Charge Controller
(1) 12vx6ah LifePo4 (providing 72 watt hours) Battery
(1) VE.Direct to USB cable
(1) Sixfab PowerHAT v2
(1) Raspi 4 (will eventually replace with a CM4 based Lora gateway)
What I realized is that the battery is too small at 12v 6ah. On sunny days it will get me through the night, but on anything less that perfect sun I only get between 14 and 18 hours of runtime.
I’ve learned a good rule of thumb is about 72 hours of runtime is best, so I’ll need to replace the primary battery with a 12v 50ah on the high end. Especially when considering that the Pi4 during testing isn’t running the LoRa concentrator or cell modem which would increase the power draw.
Hey, Balena engineer here, love the project. I’m a die-hard fan of VE products too, having used many other brands for solar stuff. I actually have a camper van with solar with 4 Tesla Model S batteries from EV West connected to a VE multiplus, and it has worked very well for years for me despite the rough treatment in a camper van.
But on to your query…it’s been a while since I’ve done this, but you can see a list of attributes on your USB device with lsusb -D /dev/ttyUSB0, and use those in the rule, e.g.
I guess I should explain a little further… the idVendor corresponds to the product vendor (victron energy) and the idProduct to the actual product (ve connect)…this means that this script will be portable because those variables won’t change from computer to computer or if you plug the device into a different bus.
Hey Maggie, it’s not technically a balena project, more just a recreational thing for my fiance and me, but I have been thinking of ways to make a Balena “Camper” project, and I think something like this is definitely a step in that direction!
Btw, open to suggestions on how to improve Tronmon.
I’m also experimenting on the side with QuestDB which would add a very light weight, super fast on device time series database for users who want to keep their data local. From their it’s trivial to drop in Grafana for viz.
A local time-series database sound like it’s exactly what you’d need @zwhitchcox in your camper where network connectivity may be shaky thus rendering MQTT to a cloud broker useless.
Btw, @zwhitchcox thats really cool you can purchase used Tesla batteries and repurpose them that way.
There is a MASSIVE market opportunity in domestically “assembled”, high quality lithium batteries with good BMS’s, sourced from re-purposed but still good cells.
Lots a cheap hacks on the internet trying to capture the end-of-life turnover market on lead acid and the growing off-grid movement.