mshulman - Does anyone have a CAN to USB device...

Does anyone have a CAN to USB device that they like with good linux drivers? I thought I had one, but I can't build the ubuntu drivers for it.
217 Replies
Scott Bender
Scott Bender11mo ago
lots of options. None of which should require building drivers. What do you have?
mshulman
mshulmanOP11mo ago
Scott Bender
Scott Bender11mo ago
No idea if that would even work with Signal K I have a couple of the canable ones. They work fine. I’ve only tried on a pi.
mshulman
mshulmanOP11mo ago
Are you saying that Intel micro PC with Ubuntu won't run signalK, or that the CAN to USB adapter won't work?
Scott Bender
Scott Bender11mo ago
The adaptor. I don’t know if it will work.
juans#0046
juans#00463mo ago
Hi everyo, i just connect canable pro to the raspi and it doesn't recognize any device. Any suggestions? Thank you!
Scott Bender
Scott Bender3mo ago
I think you have to change the firmware (I know I did, it that was years ago) https://canable.io/getting-started.html#alt-firmware
juans#0046
juans#00463mo ago
Yeah, is it working! But I'm a little confused. Please, help me. Signal k discovered my Vulcan 7. But it appears NMEA0183 instead of NMEA2000. WHY? What I want is send wind data from my ST40 which I'm already reading in Openplotter.
juans#0046
juans#00463mo ago
No description
Scott Bender
Scott Bender3mo ago
The server can discover some tcp 0183 sources You should ignore that if you have an nmea20000 connection It does not automatically discover a Canable. You have to add a Data Connection for that.
juans#0046
juans#00463mo ago
Here what kind of data do I need to put? Nmea2000 or signalk?
No description
juans#0046
juans#00463mo ago
No description
juans#0046
juans#00463mo ago
Here should appear raspberry? Because I'm emitting to nmea2000 through canable
juans#0046
juans#00463mo ago
No description
No description
No description
juans#0046
juans#00463mo ago
I'm very confused 😕
Scott Bender
Scott Bender3mo ago
I don’t know what that screenshot is from? It does not look like you are getting any data from the canable?
juans#0046
juans#00463mo ago
What I want is output data to the B&G Vulcan 7 which has NMEA2000 input. Thank you Scott 🙏
Scott Bender
Scott Bender3mo ago
You should be seeing something in the data browser from your n2k network? Can you screenshot the data connection settings for the canable? did you run this command ip link set can0 up type can bitrate 500000?
juans#0046
juans#00463mo ago
No, I didn't
Scott Bender
Scott Bender3mo ago
it has to be run everytime the pi boots up
juans#0046
juans#00463mo ago
Might be that's the problem I'm not at the boat right now. I'll try tomorrow evening So, once I'll run that command. I need to do any extra config for output data? I activated wind and other checks at signalk-n2k plugin.
Scott Bender
Scott Bender3mo ago
you should not
juans#0046
juans#00463mo ago
Ok thank you so much Scott!
Scott Bender
Scott Bender3mo ago
but something is off here. I just saw that screeenshot of the candump. and it looks like you are gertting data
juans#0046
juans#00463mo ago
Yes But might be is corrupted because of the bitrate
Scott Bender
Scott Bender3mo ago
might be. I'm not sure what would happen if the butrate is wrong when you get on the boat, try this after setting the bitrate
sudo npm install -g @canboat/canboatjs
candumpjs can0
sudo npm install -g @canboat/canboatjs
candumpjs can0
juans#0046
juans#00463mo ago
Ok I'll do it @Scott Bender are you there?
juans#0046
juans#00463mo ago
juans#0046
juans#00463mo ago
The B&G Vulcan 7 doesnt detect the openplotter data... I'm using Canable Pro 1.0 might be it's broken or the NMEA2000 port from Vulcan 7 is broken. I don't know... I'm going to buy RS485 Can Hat para Raspberry Pi to try other option. Also I'm going to talk another friend to try another plotter. At the begining I connected just H and L as the manual says. I tried to connect GND because it suggest some devices might need it. But I doesn't work...
juans#0046
juans#00463mo ago
this is the log
Scott Bender
Scott Bender3mo ago
can you try the canboatjs command I gave you?
juans#0046
juans#00463mo ago
This one? I did
Scott Bender
Scott Bender3mo ago
You ran candump, not candumpjs
juans#0046
juans#00463mo ago
Ohh You are right I leave the boat already 🥺 I bought CAN HAT with MCP2515 and it didnt work either 😦
juans#0046
juans#00463mo ago
No description
juans#0046
juans#00463mo ago
I tried candumpjs can0 and there is no traffic also I changed the bitrate to can0
juans#0046
juans#00463mo ago
No description
juans#0046
juans#00462mo ago
candumpjs canable0 (USB slcand device) show the data coming from s2k-nmea2000 plugin but there is no traffic from Vulcan7 to the openplotter. also I don't know why candumpjs can0 (which correspond to MCP2515 device) doesn't show the data from the plugin sk-nmea2000 The only thing left to try is going to another boat and try another nmea2000 device. I have a question, I'm connecting directly canbus (H and L) to the plotter Vulcan 7 (B&G). I'm not connecting power and ground. Might be that is the problem? The network nmea2000 is supposed to be powered by 12v?
juans#0046
juans#00462mo ago
something like that
No description
Scott Bender
Scott Bender2mo ago
I think the Vulcan may require power there And you need termination The canable also requires power and ground Oh. Maybe power, depends on the model https://canable.io/getting-started.html#connect-to-the-bus
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
I bought that I connected everything and it doesn't work 😦
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
It receives some data at Rx messages
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
I connected can_l can_h and gnd to the nmea network And the network is connected to 12v
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
I connected canable to windows and check if received any data from Vulcan and it doesn't.
Scott Bender
Scott Bender2mo ago
All TX errors are definitely suspect Do you get those when the canable is disconnected?
juans#0046
juans#00462mo ago
I'm going to spend more money and time than buying all the devices new 😂😂😂 No Sorry yes, the Rx changes if I connect the canable. But the tx are stucked. Even if I reset the counter it goes to 255 automatically and keep there
Scott Bender
Scott Bender2mo ago
So hard to tell what’s going on with only two n2k devices.
juans#0046
juans#00462mo ago
I'm running out of options to try
Scott Bender
Scott Bender2mo ago
The Vulcan or the canable could be bad. Or the wiring could be bad.
juans#0046
juans#00462mo ago
I'm going to do a fresh install and use the hat mcp2515 and try with it Because I don't know why with mcp2515 didn't appear the traces on the console from signal k plugin Thank you Scott for your help 🙂
Scott Bender
Scott Bender2mo ago
Do you really need to do a new install?
juans#0046
juans#00462mo ago
No It's to discard possible errors
Scott Bender
Scott Bender2mo ago
If you can borrow another n2k device, that would help a lot. Can be just about anything. That way you could confirm that the Vulcan can see other devices.
juans#0046
juans#00462mo ago
Ok I'll try Thank you Morning, after doing lots of tests. The canable USB device looks like to be broken because the nmea2000 network is working. I bought another device and it receives data. The thing is...why is not working the rs485 can hat? I'm going to do a fresh install of openplotter and try again.
Scott Bender
Scott Bender2mo ago
You sure you have the can hi/low wires right?
juans#0046
juans#00462mo ago
Yes Is it possible to be the firmware I flashed to the canable device?
Scott Bender
Scott Bender2mo ago
Did you flash the alternate firmware?
juans#0046
juans#00462mo ago
What do you mean?
Scott Bender
Scott Bender2mo ago
I linked to it above
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
I flashed this one
Scott Bender
Scott Bender2mo ago
Try candlelight That’s what I use on the one in my lab
juans#0046
juans#00462mo ago
With candlelight in my windows pc must read sentences from the network? Using cangaroo?
Scott Bender
Scott Bender2mo ago
Not sure what you mean?
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
Try with it before connecting to the raspberry For debugging Or it's better flash candlelight and try it with the raspberry
Scott Bender
Scott Bender2mo ago
Yeah, I’m pretty sure candlelight is required for it to work with sk. But does it work in windows now?
juans#0046
juans#00462mo ago
Ohh 😯 ok I'll try this evening No
Scott Bender
Scott Bender2mo ago
That should work
juans#0046
juans#00462mo ago
Ok thanks
Scott Bender
Scott Bender2mo ago
Definitely not going to work on raspberry if it does not work in windows.
juans#0046
juans#00462mo ago
Ok thanks
Scott Bender
Scott Bender2mo ago
And pointing to a bad unit or bad wiring. Strange that the HAT does not work either…
juans#0046
juans#00462mo ago
It matters that I have canable pro from AliExpress?
Scott Bender
Scott Bender2mo ago
No idea
juans#0046
juans#00462mo ago
Flashed...but not working 😦
juans#0046
juans#00462mo ago
No description
No description
juans#0046
juans#00462mo ago
No description
Scott Bender
Scott Bender2mo ago
That connector looks strange. I’m not anywhere to confirm by looking at mine.
juans#0046
juans#00462mo ago
The nmea2000 connector?
Scott Bender
Scott Bender2mo ago
Yes
juans#0046
juans#00462mo ago
It fits perfectly with the other devices
juans#0046
juans#00462mo ago
No description
Scott Bender
Scott Bender2mo ago
Maybe google is failing me
Scott Bender
Scott Bender2mo ago
No description
juans#0046
juans#00462mo ago
I think it's nmea 2000 but the conector is micro-c
juans#0046
juans#00462mo ago
No description
Scott Bender
Scott Bender2mo ago
But then it looks like you have the red in the +V
juans#0046
juans#00462mo ago
That is for male, mine is female
Scott Bender
Scott Bender2mo ago
No, that’s male Am I crazy 🤣
juans#0046
juans#00462mo ago
No description
Scott Bender
Scott Bender2mo ago
Sadly those pics don’t help
juans#0046
juans#00462mo ago
😦
Scott Bender
Scott Bender2mo ago
It’s not the pins, the outside part that determine gender I always get this screwed up 🤣
juans#0046
juans#00462mo ago
Yes, so do I
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
I think that's correct
Scott Bender
Scott Bender2mo ago
Could confirm with a multimeter
juans#0046
juans#00462mo ago
DC measure?
Scott Bender
Scott Bender2mo ago
Yeah, find the 12V
juans#0046
juans#00462mo ago
I got 12v So the connection was ok No data 😦
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
I'm flashing the bottom one. Canable/canable pro 0.4 and older But mine is mks canable pro v 1.0
juans#0046
juans#00462mo ago
No description
juans#0046
juans#00462mo ago
I flash this firmware and now I get the green led. Before never show up this led. https://github.com/makerbase-mks/CANable-MKS/tree/main/Firmware/CANable%20V1.0 It's working!!!! The problem is that the firmware for this device is specific
juans#0046
juans#00462mo ago
No description
Scott Bender
Scott Bender2mo ago
Yeah!!
juans#0046
juans#00462mo ago
After one million of messages and attempts...it was because of the most stupid thing... Thank you so much for your help Scott Without you I'd give it up...
Scott Bender
Scott Bender2mo ago
It always is!
juans#0046
juans#00463w ago
Hi Scott, I'm back again... The original device stop working suddenly...so I bought a new one. This time I bought canable v2.0 pro isolated. I flashed with slcand and candlelight firmwares but it doesn't receive or sent any data. In candlelight the raspberry doesn't recognize the device in Serial devices. In the terminal I got this....
juans#0046
juans#00463w ago
No description
juans#0046
juans#00463w ago
In windows with cangaroo.. it recognizes candleApi but doesn't receive data... I'm starting to fed up with this...do you recommend any device which will work???
Scott Bender
Scott Bender3w ago
I use the Waveshare II
juans#0046
juans#00463w ago
He encontrado esto en AliExpress: 24,88€ | Solución de chip Waveshare STM32, adaptador USB a CAN Modelo A, múltiples modos de trabajo, Compatible con múltiples sistemas Canbus https://a.aliexpress.com/_EvRRlDi This?
Scott Bender
Scott Bender3w ago
Hat Labs
Waveshare 2-Channel Isolated CAN HAT for Raspberry Pi: NMEA 2000 Compa
Upgrade your Raspberry Pi project with the Waveshare 2-Channel Isolated CAN HAT, providing the computer with an NMEA 2000 interface. This expansion HAT provides a reliable and secure connection to CAN Bus networks and features multiple onboard protection circuits to ensure stable and safe communication. MCP2515 CAN con
Scott Bender
Scott Bender3w ago
The Yacht Devices stuff is good too. Much more expensive though
juans#0046
juans#00463w ago
Ok thank you so much. I'm going to order it right now Hi again...I connect can to can0 and plug the hat to the raspberry. I go to canbus mcp2515 > add > spi 0 oscillator 16000000 and gpio22 but I cannot select gpio22 because it says it's used. I check /boot/config.txt and it's not activated spi
Scott Bender
Scott Bender3w ago
Getting out of my area of expertise. @Matti Airas Can you help with this? It’s been a while since I set mine up, don’t remember at all what I had to do 🤣
juans#0046
juans#00463w ago
😂 It's normal Scott https://www.waveshare.com/wiki/2-CH_CAN_HAT it's pin 22 (GPIO 25) not pin 25, isn't it?=
juans#0046
juans#00463w ago
No description
juans#0046
juans#00463w ago
I added but the interface is missing
Scott Bender
Scott Bender3w ago
is this my config? dtoverlay=gpio-poweroff,gpiopin=2,input,active_low=17 dtoverlay=i2c-rtc,pcf8563 dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23
juans#0046
juans#00463w ago
ill copy that Rebooting not working 😭 reinstalling canbus libraries Do I need to supply the hat with 12v??
Matti Airas
Matti Airas3w ago
The CAN interface dtoverlay is the last line in Scott's snippet
juans#0046
juans#00463w ago
hi matti so what is the config do I need to put?
Matti Airas
Matti Airas3w ago
Then you need /etc/udev/rules.d/80-can.rules:
SUBSYSTEM=="net", KERNEL=="can*", ACTION=="add|change", ATTR{tx_queue_len}="1000"
SUBSYSTEM=="net", KERNEL=="can*", ACTION=="add|change", ATTR{tx_queue_len}="1000"
And then, finally, the network interface config /etc/systemd/network/80-can.network:
[Match]
Name=can*

