SignalK / vedirect-serial-usb

18 stars 14 forks source link

Support more than one (1) USB-ve.direct dongle #29

Closed LeaseOnLife closed 3 years ago

LeaseOnLife commented 3 years ago

I have 4, with more coming... One for each solar controller and one for each of two battery monitors. So far I am using EmonCMS and EmonHub to record/log/graph data, and maybe able to help with mapping from BMV-700, BMV-712, MPPT smartsolar and blue-solar devices.

Thanks Dirk

Leijoma commented 3 years ago

This is something i also would appreciate. I have the Victron Smartshunt as well as a solar charge controller.

joabakk commented 3 years ago

This request is gaining popularity. I would be happy for a Pull Request tested in real life

Leijoma commented 3 years ago

I have a Solar charger and Smart shunt that i have hooked up at home if you want help with testing.

KEGustafsson commented 3 years ago

I have been modifying current version to support multiple devices (serial, udp, tcp). There are still couple of things to do before PR, but I have now already almost working setup. I hope I can finalize mods during weekend and then I can do a PR.

Leijoma commented 3 years ago

I tested the multiple devices branch. I was able to create two devices, but got the following error message in the plugin config: Status: Failed to start: Cannot read property '0' of null.

The config file looks like this after creating two devices:

{ "configuration": { "vedirect": [ { "device": "Serial", "connection": "/dev/ttyUSB0", "port": 7878, "ignoreChecksum": true, "mainBatt": "House", "auxBatt": "Starter", "solar": "Main" }, { "device": "Serial", "connection": "/dev/ttyS0", "port": 7878, "ignoreChecksum": true, "mainBatt": "House", "auxBatt": "Starter", "solar": "Main" } ] }, "enabled": true }

KEGustafsson commented 3 years ago

@Leijoma I pushed a fix to that issues, so it should be working now. Can you test again? Give each device mainBatt, auxBatt and solar fields unique name. These names are used for SK paths.

Leijoma commented 3 years ago

@KEGustafsson I have downloaded the fix and now i get data from both devices! However it looks like all data (from both devices) is displayed in each device. See screenshot. (All rows from VeDirect does not fit on the screen at the same time)

screendump_databrowser

KEGustafsson commented 3 years ago

@Leijoma Now you pointed this out, I can see the same issue. I will start to investigate what is wrong and how to correct that.

KEGustafsson commented 3 years ago

@Leijoma Now the parser issue should be corrected. Can you test once more? On my trials, this is working OK with tcp and udp connections.

Leijoma commented 3 years ago

@KEGustafsson Looks great.

My setup is:

Output looks like this: electrical.batteries.House_solar.current | 0. | A | 04/11 16:15:46 | vedirect-signalk.XX electrical.batteries.House_solar.voltage. | 11.49 | V | 04/11 16:15:46 | vedirect-signalk.XX electrical.batteries.Starter_shunt.voltage | -0.014 | V | 04/11 16:16:34 | vedirect-signalk.XX electrical.charger.House_solar.chargingMode | "off" |   | 04/11 16:16:35 | vedirect-signalk.XX

Thank's for fixing this!

/Magnus