htool / pico2signalk

Read Simarine Pico values and insert them into SignalK
MIT License
10 stars 4 forks source link

Does not work after upgrading Simarine #8

Open anderhau2 opened 1 month ago

anderhau2 commented 1 month ago

As we have talked about on email. I have now tried a brand new Simarine Unit, and a new RPI with clean installed Open Plotter. It will not communicate. Log looks like this:

Aug 19 20:31:27 2024-08-19T19:31:27.815Z pico2signalk Starting plugin Aug 19 20:31:28 2024-08-19T19:31:28.168Z pico2signalk Error: Error: bind EADDRINUSE 0.0.0.0:43210 Aug 19 20:31:28 signalk-server running at 0.0.0.0:[object Object] Aug 19 20:31:28 2024-08-19T19:31:28.418Z pico2signalk sensorList: {"0":{"type":10,"pos":0},"1":{"type":7,"pos":1},"2":{"type":4,"pos":2},"3":{"type":"null","pos":3},"4":{"type":"null","pos":3},"5":{"name":"Barometer","type":"barometer","pos":3},"6":{"name":"PICO INTERNAL","type":"volt","pos":5},"7":{"type":"null","pos":11},"8":{"type":"null","pos":11},"9":{"type":"null","pos":11},"10":{"name":"12V BANK #1","type":"current","pos":11},"11":{"name":"SC503 [2575] 1","type":"volt","pos":13},"12":{"name":"SC503 [2575] 2","type":"volt","pos":14},"13":{"name":"SC503 [2575] 1","type":"ohm","pos":15},"14":{"name":"SC503 [2575] 2","type":"ohm","pos":16},"15":{"name":"SC503 [2575] 3","type":"ohm","pos":17},"16":{"name":"24V TEKNISK","type":"current","pos":18},"17":{"name":"SC503 [0862] 1","type":"volt","pos":20},"18":{"name":"SC503 [0862] 2","type":"volt","pos":21},"19":{"name":"SC503 [0862] 1","type":"ohm","pos":22},"20":{"name":"SC503 [0862] 2","type":"ohm","pos":23},"21":{"name":"SC503 [0862] 3","type":"ohm","pos":24},"22":{"name":"ST107 [7161] 1","type":"volt","pos":25},"23":{"name":"ST107 [7161] 2","type":"volt","pos":26},"24":{"name":"ST107 [7161] 3","type":"volt","pos":27},"25":{"name":"ST107 [7161] 1","type":"ohm","pos":28},"26":{"name":"ST107 [7161] 2","type":"ohm","pos":29},"27":{"name":"ST107 [7161] 3","type":"ohm","pos":30},"28":{"name":"ST107 [7161] 4","type":"ohm","pos":31},"29":{"type":"XX","pos":32},"30":{"type":20,"pos":33},"31":{"name":"12-24v Omformer","type":"current","pos":34},"32":{"name":"Ledig (var sol) ","type":"current","pos":36},"33":{"name":"Kj?ling","type":"current","pos":38},"34":{"name":"Smarthus","type":"current","pos":40},"35":{"name":"SCQ25T [5416] 1","type":"volt","pos":42},"36":{"name":"SCQ25T [5416] 2","type":"volt","pos":43},"37":{"name":"SCQ25T [5416] 3","type":"volt","pos":44},"38":{"name":"SCQ25T [5416] 1","type":"ohm","pos":45},"39":{"name":"SCQ25T [5416] 2","type":"ohm","pos":46},"40":{"name":"SCQ25T [5416] 3","type":"ohm","pos":47},"41":{"name":"SCQ25T [5416] 4","type":"ohm","pos":48},"42":{"type":"XX","pos":49},"43":{"name":"Webasto Luftvarmer 24v","type":"current","pos":50},"44":{"name":"Solceller Bak","type":"current","pos":52},"45":{"name":"230v Inverter","type":"current","pos":54},"46":{"name":"Solceller Dekk","type":"current","pos":56},"47":{"type":"XX","pos":58},"48":{"name":"12V BANK #1","capacity.nominal":17280000,"type":"battery","pos":59},"49":{"name":"24V TEKNISK","capacity.nominal":7776000,"type":"battery","pos":64},"50":{"name":"DIESEL BB","capacity":1000,"fluid_type":"diesel","fluid":"fuel","type":"tank","pos":69},"51":{"name":"VANN","capacity":1000,"fluid_type":"fresh water","fluid":"freshWater","type":"tank","pos":70},"52":{"name":"DIESEL SB","capacity":1000,"fluid_type":"diesel","fluid":"fuel","type":"tank","pos":71},"53":{"name":"SEPTIK BAK ","capacity":250,"fluid_type":"blackwater","fluid":"wasteWater","type":"tank","pos":72},"54":{"name":"Vann Batterirom","capacity":100,"fluid_type":"blackwater","fluid":"wasteWater","type":"tank","pos":73},"55":{"name":"BATTERY 3","capacity.nominal":4320000,"type":"battery","pos":74}}

htool commented 4 weeks ago

What does 'ip addr show' give as a result?

anderhau2 commented 4 weeks ago

pi@openplotter:~ $ ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 2c:cf:67:75:22:84 brd ff:ff:ff:ff:ff:ff inet 192.168.1.128/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0 valid_lft 76472sec preferred_lft 76472sec inet6 fd7f:7f99:86a6:aadd:d1b2:504:6652:29ae/64 scope global dynamic noprefixroute valid_lft 1773sec preferred_lft 1773sec inet6 fe80::fdf1:e643:759b:cecb/64 scope link noprefixroute valid_lft forever preferred_lft forever 3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 link/ether 2c:cf:67:75:22:85 brd ff:ff:ff:ff:ff:ff 4: wlan9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 2e:cf:67:d5:22:85 brd ff:ff:ff:ff:ff:ff inet 10.42.0.1/24 brd 10.42.0.255 scope global noprefixroute wlan9 valid_lft forever preferred_lft forever inet6 fe80::2ccf:67ff:fed5:2285/64 scope link valid_lft forever preferred_lft forever

anderhau2 commented 4 weeks ago

As mentioned by email, I get the same "Error: Error: bind EADDRINUSE" if I turn the Simarine unit completely off (cut power). This is from a brand new RPI 5.0, installed with clean Open Plotter Image with no other software installed. I'm wondering if the EADDRINUSE error is unrelated to the fact that data is not coming from Simarine. It could have been there before without me seeing it.

I'm able to use teamviewer onto my PC in the boat, and from there remote into RPI either by VNC or SSH. You are welcome to debug on my install if you want. I'm also able to cut power to Simarine remotely, but not much other changes to Simarine setup.

htool commented 4 weeks ago

the error is about a port already in use for listening, which means either another process already opened it, or the same device is already in listening mode.

The config reads well, so that's ok.

On the network Pico sends out UDP broadcast data, which needs to be seen by the RPi. tcpdump is the command to verify as well as enabling debug for the plugin.

If network traffic is reaching the Rpi, and the plugin can see it, maybe it fails one of the sanity checks.

What does plugin debug output look like again?

htool commented 4 weeks ago

uncomment line 80: // app.debug(message)

and add: app.debug("Length: %d", message.length)

anderhau2 commented 4 weeks ago

uncomment line 80: // app.debug(message)

and add: app.debug("Length: %d", message.length)

What file is this, and location? 😊

anderhau2 commented 4 weeks ago

Any chance of just make an appointment for a workshop where I let you onto the RPI remotely? I guess it would be far more efficient then me being in the middle... 😊