CAN-bus read and filter


#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?


#2

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.


#3

Look my reply on this topic :