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
GitHub
FAQ: Frequently Asked Questions
An implementation of a Signal K central server for boats. - SignalK/signalk-server
lots of options. None of which should require building drivers.
What do you have?
https://www.amazon.com/dp/B0CFVP3PBJ?psc=1&ref=ppx_yo2ov_dt_b_product_details
I am using an Intel micro PC running Ubuntu
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.
Are you saying that Intel micro PC with Ubuntu won't run signalK, or that the CAN to USB adapter won't work?
The adaptor. I don’t know if it will work.
Hi everyo, i just connect canable pro to the raspi and it doesn't recognize any device. Any suggestions? Thank you!
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
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.

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.
Here what kind of data do I need to put? Nmea2000 or signalk?


Here should appear raspberry? Because I'm emitting to nmea2000 through canable



I'm very confused 😕
I don’t know what that screenshot is from?
It does not look like you are getting any data from the canable?
What I want is output data to the B&G Vulcan 7 which has NMEA2000 input.
Thank you Scott 🙏
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
?No, I didn't
it has to be run everytime the pi boots up
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.
you should not
Ok thank you so much Scott!
but something is off here. I just saw that screeenshot of the candump.
and it looks like you are gertting data
Yes
But might be is corrupted because of the bitrate
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
Ok
I'll do it
@Scott Bender are you there?
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...
this is the log
https://drive.google.com/file/d/1YTiG0Yga8tfGz-n6sYJplrzF7McGpTmQ/view?usp=sharing
This is a video with the config
can you try the canboatjs command I gave you?
This one?
I did
You ran candump, not candumpjs
Ohh
You are right
I leave the boat already 🥺
I bought CAN HAT with MCP2515 and it didnt work either 😦

I tried candumpjs can0 and there is no traffic
also I changed the bitrate to can0

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?
something like that

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

I bought that
I connected everything and it doesn't work 😦


It receives some data at Rx messages

I connected can_l can_h and gnd to the nmea network
And the network is connected to 12v

I connected canable to windows and check if received any data from Vulcan and it doesn't.
All TX errors are definitely suspect
Do you get those when the canable is disconnected?
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
So hard to tell what’s going on with only two n2k devices.
I'm running out of options to try
The Vulcan or the canable could be bad. Or the wiring could be bad.
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 🙂
Do you really need to do a new install?
No
It's to discard possible errors
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.
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.
You sure you have the can hi/low wires right?
Yes
Is it possible to be the firmware I flashed to the canable device?
Did you flash the alternate firmware?
What do you mean?
I linked to it above

I flashed this one
Try candlelight
That’s what I use on the one in my lab
With candlelight in my windows pc must read sentences from the network?
Using cangaroo?
Not sure what you mean?

Try with it before connecting to the raspberry
For debugging
Or it's better flash candlelight and try it with the raspberry
Yeah, I’m pretty sure candlelight is required for it to work with sk.
But does it work in windows now?
Ohh 😯 ok I'll try this evening
No
That should work
Ok thanks
Definitely not going to work on raspberry if it does not work in windows.
Ok thanks
And pointing to a bad unit or bad wiring.
Strange that the HAT does not work either…
It matters that I have canable pro from AliExpress?
No idea
Flashed...but not working 😦



That connector looks strange. I’m not anywhere to confirm by looking at mine.
The nmea2000 connector?
Yes
It fits perfectly with the other devices

Maybe google is failing me

I think it's nmea 2000 but the conector is micro-c

But then it looks like you have the red in the +V
That is for male, mine is female
No, that’s male
Am I crazy 🤣

Sadly those pics don’t help
😦
It’s not the pins, the outside part that determine gender
I always get this screwed up 🤣
Yes, so do I

I think that's correct
Could confirm with a multimeter
DC measure?
Yeah, find the 12V
I got 12v
So the connection was ok
No data 😦


I'm flashing the bottom one. Canable/canable pro 0.4 and older
But mine is mks canable pro v 1.0

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

Yeah!!
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...
It always is!
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....

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???
I use the Waveshare II
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?
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
The Yacht Devices stuff is good too.
Much more expensive though
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
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 🤣
😂
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?=

I added but the interface is missing
is this my config?
dtoverlay=gpio-poweroff,gpiopin=2,input,active_low=17
dtoverlay=i2c-rtc,pcf8563
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23
ill copy that
Rebooting
not working 😭
reinstalling canbus libraries
Do I need to supply the hat with 12v??
The CAN interface dtoverlay is the last line in Scott's snippet
hi matti
so what is the config do I need to put?
Then you need /etc/udev/rules.d/80-can.rules:
And then, finally, the network interface config /etc/systemd/network/80-can.network:
Heck.
Are you comfortable with Linux shell scripts? Meaning that can you read simple scripts?
If so, have a look at this:
https://github.com/hatlabs/openplotter-halpi/tree/main/stage-halpi/03-setup-interfaces
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.
I'm comfortable with linux terminal
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. 🙂
so download the script and the folder and run it
and it will create the interface
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
ok
in your conifg you put pin 23 but the wiki says pin 22 (gpio 25)
what pin shoud I use?
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?
The interrupt is definitely GPIO23.

yes that is the board
gpio 23 or pin 23?
GPIO
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
Some instructions define the interface in /etc/network/interfaces. That's fine as well
You don't need that
sorry
install -m 644 files/sc16is752-spi1-cs26.dtbo "${ROOTFS_DIR}/boot/firmware/overlays/"
that's for the RS-485 interface
I dont' have /boot/firmware/overlays
Yeah, you don't have to do that
ok thank you
It's only if you have the RS-485 HAT as well
just the rules and networks
any permisions to the file?
644?
And the one dtoverlay line
That's fine, I don't think it's critical
yes it's done the config.txt with your lines from config.txt.part
ok
so...GPIO23....interrupt 16
isnt it?
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. 🙂dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=16
ok rebooting
interface is empty
😦

But what does ifconfig say?
And check also
dmesg
There is no can0

Here is the error

Uhh
Do you have any other HATs connected?
No, I have and optocoupler connected
optocoupler?

For reading seatalk 1
Nooo! You have a different board! 😄
Wait a sec
Ohhh

Plus is the magic difference
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+
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
gpio 22 it's pin 15
But you always define them as gpio numbers in the config files

Rebooting
Cross fingers
Thank you @Matti Airas and @Scott Bender for helping me!!
Good that you provided the photo
no worries
😦
No working
The same error
dmesg?
Yes

Might be need gnd from nmea2000?
ok, got it
that hat uses a different SPI interface
SPI pins are different
😦
You can keep the network interface config from my setup but follow the waveshare wiki regarding config.txt setup
return it and order the normal without plus
no no, that's going to be fine
there's nothing wrong with that board
dtparam=spi=on
dtoverlay=i2c0
dtoverlay=spi1-3cs
dtoverlay=mcp2515,spi1-1,oscillator=16000000,interrupt=22
this?
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
what you mean?
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

that's different!
Yes but can bus doesn't detect the device
What does ifconfig say?

Yeaah
I got data
working fine!
Signal k not receiving data
Just change the interface
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. 😄
Thank you!!!
no worries!
bye
Good night!
Works perfectly! Thank you!!!

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?
Possible? Definitely. Easily? Not sure.
Jaja
I would start a new thread on it
Ok, I'll do it
Thank you Scott