rusoku / TouCAN-SocketCAN

SocketCAN Linux driver for UAB "Rusoku Technologies" TouCAN USB to CAN bus converter

Home Page:https://www.rusoku.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error installing on Raspberry Pi/OpenPlotter

fenix-sailor opened this issue · comments

I'm getting a make error very similar to the one reported a few months ago by SCarns.
I'm running a Pi 4B with the Moitessier Hat 2, kernel 5.4.79-v7l+
I am a complete noob with linux, so I was following the SignalK instructions downloaded from the Rusoku.com website.

I get a make error, compiling, as follows:

pi@openplotter:/TouCAN-SocketCAN $ sudo make
make -C /lib/modules/5.4.79-v7l+/build M=/home/pi/TouCAN-SocketCAN modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.79-v7l+'
CC [M] /home/pi/TouCAN-SocketCAN/toucan.o
/home/pi/TouCAN-SocketCAN/toucan.c: In function ‘toucan_rx_can_msg’:
/home/pi/TouCAN-SocketCAN/toucan.c:522:3: error: implicit declaration of function ‘can_frame_set_cc_len’; did you mean ‘skb_reset_mac_len’? [-Werror=implicit-function-declaration]
can_frame_set_cc_len(cf, msg->dlc, priv->can.ctrlmode);
^~~~~~~~~~~~~~~~~~~~
skb_reset_mac_len
/home/pi/TouCAN-SocketCAN/toucan.c:533:24: error: ‘struct can_frame’ has no member named ‘len’
stats->rx_bytes += cf->len;
^

/home/pi/TouCAN-SocketCAN/toucan.c: In function ‘toucan_usb_probe’:
/home/pi/TouCAN-SocketCAN/toucan.c:906:12: error: ‘CAN_CTRLMODE_CC_LEN8_DLC’ undeclared (first use in this function); did you mean ‘CAN_CTRLMODE_FD_NON_ISO’?
CAN_CTRLMODE_CC_LEN8_DLC;
^~~~~~~~~~~~~~~~~~~~~~~~
CAN_CTRLMODE_FD_NON_ISO
/home/pi/TouCAN-SocketCAN/toucan.c:906:12: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:266: /home/pi/TouCAN-SocketCAN/toucan.o] Error 1
make[1]: *** [Makefile:1732: /home/pi/TouCAN-SocketCAN] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.79-v7l+'
make: *** [Makefile:6: all] Error 2

Hello,
you are trying to use socketcan driver version for Linux kerrnel version >5.15

For older kernel version you have to use:

git clone --branch v1.0 https://github.com/rusoku/TouCAN-SocketCAN

instead:

git clone https://github.com/rusoku/TouCAN-SocketCAN

D'oh! For some reason, I read 5.4.x as later than 5.15.x, even though it clearly isn't. The revised version works, though it did throw some errors and also seemed to break pypilot (fixed by uninstalling and reinstalling pypilot).
Thanks!

Hi,
can you provide what kind of errors you encounter ?

Here it is:

pi@openplotter:~ $ lsmod | grep toucan
toucan 20480 0
can_dev 28672 1 toucan
pi@openplotter:~ $ ifconfig -a
can0: flags=128 mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether dc:a6:32:3f🇩🇪04 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 1133 bytes 140782 (137.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1133 bytes 140782 (137.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.50.156 netmask 255.255.255.0 broadcast 192.168.50.255
inet6 fe80::dea6:32ff:fe3f:de05 prefixlen 64 scopeid 0x20
ether dc:a6:32:3f🇩🇪05 txqueuelen 1000 (Ethernet)
RX packets 192 bytes 40169 (39.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 73 bytes 30322 (29.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.1 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::dea6:32ff:fe3f:de05 prefixlen 64 scopeid 0x20
ether dc:a6:32:3f🇩🇪05 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 75 bytes 28436 (27.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

pi@openplotter:~ $ sudo ip link set can0 up type can bitrate 250000
pi@openplotter:~ $ sudo nano /etc/rc.local
pi@openplotter:~ $ sudo apt install nodejs npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (10.23.0-1nodesource1).
nodejs set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
nodejs : Conflicts: npm
npm : Depends: node-gyp (>= 3.6.2~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
pi@openplotter:~ $ sudo npm install -g npm@latest
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js

  • npm@7.20.1
    added 66 packages from 26 contributors, removed 241 packages and updated 193 packages in 18.87s
    pi@openplotter:~ $ sudo install -g --unsafe-perm signalk-server
    install: missing destination file operand after 'signalk-server'
    Try 'install --help' for more information.
    pi@openplotter:~ $ sudo npm install -g --unsafe-perm signalk-server
    npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (debug-js/debug#797)
    npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
    npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
    npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

added 48 packages, removed 37 packages, changed 492 packages, and audited 541 packages in 2m

24 packages are looking for funding
run npm fund for details

11 vulnerabilities (7 moderate, 4 high)

To address all issues, run:
npm audit fix

Run npm audit for details.
pi@openplotter:~ $ signalk-server
sk-to-nmea2000:no configuration data
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
Could not start mDNS:Error: dns service error: name conflict
NMEA0138 tcp server error: listen EADDRINUSE: address already in use :::10110
Signal K tcp server error: listen EADDRINUSE: address already in use :::8375
{ Error: bind EADDRINUSE 0.0.0.0:20220
at state.handle.lookup (dgram.js:242:18)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
errno: 'EADDRINUSE',
code: 'EADDRINUSE',
syscall: 'bind',
address: '0.0.0.0',
port: '20220' }
{ Error: bind EADDRINUSE 0.0.0.0:51000
at state.handle.lookup (dgram.js:242:18)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'EADDRINUSE',
code: 'EADDRINUSE',
syscall: 'bind',
address: '0.0.0.0',
port: '51000' }
{ Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1280:14)
at listenInCluster (net.js:1328:12)
at Server.listen (net.js:1415:7)
at /usr/lib/node_modules/signalk-server/lib/index.js:278:20
at createServer (/usr/lib/node_modules/signalk-server/lib/index.js:317:5)
at Promise (/usr/lib/node_modules/signalk-server/lib/index.js:262:9)
at new Promise ()
at Server.start (/usr/lib/node_modules/signalk-server/lib/index.js:261:12)
at Object. (/usr/lib/node_modules/signalk-server/bin/signalk-server:26:8)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '::',
port: 3000 }
Error Resource temporarily unavailable Cannot lock port