CAN/OBD Board

CAN/OBD board is development board with the feature of accessing it remotely.

  • Designed to interact with cloud by writing Python, C++ and Rust code.
  • Typical application is to write C++ code to receive CAN signals from vehicle's OBD port, decode/encode CAN signals and write Python code to interface with cloud and upload received CAN signals to cloud.
  • Debian 12 and Python 3.11 running environment.
  • Can be powered via a vehicle's OBD Port.
  • Remote access makes it easier to debug software when it is installed on a vehicle.
  • Our example source code is: https://github.com/usb7/CAN-demo-python

image.png

Hardware specification

  • Based on NanoPi Neo Air which is Allwinner H3 - quad-core ARM Cortext-A7 CPU, 512MB DDR3 RAM, 8GB eMMC, and 2.4GHz WiFi.
  • Runs our tinyDebian OS which is Debian 12.
  • CAN/OBD interface
  • Can be powered via a vehicle's OBD Port.

Configure WiFi and register CAN board

  • Please login www.usb7.net with your Google account before proceed. If you do not have Google account, please create one.
  • Connect CAN board via USB micro-B interface to macOS, Windows or Linux computer.
  • After 25 seconds CAN board finishes booting and red LED on NanoPi Neo Air lights, in computer browser input CAN board IP address 172.16.10.1 to access it.
  • Follow instructions in the browser and connect CAN board to WiFi. After 10 seconds, can see WiFi IP address and green LED on NanoPi Neo Air blinks (this indicates WiFi is connected).
  • Click "Go to register" button at the top right to register CAN board with www.usb7.net account.
  • After registration, can see CAN board as shown in below picture.

image.png

Quick test

  • As shown in above picture, click "Access" button to access CAN board.
    • login / password = usb7 / usb7
  • Your CAN board can be remotely accessed from anywhere in the world.
sudo apt update
sudo apt install can-utils
sudo ip link set can0 up type can bitrate 500000
sudo ip link set up can0
# send CAN signals to can0 interface, CAN ID is 123, data is DE AD BE EF
cansend can0 123#DEADBEEF
# receive CAN signals from can0 interface
candump can0
# write received CAN signals into log file
candump can0 -l logfile.log
# download file from CAN board
sz logfile.log
# upload file to CAN board
rz

CAN terminal resistor

# Connect pin1 and pin2 of H5 jumper to enable using on-board terminal resistor
# Connect pin2 and pin3 of H5 jumper to enable controlling terminal resistor by software
sudo gpioset gpiochip0 2=1 # enable terminal resistor
sudo gpioset gpiochip0 2=0 # disable terminal resistor

Reference

Detailed information about NanoPi Neo Air: https://wiki.friendlyelec.com/wiki/index.php/NanoPi_NEO_Air