[CAN]
BitRate=250000
RestartSec=100ms
[Match]
Name=can*

[CAN]
BitRate=250000
RestartSec=100ms
Heck. Are you comfortable with Linux shell scripts? Meaning that can you read simple scripts?
Matti Airas
Matti Airas3w ago
GitHub
openplotter-halpi/stage-halpi/03-setup-interfaces at main · hatlabs...
OpenPlotter for HALPI. Contribute to hatlabs/openplotter-halpi development by creating an account on GitHub.
juans#0046
juans#00463w ago
I'm comfortable with linux terminal
Matti Airas
Matti Airas3w ago
and see what the 01-run.sh file does. Cool That's how I've set up Waveshare 2-ch CAN HAT configuration. Some of the stuff is related to the RS-485 HAT, but I've exceeded myself and commented the script. 🙂
juans#0046
juans#00463w ago
so download the script and the folder and run it and it will create the interface
Matti Airas
Matti Airas3w ago
No That script is used to build an OS image. But the steps for configuring a "live" computer are almost identical. You just need to read the script and take only the parts you need. Basically the ones I described above
juans#0046
juans#00463w ago
ok in your conifg you put pin 23 but the wiki says pin 22 (gpio 25) what pin shoud I use?
Matti Airas
Matti Airas3w ago
Use the one in my script, that's what works with the default board Waveshare's wiki pages can sometimes be a bit confusing Uh, wait... You have the same board that Scott linked?
Matti Airas
Matti Airas3w ago
The interrupt is definitely GPIO23.
No description
juans#0046
juans#00463w ago
yes that is the board gpio 23 or pin 23?
Matti Airas
Matti Airas3w ago
GPIO
juans#0046
juans#00463w ago
ok i'm adding the rules and the config the only thing i dont have is this dtc -@ -I dts -O dtb -o files/sc16is752-spi1-cs26.dtbo files/sc16is752-spi1-cs26-overlay.dts
Matti Airas
Matti Airas3w ago
Some instructions define the interface in /etc/network/interfaces. That's fine as well You don't need that
juans#0046
juans#00463w ago
sorry install -m 644 files/sc16is752-spi1-cs26.dtbo "${ROOTFS_DIR}/boot/firmware/overlays/"
Matti Airas
Matti Airas3w ago
that's for the RS-485 interface
juans#0046
juans#00463w ago
I dont' have /boot/firmware/overlays
Matti Airas
Matti Airas3w ago
Yeah, you don't have to do that
juans#0046
juans#00463w ago
ok thank you
Matti Airas
Matti Airas3w ago
It's only if you have the RS-485 HAT as well
juans#0046
juans#00463w ago
just the rules and networks any permisions to the file? 644?
Matti Airas
Matti Airas3w ago
And the one dtoverlay line That's fine, I don't think it's critical
juans#0046
juans#00463w ago
yes it's done the config.txt with your lines from config.txt.part
Matti Airas
Matti Airas3w ago
ok
juans#0046
juans#00463w ago
so...GPIO23....interrupt 16 isnt it?
Matti Airas
Matti Airas3w ago
Heh. Just looked at the script. If you export ROOTFS_DIR="", you could probably run the script and it might work, but I think it would be scary. 🙂
juans#0046
juans#00463w ago
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=16
Matti Airas
Matti Airas3w ago
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23
juans#0046
juans#00463w ago
ok rebooting interface is empty 😦
juans#0046
juans#00463w ago
No description
Matti Airas
Matti Airas3w ago
But what does ifconfig say? And check also dmesg
juans#0046
juans#00463w ago
There is no can0
juans#0046
juans#00463w ago
No description
juans#0046
juans#00463w ago
Here is the error
juans#0046
juans#00463w ago
No description
Matti Airas
Matti Airas3w ago
Uhh Do you have any other HATs connected?
juans#0046
juans#00463w ago
No, I have and optocoupler connected
Matti Airas
Matti Airas3w ago
optocoupler?
juans#0046
juans#00463w ago
No description
juans#0046
juans#00463w ago
For reading seatalk 1
Matti Airas
Matti Airas3w ago
Nooo! You have a different board! 😄 Wait a sec
juans#0046
juans#00463w ago
Ohhh
juans#0046
juans#00463w ago
No description
Matti Airas
Matti Airas3w ago
Plus is the magic difference
Matti Airas
Matti Airas3w ago
2-Channel Isolated CAN Bus Expansion HAT For Raspberry Pi, Dual Chi...
2-Channel Isolated CAN Bus Expansion HAT For Raspberry Pi, Dual Chips Solution, Stackable Design For Expanding Multiple CAN Channels, Raspberry Pi HAT | 2-CH CAN HAT+
Matti Airas
Matti Airas3w ago
That's equivalent but the interrupt pin is probably different let me have a look Lol, sorry about leading you wrong. Yes, it's interrupt GPIO 22 Just change that in config.txt and you should be good
juans#0046
juans#00463w ago
gpio 22 it's pin 15
Matti Airas
Matti Airas3w ago
But you always define them as gpio numbers in the config files
juans#0046
juans#00463w ago
No description
juans#0046
juans#00463w ago
Rebooting Cross fingers Thank you @Matti Airas and @Scott Bender for helping me!!
Matti Airas
Matti Airas3w ago
Good that you provided the photo no worries
juans#0046
juans#00463w ago
😦 No working The same error
Matti Airas
Matti Airas3w ago
dmesg?
juans#0046
juans#00463w ago
Yes
juans#0046
juans#00463w ago
No description
juans#0046
juans#00463w ago
Might be need gnd from nmea2000?
Matti Airas
Matti Airas3w ago
ok, got it that hat uses a different SPI interface SPI pins are different
juans#0046
juans#00463w ago
😦
Matti Airas
Matti Airas3w ago
You can keep the network interface config from my setup but follow the waveshare wiki regarding config.txt setup
juans#0046
juans#00463w ago
return it and order the normal without plus
Matti Airas
Matti Airas3w ago
no no, that's going to be fine there's nothing wrong with that board
juans#0046
juans#00463w ago
dtparam=spi=on dtoverlay=i2c0 dtoverlay=spi1-3cs dtoverlay=mcp2515,spi1-1,oscillator=16000000,interrupt=22 this?
Matti Airas
Matti Airas3w ago
Yeah, I was just about to copy-paste that you probably already have i2c, so you can remove that and spi as well (the first line, that is) the third line is important and the last is the same no it's not! subtle differences replace the similar line from my config with the one above I mean with what you pasted
juans#0046
juans#00463w ago
what you mean?
Matti Airas
Matti Airas3w ago
lol, that wasn't very clear dtoverlay=spi1-3cs dtoverlay=mcp2515,spi1-1,oscillator=16000000,interrupt=22 and remove this one: dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23 It'll work, I'm positive
juans#0046
juans#00463w ago
No description
Matti Airas
Matti Airas3w ago
that's different!
juans#0046
juans#00463w ago
Yes but can bus doesn't detect the device
Matti Airas
Matti Airas3w ago
What does ifconfig say?
juans#0046
juans#00463w ago
No description
juans#0046
juans#00463w ago
Yeaah I got data
Matti Airas
Matti Airas3w ago
working fine!
juans#0046
juans#00463w ago
Signal k not receiving data Just change the interface
Matti Airas
Matti Airas3w ago
you might need to check the interface config there. right if not, summon Scott back. I'm off to bed now. We have a liftoff. 😄
juans#0046
juans#00463w ago
Thank you!!!
Matti Airas
Matti Airas3w ago
no worries! bye
juans#0046
juans#00463w ago
Good night! Works perfectly! Thank you!!!
juans#0046
juans#00463w ago
No description
juans#0046
juans#00463w ago
Right now I'm sending from opencpn a waypoint to my autopilot st4000+ through nmea0183 I want to send waypoint from the plotter through nmea2000 to signalk and then convert it to nmea0183. Is is possible?
Scott Bender
Scott Bender3w ago
Possible? Definitely. Easily? Not sure.
juans#0046
juans#00463w ago
Jaja
Scott Bender
Scott Bender3w ago
I would start a new thread on it
juans#0046
juans#00463w ago
Ok, I'll do it Thank you Scott

Did you find this page helpful?