question

vassilis-bourdakis avatar image
vassilis-bourdakis asked

V2.80 Large: getting N2K temp and tank data in VenusOS (vecan-dbus?) and enhanced GUI tools

morning all,

system works fine following the upgrade to 2.80Large20, very happy!

Took me some time to get all my signalk mods back onboard and now all the data I want are channelled to influx and grafana.


Now, having installed kwindrem tools, I realised that I can now have temps (inside, outside, water, fridge/freezer, etc) as well as the three tanks (fresh, black, diesel) shown on this same screen which is a great advantage in not having to turn on any garmin displays (in my case) to view the obvious (running out of water, or something...) thing is that the values don't "pass on" automagically, so need some work. Kwindrem tried to help me (see here this github discussion: https://github.com/kwindrem/GuiMods/issues/13# ) to no avail. I did learn a few things out of that discussion, but no firm conclusions, hence turning to here.

One suggestion is that my system misses vecan-dbus service which is indeed not running as seen on my posts on the github thread. Now, my system has a BMV and a MPPT30/100 hooked up with usb cables to the rpi 3B+. The current multiplus is v.old and doesn't feature ve.bus or whatever the new ones have, so cannot connect it to my rpi. I'm in the process of upgrading it but will be some time before I do so.

So, to reach a conclusion/question:

