raxsix
March 21, 2018, 1:52pm
1
I have CAN Bus IoT Module installed and connected to CAN traffic generator. If I enter to the target module (WP7502) over the ssh and type ifconfig then I can see that CAN is working
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:6683 errors:0 dropped:0 overruns:0 frame:0
TX packets:373 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:53464 (52.2 KiB) TX bytes:2984 (2.9 KiB)
I need to filter out messages and send them to MQTT server
What is the simplest way to read and filter CAN messages?
Hello,
I use SocketCAN with Linux to manage CANBUS connection with the IoT CARD.
You can find source code on Google.
Socket CAN include filtering messaging.
It’s easy to implement.
Francis.
Look my reply on this topic :
Finally, saw the can0 line with ifconfig command after all those steps:
echo 2 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio2/direction
echo 1 > /sys/class/gpio/gpio2/value
// Enable level shifter on the CAN IoT card
echo 13 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio13/direction
echo 1 > /sys/class/gpio/gpio13/value
modprobe can
modprobe can-dev
modprobe can-raw
modprobe mcp251x
ip link set can0 type can bitrate 125000 triple-sampling on
ifconfig can0 up …