herrfrei / VeWsCan485

Victron VenusOs package for Waveshare RS485 CAN HAT (B)
5 stars 0 forks source link

RS485 not working #1

Open wasn-eu opened 1 year ago

wasn-eu commented 1 year ago

Hi

first thank you for your great work. But i have a problem that i could not use the rs485 because of a gpio conflict: `root@raspberrypi4:~# dmesg | grep -i '(can|spi)

[ 4.428624] pinctrl-bcm2835 fe200000.gpio: pin gpio19 already requested by fe200000.gpio; cannot claim for fe215080.spi
[ 4.443245] pinctrl-bcm2835 fe200000.gpio: error -EINVAL: pin-19 (fe215080.spi)
[ 4.463172] spi-bcm2835aux fe215080.spi: error -EINVAL: Error applying setting, reverse things back
[ 4.473534] spi-bcm2835aux: probe of fe215080.spi failed with error -22
[ 5.310065] CAN device driver interface
[ 5.355077] mcp251x spi0.0 can0: MCP2515 successfully initialized.
[ 20.178960] can: controller area network core
[ 20.407351] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 22.105419] can: raw protocol
`

I have the latest stable venus os large installation on a raspberry pi 4.

wasn-eu commented 1 year ago

as i can see the changes for digital input 4 are acitve:

digital_input_4 -> /sys/class/gpio/gpio22

but what else is now using gpio19?

wasn-eu commented 1 year ago

i had to comment this line out in the file /u-boot/config.txt dtoverlay=VenusGpioOverlay

than the /dev/ttySC0 and ttySC1 devices are created. but i get these errors:

`root@raspberrypi4:~# dmesg | grep spi

[ 2.780497] spi-bcm2835aux fe215080.spi: cs2 >= max 1 [ 2.780551] spi_master spi1: spi_device register error /soc/spi@7e215080/spidev@2 [ 2.780603] spi_master spi1: Failed to create SPI device for /soc/spi@7e215080/spidev@2 [ 2.780673] spi-bcm2835aux fe215080.spi: cs1 >= max 1 [ 2.780714] spi_master spi1: spi_device register error /soc/spi@7e215080/spidev@1 [ 2.780763] spi_master spi1: Failed to create SPI device for /soc/spi@7e215080/spidev@1 [ 2.780837] spi-bcm2835aux fe215080.spi: chipselect 0 already in use [ 2.780879] spi_master spi1: spi_device register error /soc/spi@7e215080/spidev@0 [ 2.780927] spi_master spi1: Failed to create SPI device for /soc/spi@7e215080/spidev@0 [ 3.543091] spi1.0: ttySC1 at I/O 0x1 (irq = 66, base_baud = 921600) is a SC16IS752 [ 3.626494] mcp251x spi0.0 can0: MCP2515 successfully initialized. `

herrfrei commented 9 months ago

Hi @wasn-eu ,

sorry for the long delay but I realized right now that there is an open issue. Did you find out where the problem results from (what overlay uses GPIO19)? I have no idea - my rpi 3 works without any problems.

Regards, herrfrei

herrfrei commented 9 months ago

Ah,

right now I saw the possible reason: Did you install https://github.com/kwindrem/RpiGpioSetup? This uses different GPIO pins (5 6 13 16 19 26) and MUST NOT be installed together with my addon!