question

pierresmits avatar image
pierresmits asked

docker on venus os

On my little boat power is limited, so adding any additional hardware will consume more.

My current setup is:

  • a PI 3b+ 4GB running VenusOS large (powered via a 12v hat, sporting latest stable release and Nodered, running 24/7, connected to VRM when in the marina)
    • a 12V 20Ah LiFePo4 SuperPack
    • a 110v Victron Solar Panel
    • a SmartSolar 75/10
    • a SmartShunt

In the dark and cold days my battery is insufficiently charged by the solar setup, and shuts down due to low voltage.

I want to fix that. When in port I can use shore power and a SmartCharger to top the battery up (during the evening night). The desire is to do that in a smart way, using Nodered flow(s) and a shelly S plug.

Additionally, I want to prevent the battery shutdown due to low temperature. Also solving this the smart way, using Nodered and a shelly S plug.

Any ideas how to tackle this?

Given that the PI is underutilised, ideally I would like to an IOTstack setup (running Home Assistant controlling the Shelly plugs and Grafana) in docker on the PI. It should be possible. Well known YouTuber Andreas Spies has some good videos on getting a IOTstack up and running in the home. I want to have something similar on the boat.

But I don't see any posts how to get docker, etc installed.

Can you help me out?

Best regards,
Pierre


Venus OSRaspberry Pidocker
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

8 Answers
bathnm avatar image
bathnm answered ·

@PierreSmits I have managed to get a basic docker environment running on VenusOS, however it is not easy and to get a full working solution requires kernel changes and much much more. The VenusOS has not been designed to provide such capability and that is why you do not see it either in the product or guidance on how to do it. Every firmware upgrade would require significant work to get Docker back in and running.

The VenusOS large image includes NodeRed and allows you to build the sort of flows you are talking about, please see here

All of the control can be done via NodeRed, it is not clear what or why else you want a full IoT stack or Grafana and Home Assistant. A search of the internet shows a plugin to NodeRed which will allow control of the Shelly devices. VRM can give you a load of graphing, unless of course internet access is an issue. If that is the case then today it would be a case of running a second machine with Grafana as per this documentation.

I am sure that Victron is aware of the limitations of VenusOS and VRM needing internet connectivity to deliver a graphing solution, and will at some point fix this. However it will be in their time frame and little information will be available on the capability until such time as they are ready for it to be tested.

Note that NodeRed also has a dash-boarding capability, however that might not meet all your needs especially if you want detailed historic data.

If you really want to go down the docker route, then a lot of reading, linux skills and time will be required to get it working.

One other thing to consider, if you are going to do any form of data storage for historical purposes, using some form of database (aka influxdb), is where you will store that data. It is very read and write intensive and SD Cards are not designed to handle the storage needs.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

pierresmits avatar image
pierresmits answered ·

Thanks for the speedy reaction. Your points raised were also mine when I started thinking about the issue.


The reasons for my thought process are multiple:

  • using a docker setup using the IOTstack angle would drive a huge ease of implementation, not only regarding:
    • Home Assistant (for the other smart stuff)
    • Grafana (visualisation of not only Victron equipment data
    • Dropbox integration, which I didn't mention in my previous post (for the crucial data)
  • via the IOTstack, I could easily integrate an Access Point, DynDNS and a VPN without hassle, the latter two regarding the WIFI in the marina is sans security...
  • when not in the marina I (and others) could still monitor, via the boat's Access Point via a 2nd WIFI usb plug, on the PI stats through Grafana (again ease of use/user experience wise as more (in my surroundings) are familiar with the Grafana (and/or Home Assistance) than the Victron Cerbo/Nodered interface.
  • without it's own AP I would need to go through hoops to get to a secure setup regarding the Shelly plugs (marina WIFI = Public WIFI)

Of course, the above is dependent on resource availability on the PI (CPU and MEM) on the PI. The read/write aspect is not an issue, as currently it is running off an usb stick. A secondary PI on the boat is not an option atm.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

pierresmits avatar image
pierresmits answered ·

Having the shelly nodes in NodeRed off the OS implies that I have to use the Shelly cloud services for the plugs. And, given that these then also have to connect to the public WIFI of the marina I then introduce potential security risks. And in NodeRed, I need to change the IP settings every time I get confronted with changed IP addresses for those.

A docker integration would make life easier.... Maybe, @mvader and his team of VenusOs wizards could include that into next release of VenusOS Large. ;)

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