how can I get the N2K PGNs/data that flow through the WAVESHARE HAT on my pi and happily get into signalk and off to influx, be "visible" (not sure that's the right word!) to VenusOS and thus accessible from kwindrem excellent gui tools?

what am I missing?


cheers

V.



VE.Bus
2 |3000

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

3 Answers
vassilis-bourdakis avatar image
vassilis-bourdakis answered ·

closing the thread:

1. if N2K tank data are setup according to spec [device configured for tanks only, multiple tanks sent with individual IDs] they'll appear on venusOS with GuiMods

2. N2K temp data are not supported

3. If something's wrong, try reinstalling @Kevin Windrem SetupHelper et al. In my case, following all this editing taking place it somehow got the can1 pointers on /opt/victronenerge/system/vecan-dbus.can0 . As a result system was ALWAYS trying to start vecan-dbus.can0 but was failing (easy to find it by checking the run log..). Editied it back to point to can0 and rebooted, everything is running fine!

again many thanks to @mvader (Victron Energy) and @Kevin Windrem

V.

2 |3000

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

vassilis-bourdakis avatar image
vassilis-bourdakis answered ·

@mvader (Victron Energy) could be that your reply in the above issue is relevant to what I'm asking?

https://community.victronenergy.com/questions/46344/vecan-dbus-services-disappear-if-gui-isnt-running.html

just searching about with not much luck...

V.

1 comment
2 |3000

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

mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ commented ·

Hi Vassilis, I'm sorry, but reading your question I don't really understand it. What information are you trying to get, and from where to where?


Is it tank data and temperature data from SignalK into Venus OS? Then look at the signalk-venus plugin to see what is supported, and what is not.


Or is there data on the N2K network that you want to read directly into Venus OS? From N2K we only support tank data. Not temperature data. And tank data has some limitations.


And to read data from N2K, indeed the vecan-dbus process needs to be running and configured propery. Which is taken care of by the gui. And how to set that up exactly is documented afaik. For example here: https://github.com/victronenergy/venus/wiki/RaspberryPi-CAN-Interfaces..


I hope that helps

0 Likes 0 ·
vassilis-bourdakis avatar image
vassilis-bourdakis answered ·

good morning Matthijs,

apologies, always trying to formulate my Qs in a way that will make easier you knowledgeable lot spent least time comprehending and replying. Not always succeeding though! Problem is that I'm still confused on the internals of what I'm trying to achieve, so please bear with me:

Following the wiki and using kwindrem https://github.com/kwindrem/VeCanSetup scripts I have my WAVESHARE HAT working fine. Now I define fine as in data from half a dozen N2K devices sending many PGNs get to the pi, signalk interprets them and sends them off to influxDB and then grafana. This in my mind means that N2K Input to rpi h/w is functioning.

I want to use some of that data with kwindrem's gui tools on the 7in rpi screen. I wrongly thought that it would be transparent/automatic. It isn't, fine! so I'm now at the stage of figuring out how to do it.

System has only got 2 VE.Direct devices connected to it via USB. Guess that's why vecan-dbus is not running as a service, may be wrong on that.You can probably confirm that hypothesis.

Now candump can0 dump loads of data, which is consistent with signalk getting 140deltas/sec!

dbus-spy shows:

Services
com.victronenergy.adc
com.victronenergy.battery.ttyUSB1                                        BMV-700
com.victronenergy.fronius
com.victronenergy.logger
com.victronenergy.modbusclient.tcp
com.victronenergy.modbustcp
com.victronenergy.qwacs
com.victronenergy.settings
com.victronenergy.solarcharger.ttyUSB0        BlueSolar Charger MPPT 100/30 rev2
com.victronenergy.system


running the following command (picked it up reading around on the web):

/opt/victronenergy/vecan-dbus/vecan-dbus -c socketcan:can0 --banner --log-before 25 --log-after 25 -vv

dbus-spy shows:

Services
com.victronenergy.adc
com.victronenergy.battery.ttyUSB1                                        BMV-700
com.victronenergy.fronius
com.victronenergy.gps.socketcan_can0_vi0_uc25801                   NMEA 2000 GPS
com.victronenergy.logger
com.victronenergy.modbusclient.tcp
com.victronenergy.modbustcp
com.victronenergy.qwacs
com.victronenergy.settings
com.victronenergy.solarcharger.ttyUSB0        BlueSolar Charger MPPT 100/30 rev2
com.victronenergy.system
com.victronenergy.vecan.can0

note the extra com.victronenergy.gps.socketcan_can0_vi0_uc25801 and the I guess more useful

com.victronenerg.vecan.can0

on doing so, on the rpi I can now see on Settings/Services/CAN-bus(1)/Devices a list of all my NMEA2000 network devices onboard. Which I guess is a good sign.

However on Settings/Services/Modbus TCP [Enabled]/Available Services/ I only get:

com.victronenergy.system
com.victronenergy.battery
com.victronenergy.solarcharger
com.victronenergy.gps

don't see com.victronenergy.temperature or .tank or something?

the above are clearly shown in the following capture:

venusos-vebus.jpg


Now, vecan-dbus is not installed, just run from a terminal with certain parameters. Need to get it running properly as the other services. Unfortunately the following instructions in the Venus wiki you posted seem to be outdated:

To connect can0 to the Venus system the following should be added:

Create a file /etc/venus/canbus_ports that contains the entry can0
Copy the directory /opt/victronenergy/can-bus-bms/service to /service/can-bus-bms.can0
Copy the directory /opt/victronenergy/vecan-dbus/service to /service/vecan-dbus.can0
Copy the directory /opt/victronenergy/mqtt-n2k/service to /service/mqtt-n2k.can0
In all three of those /service/*.can0 directories change DEV to can0 in the run and log/run files.

cannot copy this dirs as for example the /service/can-bus-bms.can0 dir structure (which is installed and running normally on my pi) doesn't match the single (large!) file that is in /opt/victronenergy/can-bus-bms/service folder. Something must have changed or missing a post-processing/compilation stage? Not sure, can you please confirm/help here?

For the record I have canbus_ports file already configured (from kwindrem's config scripts) and I do have can-bus-bms installed.

I'm missing the following two services:

vecan-dbus.can0
mqtt-n2k.can0


So, after all this intro, guess q is how do I install them bearing in mind that wiki seems to be wrong/outdated in this respect.

apologies for the long post!

cheers


V.


venusos-vebus.jpg (142.4 KiB)
17 comments
2 |3000

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

mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ commented ·
Hi,


Looks like the only thing you’ll gain by running (or installing, both will have the same end result when it comes to data in dbus-spy) vecan-dbus is a gps.


apparently your tank data is on n2k in a format we don’t support. And temperature data on n2k is something we don’t support at all.

The list of devices shown on that canbus configuration page is unrelated; that shows all devices on the bus, and some config parameters such as name or device instance. Having something listed there does not mean its data (tankdata or temperature data) is supported.


hope that explains it

0 Likes 0 ·
mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ mvader (Victron Energy) ♦♦ commented ·
Ps: you’re running into two seperate issues:

1. What data is supported by us aka by vecan-bus.

2. How to install vecan-dbus such that it auto starts at boot.


My previous comment was about the first.


On the second one, there’ll be other users around here I suppose that can help you. I won’t be able to, I’m sorry.but as said, end result will only be having your gps data on dbus

0 Likes 0 ·
vassilis-bourdakis avatar image vassilis-bourdakis mvader (Victron Energy) ♦♦ commented ·

thanks Matthijs!

yes, two problems indeed.

Hoping to sort the first one (vecan-dbus installation!) and then I'll sort the data.

BTW, all the N2K data I'm interested in presenting are produced from my custom teensy boxes, so once I find what you expect, I can formulate my data that way as well. Interesting to know what data formats you do support though! Any wiki or doc explaining this?

Even more curious as N2K tank level PGN127505 for example is v.specific and my data are supported and shown on Garmin and Maretron N2K devices onboard. Maybe it's an mqqt-n2k service issue as well?

cheers

V.

0 Likes 0 ·
vassilis-bourdakis avatar image vassilis-bourdakis mvader (Victron Energy) ♦♦ commented ·
apparently your tank data is on n2k in a format we don’t support. And temperature data on n2k is something we don’t support at all.

@mvader (Victron Energy) care to explain what n2k tank data you support please?

as I've mentioned, my data comes from my custom boxes (and work fine in Garmin and Maretron displays), so it's v.easy for me to alter (or sent in parallel some more PGNs) to accommodate VenusOS needs. The thing is knowing what VenusOS expects. AFAIK, there are not that many options on tanks in N2K land, so curious what you use if not PGN127505 ! Any wiki/white paper explaining that?

Re temps, do you only support temps that come from sensors mounted straight to your devices? I guess v.low priority for you, but with the N2K busses running more and more boats, would make sense to be able to accommodate N2K temps as well (granted there are half a dozen PGNs doing temps in N2K so that would be more complex!) Since I've spent the last couple of years coding/testing/building PGNs in my free time (and through lockdowns...) I'd be happy to help if you wish.

cheers

V.

0 Likes 0 ·
mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ vassilis-bourdakis commented ·

@Vassilis Bourdakis my bet would be that you haven’t implemented ACL in your custom tank sender boxes. There is no wiki or documentation. Your best bet would be to get one of the supported tanklevel senders (see a GX device manual for the exact models) and then use a datalogger to see what exactly they send out.


For the temperature from n2k: sorry but for now I’m not interested in spending any time on that from Victron side.

0 Likes 0 ·
vassilis-bourdakis avatar image vassilis-bourdakis mvader (Victron Energy) ♦♦ commented ·
long time, busy with real life...


OK, checked what you mentioned, recompiled my arduino code to explicitly state that the device is a tank sender and voila I've got the mess that Kevin tried to sort with his TankRepeater:

I get the Settings/Services/Modbus TCP/Available Services/ :

com.victronenergy.gps

com.victronenergy.tank

So success!

Now I'm down to having a quick loop between the three tank (fresh, black, diesel) but there it seems I cannot use the TankRepeater as it states that it's not compatible with my version 2.80 large 20. That's for Kevin!

thanks Matthijs & Kevin for the help so far.

cheers

V.

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem vassilis-bourdakis commented ·
TankRepeater conflicts with the v2.80 N2K tank code and ends up duplicating one of the tanks. The Victron code as of v2.80 now separates multiple tanks from the same N2K unit. Not sure what's done differently between something like SeeLevel and what you are doing.
0 Likes 0 ·
vassilis-bourdakis avatar image vassilis-bourdakis Kevin Windrem commented ·

thanks for the reply Kevin,

not sure either, mind my N2K box now produces the same ProductId of 41312 as you mention in your TankRepeater github. TBH, it's not at all surprising considering the PGN127505 details are more or less cast in stone.

For the record, the PGN has to be sent ever 2.5secs to be N2K spec compliant. That's what I'm doing. I'll try upping that to 5 or even 10secs for testing but maybe Garmin and Maretron will complain. Actually now on the pri I can see diesel all the time and black tank flashes by every few secs on the screen. Fresh water is ignored guess not enough time to do a quick flashby...

Wonder if you know where this code is in venusOS to have a look at. Failing that I guess I can edit your script and install TankRepeater anyway, nothing to loose tbh.

For the record, tested with a similar way creating a new TEMP only device, but didnt have the tank device luck, nothing shows up on the services, so I'll give that up. Would definitely like to sort out tanks though, so any ideas most welcomed.

cheers

V.

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem vassilis-bourdakis commented ·
Not sure where the code is. I just know that you can't get to the source to make changes.

There is no temps path through this code so not surprised it didn't work.

You may encounter issues with TankRepeater as I never tried it on Python 3. Post a note on my GitHub repo if you need to make changes and I'll incorporate them.

SeeLevel does not evenly space updates so one tank often just flashed by. TankRepeater even misses it on rare occasions but I deal with that.

I can't think of anything else to try. Sorry.

0 Likes 0 ·
vassilis-bourdakis avatar image vassilis-bourdakis Kevin Windrem commented ·

success!

remote-console-on-lan-google-chrome-21-9-2021-7-25.png

reading the N2K spec once more found another bug in my code! Was sending all three tank values under the same ID, changed it (0, 1, 2), all working fine with 2.80 large!

Now only issue left is figuring out how to load this on system start:

/opt/victronenergy/vecan-dbus/vecan-dbus -c socketcan:can0 --banner --log-before 25 --log-after 25 -vv &

tried adding it in /data/rc.local but no luck!

cheers

V.

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem vassilis-bourdakis commented ·

For Cerbo, CCGX, etc, a CANbus service is already set up and will run when an N2K device is detected. You need to install this service when running on a Raspberry PI.

Here's how:

https://github.com/victronenergy/venus/wiki/RaspberryPi-CAN-Interfaces

Or just install my VeCanSetup:

https://github.com/kwindrem/VeCanSetup

0 Likes 0 ·
vassilis-bourdakis avatar image vassilis-bourdakis Kevin Windrem commented ·

moving the discussion to

https://github.com/kwindrem/GuiMods/issues/13

as it seems to be more relevant...

I have that installed btw else wouldn't be able to run and see the N2K bus (I guess at least)

cheers

V.

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem vassilis-bourdakis commented ·

Maybe this will help sorting out what needs to be sent so Venus can recognize your tanks. It is my can0 traffic. The only device on that intervace is my SeeLevel N2K tank system.

root@einstein:~# candump -x can0

can0 TX - - 1CEFFFE1 [8] 66 99 02 20 51 05 00 00

can0 TX - E 1CEFFFE1 [8] 66 99 0A 20 9C FF FF FF

can0 TX B E 1CEFFFE1 [8] 66 99 0E 20 05 00 00 00

can0 RX - - 19F2110A [8] 51 82 00 6F 04 00 00 FF

can0 RX - - 19F2110A [8] 10 C0 14 6F 04 00 00 FF

can0 RX - - 19F2110A [8] 22 04 01 6F 04 00 00 FF

can0 RX - - 19F2110A [8] 51 82 00 6F 04 00 00 FF

can0 TX B E 1CEFFFE1 [8] 66 99 02 20 51 05 00 00

can0 TX - E 1CEFFFE1 [8] 66 99 0A 20 00 00 00 00

Repeats the same commands over and over

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem commented ·

@mvader (Victron Energy), this appears to be a bug.

The Wiki is out of date for v2.80 since services are installed in /opt/victronenergy/service. This directory overlays /service.

The other issue is v2.80 has a read-only /root file system. It must be remounted read-write to make any changes.

SetupHelper and VeCanSetup address both issues, but there is another difference starting with v2.80.

Previous versions required coping the service directory from inside /opt/v*/vecan-dbus. v2.80 doesn't do this, AND there is no service directory to copy so VeCanSetup can't install them. In v2.80, all services are already present in /opt/v*/service BUT the vecan-dbus and mqtt-n2k services are missing on the RPI 4!

They are present on Cerbo. I can't check other builds because currently v2.73~1 is the release candidate.

On Cerbo /opt/v*/service includes the following (among others):

drwxr-xr-x 3 root root 1024 Aug 19 10:19 can-bus-bms.can0

drwxr-xr-x 3 root root 1024 Aug 19 10:19 can-bus-bms.can1

drwxr-xr-x 3 root root 1024 Aug 19 10:19 dbus-motordrive.can0

drwxr-xr-x 3 root root 1024 Aug 19 10:19 dbus-motordrive.can1

drwxr-xr-x 3 root root 1024 Aug 19 10:19 dbus-valence.can0

drwxr-xr-x 3 root root 1024 Aug 19 10:19 dbus-valence.can1

drwxr-xr-x 3 root root 1024 Aug 19 10:32 mqtt-n2k.can0

drwxr-xr-x 3 root root 1024 Aug 19 10:32 mqtt-n2k.can1

drwxr-xr-x 3 root root 1024 Aug 19 10:19 vecan-dbus.can0

drwxr-xr-x 3 root root 1024 Aug 19 10:19 vecan-dbus.can1


On Rpi 4 /opt/v*/service includes the following (among others):

drwxr-xr-x 4 root root 1024 Aug 19 11:00 can-bus-bms.can0

drwxr-xr-x 3 root root 1024 Aug 19 11:00 can-bus-bms.can1

drwxr-xr-x 4 root root 1024 Aug 19 11:00 dbus-motordrive.can0

drwxr-xr-x 3 root root 1024 Aug 19 11:00 dbus-motordrive.can1

drwxr-xr-x 4 root root 1024 Aug 19 11:00 dbus-valence.can0

drwxr-xr-x 3 root root 1024 Aug 19 11:00 dbus-valence.can1


mqtt-nk2 and vecan-dbus are missing!


Update: I checked other builds of v2.80~15 for missing services:

raspberrypi2 and raspberrypi4 are missing

mqtt-n2k.can0

mqtt-n2k.can1

vecan-dbus.can0

vecan-dbus.can1

nanopi is missing

vecan-dbus.can1

ccgx

vecan-dbus.can1


canvu500 is complete

beaglebone is complete

einstein is complete


0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem Kevin Windrem commented ·
I have updated the VeCanSetup and SetupHelper packages to install the missing vecan-dbus and mqtt-n2k services.


BTW, the missing service directories are missing on the RPI 3 build also.

Question to @mvader (Victron Energy) : should my script be installing dbus-motordrive and dubs-valence services also? I don't recall seeing these prior to v2.80 and since v2.80 has all services installed it may be a non-issue.

0 Likes 0 ·
mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ Kevin Windrem commented ·
Hi @Kevin Windrem , the motordrive and valence are part of the Oceanvolt setting. There is no need for you to spend time one that I’d think.


Wrt vecan-dbus (and the far less relevant mqtt-n2k service): I don’t know about that, I’ll try to find out later.


for the wiki: I’ll add a note that its out of date for now, anyone is welcome to fix it further.

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem mvader (Victron Energy) ♦♦ commented ·
I updated the Wiki including adding a comment about missing services. I'll remove that comment when the missing services get added.
0 Likes 0 ·

Related Resources