Starting the can0 interface using command:

ip link set can0 type can bitrate 250000 restart-ms 100 in /etc/rc.local

This works perfectly whenever the pi zero connects to a recognized WiFi network.

However when the pi zero boots with no recognized WiFi networks nearby the socketcan device (canable running candle) no longer registers any CAN messages 60s from boot. The CAN device works perfectly up to that ~60s point. The can0 interface still shows up under ifconfig but it can no longer see the attached CAN network (on top of this the blue led light no longer turns on when it normally blinks whenever it detects a new message after proper init.)). Only a reboot seems to fix the CAN interface.

Already tried adding denyinterfaces can0 to dhcpcd.conf

Example scenarios:

  1. Pi boots with no wifi -> 60s later loses CAN communication
  2. Pi boots with wifi -> more than 10min later still holds CAN communication
  3. Pi boots with wifi -> 5 mins later drops wifi connection -> 60s later loses CAN communication
  • if the wifi connection is (re-)established once CAN is lost, is CAN re-established too? Sep 15 '19 at 11:02
  • Unfortunately no
    – rCtoOL
    Sep 15 '19 at 11:07
  • What operating system do you use? Please take note that using /etc/rc.local has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from systemd you should avoid using it.
    – Ingo
    Sep 15 '19 at 12:00
  • Running the latest version of buster lite. Even removing code from rc.local and init socketcan using hotplug in network/interfaces causes the same issue
    – rCtoOL
    Sep 15 '19 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.