Can adaptor issue

After updating rpi from *old *to latest, unable to get USB Can adaptor working in signalk server Using USB (canable.io) Can adaptor for n2k. works fine on Old_setup : rpi4 (older rpiOS/earlier nodejs, earlier signalk 1.4x server) *Latest *Rpi4 build (same hw) but with latest rpiOS/nodejs/skserver (linux 12 bookworm, nodejs v20.18.0, skserver V2.11.0) .... and using 64bit version of Bookworm.. (as reccomended on rpi imager download) Config - have added two lines to /etc/rc.local ————- # initialise CAN bus sudo ip link set can0 up type can bitrate 250000 sudo ip link set can0 txqueuelen 1000 exit 0 ————- sudo lsusb shows the USB device listed as expected sudo ifconfig shows below (the can adaptor is definitely there and generating messages.... but i note that ALL packets are shown as dropped.. a clue?) signalk server have setup connection in server identical to old version nmea2000 source = Canbus (canboat.js) interface = can0 (& done a server restart .. multiple times) Summary: i can reconnect a rpi4 (same hw) with older setup - and it finds n2k USB interface and works as expected (n2k working ok) then swap to new rpi (exact same hw) but with updated OS/node/signalk refuses to work (n2k connection in dashboard shows up with 5msg/s ... and NO signalk paths populated) ... it should be showing >140 msg/s.. and lots of paths ... something about the newer rpiOS? or nodejs? or ??? or is this a 64bit issue (old rpi was on 32bit i recall)
No description
41 Replies
Greg Young
Greg YoungOP2mo ago
No description
Greg Young
Greg YoungOP2mo ago
No description
naugehyde
naugehyde2mo ago
What happens when you run candump from the command line? If candump fails, try sudo candump. Maybe it's a permissions issue.
Greg Young
Greg YoungOP2mo ago
candump …. “command not found” .. do i need to install anything for CAN to work? its stock rpi (latest) OS.. only thing related to CAN that ive done is the two lines in /etc/rc.local. have i missed something? installed can-utils candump can0 … produces a result as expected … lots of scrolling data . so doesnt appear to be a permission thing? (as i didnt need to use sudo) further. after running (successfully) candump can0 . then running ifconfig. there is now a difference between Rx packets and dropped packets .. thatbis, before candump can0 was run, Rx and dropped were identical (ie all packets dropped) now there is a difference.. presumably it didnt drop a bunch whilst running candump. … this would appear to indicate that rpi is successfully recieving CAN data from USB interface, but signalk (canboatjs ??) is not ingesting it?
Greg Young
Greg YoungOP2mo ago
question: do i need to manually install canboatjs?? and if yes, which of below?
No description
Greg Young
Greg YoungOP2mo ago
candumpjs can0 produces a scrolling screen of messages … and i can see expected n2k messages in there. …. all looks ok.
Scott Bender
Scott Bender2mo ago
Any errors on the admin dashboard?
Greg Young
Greg YoungOP2mo ago
this is how i have the connection setup in server
No description
Scott Bender
Scott Bender2mo ago
looks good
Greg Young
Greg YoungOP2mo ago
nope.. all plugins etc showing clean and thisnis what is shows for n2k connection
No description
Scott Bender
Scott Bender2mo ago
down below that, and errors?
Greg Young
Greg YoungOP2mo ago
possible clue? because i “moved” all my configs across from old rpi to new, i copied across the following directory home/pi/.signalk/plugin-config-data
Scott Bender
Scott Bender2mo ago
that's fine, should not have anything to do with incoming n2k
Greg Young
Greg YoungOP2mo ago
hmm and also Signalk basedeltas.json, settings.json wonder if this screwed it?
Scott Bender
Scott Bender2mo ago
I don't see how you sure there are no errors in the log? on the dashboard?
Greg Young
Greg YoungOP2mo ago
dashboard clean, all green ink! checking log …
Greg Young
Greg YoungOP2mo ago
relevant part of settings.json. look ok?
No description
Scott Bender
Scott Bender2mo ago
yep does this dir exists: /usr/lib/node_modules/signalk-server/node_modules/@canboat/canboatjs
Greg Young
Greg YoungOP2mo ago
yep.
No description
Greg Young
Greg YoungOP2mo ago
oops thats different directory.
Greg Young
Greg YoungOP2mo ago
yep
No description
Greg Young
Greg YoungOP2mo ago
log .. no clues… which items should i have enabled?
Scott Bender
Scott Bender2mo ago
Heading to the dentist… Will get you some debug to turn on when I get a chance
Greg Young
Greg YoungOP2mo ago
ok good luck with that! n2k trouble shooting for me tomorrow.. midnight here. thx
Scott Bender
Scott Bender2mo ago
Start with debug for canboatjs:candevice, and look at the log when sk starts up.
Greg Young
Greg YoungOP2mo ago
… i think im doing the correct process.. but where do i run this from?
No description
Scott Bender
Scott Bender2mo ago
Just go to the admin console Under Server Logs Put it in the text box at the top
Greg Young
Greg YoungOP2mo ago
ah
Scott Bender
Scott Bender2mo ago
Turn on persist
Greg Young
Greg YoungOP2mo ago
i looked in signalk faq .. and found the reference to using above method (for debugging plugins) i was trying self help!
Greg Young
Greg YoungOP2mo ago
No description
Greg Young
Greg YoungOP2mo ago
not sure if relevant .. nodejs -v reports V20.18.0 looking at the error messages … is it the version of nodejs that is installed on my pi creatingbthe problem? nodejs got updated tomthis latest version when installing Grafana i recall…. (the grafana install went ahead and updated nodejs i recall)
Scott Bender
Scott Bender2mo ago
Yeah, that’s cause you updated nodejs after installing the sk server
Greg Young
Greg YoungOP2mo ago
bloody grafana install …. it just did it when installing “latest” grafana i guess
Scott Bender
Scott Bender2mo ago
Just reinstall sk server
Greg Young
Greg YoungOP2mo ago
😦 that will overwrite existing? … so i guess i copy across the various directories (again) … will it overwrite the nodered flows also? these are my notes that im using Files/config to move manually Signalk basedeltas.json, settings.json /home/pi/.signalk/plugin-config-data /home/pi/.signalk/red (nodered flows etc) reinstall additional node pallettes . look about right? will tackle this tomorrow morning.. after coffee. ‘thanks for all your help.
Scott Bender
Scott Bender2mo ago
that won't overwrite anything it's just the "binary" files for the server just use the usual "npm install -g" command
Greg Young
Greg YoungOP2mo ago
@Scott Bender problem solved! as always you nailed it. many thanks and just for my & others future reference. Its not the version of nodejs that is installed? its because there was an update to nodejs after installing signalk-server ? @Teppo Kurki maybe we should put something in the "installing signalk" documentation about that? I note the documentation has installing nodejs as the step prior to signalk-server (understandably) however "later".. along comes another program install eg Grafana ... which goes ahead and updates nodejs version.. and at least in my case stopped CAN from working i found this in FAQs .... perhaps we can make it more explicit? "After any? update to nodejs, its recommended to reinstall signalk-server"
Greg Young
Greg YoungOP2mo ago
No description
Teppo Kurki
Teppo Kurki2mo ago
Please update it!
Greg Young
Greg YoungOP2mo ago
ok i will have a go at it.
Want results from more Discord servers?
Add your server