bathnm avatar image
bathnm answered ·

@PierreSmits I do not think you will get Docker integrated into VenusOS any time soon, as it brings little value to having it. NodeRed and SignalK are already integrated, so what does adding docker do?

Have you considered the SignalK shelly plugin? Nots are if that needs their cloud capability. It maybe that you can send a message from NodeRed to SignalK to the shelly. Take a look at this

Also look at this bordered plugin. It uses MQTT to communicate with the shelly.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

pierresmits avatar image
pierresmits answered ·

Thanks @Bathnm

The SignalK shelly plugin works the same way as the NodeRed Shelly plugin, namely over WIFI. Which, in the marina, is the unsecured Public WIFI.
But, apart from that, adding SignalK to the mix just for doing the thing that NodeRed can and should do (switching the Shelly plugs on/off) would be a wrong way to go.

You said you had a rudimentary docker setup going through customisation. Can you explain how you achieved that?

Best regards,
Piere

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

bathnm avatar image
bathnm answered ·

@PierreSmits I do not have a Shelly device to test with. However NodeRed and SignalK both have Shelly MQTT interfaces. This from looking at the code and what I can deduce is a connection directly between Node Red or SignalK and the shelly device. A google search for shelly and MQTT does also imply that there can be a direct connection between shelly and an MQTT broker, without any cloud capability. Unfortunately the RPI version of VenusOS does not come with a local AP configured, as it only has one WIFI interface and it is assumed it is used for WAN/LAN connection to a local WIFI AP. If you had the Cerbo device from Victron, it has two WIFI devices, one for WAN/LAN and a second for a local AP to connect direct to the Cerbo. The software should therefore be on the RPI to enable the WIFI interface as an AP rather than for WAN/LAN. Do that and your shelly can connect to the RPI AP, then using NodeRed you can use one of the plugins to communicate directly with the Shelly. The downside of this is you have no remote access to the RPI through the marina WIFI.

The power draw from an RPI is so low, you could create a mini router. Further a small router is also fairly low current drain and that could provide a local AP that everything can connect to and it can handle connection to the Marina. Without validation it is unclear if you a turn the VenusOS into a router to pass traffic between interfaces. So even if you had docker it is not clear that you can use VenusOS as a route.

If you really want to go docker, then get hold of the VenusOS SDK, install it on a unix box, compile docker, package it into a format for installing onto the RPI. Every upgrade of the VenusOS will require you to get a new copy of the SDK and go through the entire process again. The logs will fill with errors and alerts, as there are kernel components not available, and therefore some of the docker environment might not work correctly, so then you are into building a new kernel and kernel modules.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

pierresmits avatar image
pierresmits answered ·

@Bathnm

Getting the PI going as an AP (too) would be the bare minimum to have the Shelly plugs connect to it and then use NodeRed flows to switch them on/off based on battery SOC/temp. Then I could forgo with the whole docker/grafana/home assistant...

How to achieve that, while still having data go the VRM?
Would that not require both a hostapd and dhcpd setup?

Best regards,
Pierre


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

bathnm avatar image
bathnm answered ·

@PierreSmits you only have one WIFI so it is one or the order... Have the Pi connected to VRM or the Pi connected to the Shelly. The other option is to fork out on a Cerbo GX ;) or try and get a second WIFI via a USB wifi dongle, or accept that a small WIFI AP is needed,

I hope you find something acceptable.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic

Raspberry Pi running Victron’s Venus firmware - Blog Post

Venus OS Large image: Signal K and Node-RED - Install

raspberrypi install venus image


Additional resources still need to be added for this topic

Victron Venus OS Open Source intro page

Venus OS GitHub (please do not post to this)