![]() Sudo ip link set can0 type can bitrate 500000 sudo ip link set can1 type can bitrate 500000 Using the settings from their wiki, I set the "/boot/config.txt" to dtparam=spi=onĭtoverlay=mcp2515-can1,oscillator=16000000,interrupt=25ĭtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23Īnd the configuration for the networks to sudo ifconfig can0 down sudo ifconfig can1 down I do not know if this is a trace for the root problem or just the next one with the Pi-CAN communication in general.įrom another Pi-Baker I borrowed a "Waveshare 2CAN-Shield" mcp251x spi0.0 can0: bus-offĪt this point I am unable to restart the IC (ifconfig can0 down\up) and send another message, as if it is blocked somehow. IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready Inet6 fe80::35dc:42ad:db6b:fec1 prefixlen 64 scopeid 0x20Įther b8:27:eb:4d:6c:1c txqueuelen 1000 (Ethernet)Īfter sending an extended frame the status message looks like $ cansend can0 $ dmesg | grep -i can IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes $ ifconfig eth0 mcp251x spi0.0 can0: MCP2515 successfully initialized. After a fresh reboot the SPI status is $ dmesg | grep -i can Gives a little more insight into the status. I found additional commands to check the status for SPI and the connected IC in general. Changing the input levels of the receiver/ transceiver does not yield any results. This is because of an endless loop of trying to reach the network. Just freezes the command window and the Pi needs to be restarted. With this configuration the can0 network does exist (I defined it) but can not be brought up sudo ifconfig can0 up Since I am out of ideas I cut the backside of the module ( 5Vto3v3) and supplied the TJA1050 with 5V and the MCP2515 with 3V3. Also the SPI communication works with ICs that have this common input range. I do not understand why, since Vdd in the datasheet ranges 2.7-5.5V. In a few tutorials it is suggested, that the MCP2515 must be supplied with 3V3 rather than 5V. I am starting to doubt a consistent communication (similar to the stable Arduinos, STM, PICs and Labview-CAN cards I already used succesfully) with CAN is even possible with the current version of the OS. The few 'working' CAN networks consists of two Pis with the same build and setup. ![]() Has anyone encountered a similar behavior?ĮDIT_05.16: After a suggestion from the comments I added my CAN-Network and additional measurementĮDIT_05_17: Sadly there is a lot of conflicting information regarding CAN modules and Pi out there. When the message is not picked up does it 'circulate' until it is taken by something? (I would guess not, but something blocks the busline).ĭoes the Pi operate at another level, since the measured bus is +1V higher than the telegram I measure for the Arduino-busline?įor reference: Here is a telegram when only my Arduinos are communicating This may be due to the Tx-Error already on the chip and is probably a follow up error due to the faulty telegram. Only after the network is 'down' and 'up' again a new telegram can be sent. The I am unable to send another telegram over can0. The communication is stopped after a few tries. Measuring the bus using a oscilloscope (CH1:H-Gnd and CH2:L-Gnd) gives following result.Įven only one telegram is sent, the bus seems to be constantly loaded with some kind of signal. Something is sent over the CAN bus, but nothing that resembles a valid telegram. Send Can-Message (extended frame) cansend can0 10100208#FFFFFFFFFFFFFFFF Start network (with 500kHz) sudo ip link set can0 up type can bitrate 50000 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Install CAN-utils library sudo apt-get install can-utilsĬheck network status (ifconfig can0) can0: flags=193 mtu 16 I followed this tutorial to add and activate a CAN interface. The CAN transmission between the Arduinos is still valid The 'slave'-Arduinos receive the message and acknowledge it. Currently one Arduino constantly transmit a status message. The wiring looks like (according to this pinout) These two bussystems worked already with other ICs. SPI is enabled on the Raspi-config and I already used other cips using SPI and I2C. My network uses this shield (IC's: MCP2515 and TJA1050) In the future the Pi should act as a command center and data storage. I successfully have a running CAN-Network with 10 Unos\Nanos. I am currently trying to add my RPi-3B+ to my CAN-Network.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |