conCAN configuration with PICTORY

Topics about the Hardware of Revolution Pi
marcm
Posts: 8
Joined: 28 Jan 2025, 15:35

conCAN configuration with PICTORY

Post by marcm »

Hello everyone,

I am trying to connect and configurate a conCAN module with my RevPi Connect S and DIO expansion module. I have connected the conCAN on the right side of Connect S. The DIO is connected on the left sideo of Connect S.

However, when I am in Pictory and try to view "Value Editor" of conCAN I can only see "The grid is empty".
But when I try to view the "Value Editor" of Revpi Connect S or DIO expansion module, I can see and parametrize the values (without see any error).

I have conCAN activated in Revpi Status.

Also, when I try to check if the Can0 is available via SSH terminal I see that:

ip link show can0
Device "can0" does not exist.

sudo ip link set can0 up type can bitrate 250000
Cannot find device "can0"

ifconfig

Code: Select all

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.104  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::ca3e:a7ff:fe11:5bea  prefixlen 64  scopeid 0x20<link>
        ether c8:3e:a7:11:5b:ea  txqueuelen 1000  (Ethernet)
        RX packets 3607  bytes 974527 (951.6 KiB)
        RX errors 0  dropped 20  overruns 0  frame 0
        TX packets 4517  bytes 4214803 (4.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether c8:3e:a7:11:5b:eb  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<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 74  bytes 9010 (8.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 74  bytes 9010 (8.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

pileft: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether a2:82:fd:01:03:fd  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
        device interrupt 53[/quote]
What am I doing wrong? What could be my fault?

Thank you very much for your help!!
User avatar
nicolaiB
KUNBUS
Posts: 1014
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: conCAN configuration with PICTORY

Post by nicolaiB »

Looks like the driver for the ConCan module is not loaded. This should be enabled upon activation automatically, but lets check it. Please post the content of the file /boot/firmware/config.txt.

Nicolai
marcm
Posts: 8
Joined: 28 Jan 2025, 15:35

Re: conCAN configuration with PICTORY

Post by marcm »

nicolaiB wrote: 11 Feb 2025, 22:38 Looks like the driver for the ConCan module is not loaded. This should be enabled upon activation automatically, but lets check it. Please post the content of the file /boot/firmware/config.txt.

Nicolai
Hi Nicolai,

Thank you very much for your help.

I attach the content of:

ls /boot/

Code: Select all

bcm2708-rpi-b.dtb       bcm2710-rpi-3-b.dtb       bcm2711-rpi-cm4s.dtb     bcm2836-rpi-2-b.dtb       COPYING.linux  fixup_x.dat       start4x.elf
bcm2708-rpi-b-plus.dtb  bcm2710-rpi-3-b-plus.dtb  bcm2835-rpi-a.dtb        bcm2837-rpi-3-a-plus.dtb  dt-blob.bin    issue.txt         start_cd.elf
bcm2708-rpi-b-rev1.dtb  bcm2710-rpi-cm3.dtb       bcm2835-rpi-a-plus.dtb   bcm2837-rpi-3-b.dtb       fixup4cd.dat   kernel7.img       start_db.elf
bcm2708-rpi-cm.dtb      bcm2710-rpi-zero-2.dtb    bcm2835-rpi-b.dtb        bcm2837-rpi-3-b-plus.dtb  fixup4.dat     kernel7l.img      start.elf
bcm2708-rpi-zero.dtb    bcm2710-rpi-zero-2-w.dtb  bcm2835-rpi-b-plus.dtb   bcm2837-rpi-cm3-io3.dtb   fixup4db.dat   LICENCE.broadcom  start_x.elf
bcm2708-rpi-zero-w.dtb  bcm2711-rpi-400.dtb       bcm2835-rpi-b-rev2.dtb   bcm2837-rpi-zero-2-w.dtb  fixup4x.dat    overlays
bcm2709-rpi-2-b.dtb     bcm2711-rpi-4-b.dtb       bcm2835-rpi-cm1-io1.dtb  bootcode.bin              fixup_cd.dat   start4cd.elf
bcm2709-rpi-cm2.dtb     bcm2711-rpi-cm4.dtb       bcm2835-rpi-zero.dtb     cmdline.txt               fixup.dat      start4db.elf
bcm2710-rpi-2-b.dtb     bcm2711-rpi-cm4-io.dtb    bcm2835-rpi-zero-w.dtb   config.txt                fixup_db.dat   start4.elf
cat /boot/config.txt

Code: Select all

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
#max_framebuffers=2

[pi4]
[cm4s]
dtoverlay=dwc2,dr_mode=host

[all]
dtoverlay=dwc2,dr_mode=host
dtoverlay=revpi-connect
dtparam=eth0_mac_hi=0xc83ea711
dtparam=eth0_mac_lo=0x5bea
dtparam=eth1_mac_hi=0xc83ea711
dtparam=eth1_mac_lo=0x5beb
dtoverlay=revpi-con-can
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835
As you can see in the code above, I have tried to initialize the CAN:

Removing the # character from:

Code: Select all

 dtparam=spi=on 
and adding:

Code: Select all

dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835
But this has not work.

Thank you very much for your help!
User avatar
nicolaiB
KUNBUS
Posts: 1014
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: conCAN configuration with PICTORY

Post by nicolaiB »

Why did you manually add

Code: Select all

dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835
to the config.txt? This won't work with concan (different chip and also everything is already wrapped into the revpi-concan overlay). So please remove these lines and try again.

Nicolai
marcm
Posts: 8
Joined: 28 Jan 2025, 15:35

Re: conCAN configuration with PICTORY

Post by marcm »

nicolaiB wrote: 13 Feb 2025, 13:22 Why did you manually add

Code: Select all

dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835
to the config.txt? This won't work with concan (different chip and also everything is already wrapped into the revpi-concan overlay). So please remove these lines and try again.

Nicolai
Hello Nicolai,

Thank you for your reply.

Answering your question about why I added these lines was because at first I was not able to get the conCAN work and I thought that maybe this was a problem with the SPI.

However, I was wrong because I removed these lines as you say and now the conCAN works correctly and I receive messages through CAN.

Currently, through Pictory I can not configure the conCAN with the "Value Editor", because only the message "the grid is empty" appears.

But I can configure the CAN through SSH terminal with:

Code: Select all

sudo ip link set can0 up type can bitrate 250000
I guess this will not be a problem.

Thank you very much for your help!!!
User avatar
nicolaiB
KUNBUS
Posts: 1014
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: conCAN configuration with PICTORY

Post by nicolaiB »

Good to hear that the ConCan is now working. Your observation is correct, that there aren't any settings in PiCtory regarding the ConCan, so your approach with ip link is correct.

Nicolai
marcm
Posts: 8
Joined: 28 Jan 2025, 15:35

Re: conCAN configuration with PICTORY

Post by marcm »

nicolaiB wrote: 20 Feb 2025, 09:17 Good to hear that the ConCan is now working. Your observation is correct, that there aren't any settings in PiCtory regarding the ConCan, so your approach with ip link is correct.

Nicolai

Hello Nicolai,

I am reopening this thread because I recently upgraded my Revolution Pi Connect S image to bookworm (I was using bullseye-armhf) and now the conCAN module has stopped working.

Although with the old image I had the conCAN working correctly and I could receive the CAN messages, now with the same system but with the new image I have problems.

Before I took all the following data from my RevPi Connect S I configured via Cockpit --> Pictory the modules of the system (Connect S with the conCan on the right side.) And I saved the project and clicked on ‘reset drive’ in pictory.

The problem I have is that I can't read CAN messages with candump can0. I am sure that the CAN bus, the other CAN devices and the CAN connections are correct because it worked before and I didn't change anything about it (only the RevPi image).

Before I used candump can0 I used:
sudo ip link set can0 down
sudo ip link set can0 type can bitrate 500000
sudo ip link set can0 up

cat /etc/revpi/image-release

Code: Select all

250124-revpi-bookworm-arm64-default

lsmod | grep hi311x

Code: Select all

hi311x                 20480  0
can_dev                53248  1 hi311x

dmesg | grep -i can

Code: Select all

[    2.771484] CAN device driver interface
[    2.815996] hi3110 spi0.0 can0: 3110 successfully initialized.
[    6.463398] vc4-drm gpu: [drm] Cannot find any crtc or sizes
[    6.469602] vc4-drm gpu: [drm] Cannot find any crtc or sizes
[ 1873.194659] can: controller area network core
[ 1873.194730] NET: Registered PF_CAN protocol family
[ 1873.203848] can: raw protocol

apt list --installed pictory

Code: Select all

Listing... Done
pictory/bookworm,now 2.12.0-1+deb12+1 all [installed,automatic]
N: There are 18 additional versions. Please use the '-a' switch to see them.
pi@RevPi111847:~$ apt list -a pictory
Listing... Done
pictory/bookworm,now 2.12.0-1+deb12+1 all [installed,automatic]
pictory/bookworm 2.11.1-1+deb12+1 all
pictory/bookworm 2.11.0-1+deb12+1 all
pictory/bookworm 2.10.0-1+deb12+1 all
pictory/bookworm 2.9.0-1+deb12+1 all
pictory/bookworm 2.8.0-1+revpi12+1 all
pictory/bookworm 2.6.0-1+revpi12+2 all
pictory/bookworm 2.6.0-1+revpi12+1 all
pictory/bookworm 2.5.2-1+revpi12+1 all
pictory/bookworm 2.5.1-1+revpi12+1 all
pictory/bookworm 2.5.0-1+revpi12+1 all
pictory/bookworm 2.4.0-1+revpi12+1 all
pictory/bookworm 2.3.2-1+revpi12+1 all
pictory/bookworm 2.3.1-1+revpi12+1 all
pictory/bookworm 2.3.0-1+revpi12+1 all
pictory/bookworm 2.2.2-1+revpi12+1 all
pictory/bookworm 2.2.1-1+revpi12+1 all
pictory/bookworm 2.2.0-1+revpi12+1 all
pictory/bookworm 2.1.2-1+revpi12+1 all

ip link show

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether c8:3e:a7:11:5b:ea brd ff:ff:ff:ff:ff:ff
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether c8:3e:a7:11:5b:eb brd ff:ff:ff:ff:ff:ff
4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can
5: pileft: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether e2:b6:e9:60:b8:d7 brd ff:ff:ff:ff:ff:ff

piTest -d

Code: Select all

pi@RevPi111847:~$ piTest -d
Found 4 devices:

Address: 0 module type: 105 (0x69) RevPi Connect V1.0
Module is present
     input offset: 113 length: 6
    output offset: 119 length: 5

Address: 31 module type: 96 (0x60) RevPi DIO V1.5
Module is present
     input offset: 0 length: 70
    output offset: 70 length: 18

Address: 32 module type: 109 (0x6d) RevPi CON CAN V0.0
Module is present
     input offset: 0 length: 0
    output offset: 0 length: 0

Address: 64 module type: 24580 (0x6004) ModbusRTU Master Adapter V0.0
Module is present
     input offset: 124 length: 101
    output offset: 225 length: 73

/boot/firmware/config.txt

Code: Select all

# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Automatically load initramfs files, if found
auto_initramfs=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=1

# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

# Run as fast as firmware / board allows
arm_boost=1

[all]
dtoverlay=dwc2,dr_mode=host
dtoverlay=revpi-connect
dtparam=eth0_mac_hi=0xc83ea711
dtparam=eth0_mac_lo=0x5bea
dtparam=eth1_mac_hi=0xc83ea711
dtparam=eth1_mac_lo=0x5beb
dtoverlay=revpi-con-can

ip -details -statistics link show can0

Code: Select all

4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can  promiscuity 0  allmulti 0 minmtu 0 maxmtu 0
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
          bitrate 500000 sample-point 0.875
          tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1 brp 2
          hi3110: tseg1 2..16 tseg2 2..8 sjw 1..4 brp 1..64 brp_inc 1
          clock 16000000
          re-started bus-errors arbit-lost error-warn error-pass bus-off
          0          0          0          0          0          0         numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 parentbus spi parentdev spi0.0
    RX:  bytes packets errors dropped  missed   mcast
             0       0      0       0       0       0
    TX:  bytes packets errors dropped carrier collsns
             0       0      0       0       0       0
I have sent you all the data that I thought might be useful.

Thank you very much for your help.

Best regards,

Marc M.
User avatar
nicolaiB
KUNBUS
Posts: 1014
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: conCAN configuration with PICTORY

Post by nicolaiB »

Thanks for the detailed report. When I compare the data to the one you reported initially, I noticed that the baudrate differs (500000 vs 250000). Did you check that the baud matches on both ends?
marcm
Posts: 8
Joined: 28 Jan 2025, 15:35

Re: conCAN configuration with PICTORY

Post by marcm »

Hello Nicolai,

Yes, the baudrate is fine. I adjusted the baudrate from 250000 to 500000 for other system reasons (nothing related to Revpi).

And the baudrate change (and its validation) was done on all CAN devices in the system.

The problem I have must be for another reason I think. But I don't know what it could be...

Thank you very much for your help,

Marc
User avatar
nicolaiB
KUNBUS
Posts: 1014
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: conCAN configuration with PICTORY

Post by nicolaiB »

The setup looks correct from the data you habe provided and there aren't any open issues with ConCan and bookworm (at least I'm aware of). Can you please share a kernel log so I can check if there are any errors? Also please double check the wiring (there are a few of wrongly marked ConCan modules, which can lead to swapped CAN_H and CAN_L setups)
Post Reply