To check if USB CAN bus is working, run
ifconfig -a
and verify that can0
appears in the list.
Do this by running the installation.sh file alternatively, you can manually run the below commands yourself
sudo apt-get install git
git clone https://github.com/ucsdarclab/arcsnake_v2.git
Install can utils:
sudo apt-get install can-utils
Install pip packages:
pip install pyinstrument
pip install numpy
pip install matplotlib
pip install python-can
cd inside of arcsnake directory run ''' python3 tests/test_sanity.py '''
- type sudo gedit ~/.bashrc in /home directory
- Insert this command near end of text file: ''' export PATH="$HOME/myeoh/Documents/GitHub/arcsnake_v2:$PATH" '''
- Run source ~/.bashrc
- save and verify by running echo $PATH in terminal
from os.path import dirname, realpath
import sys
arcsnake_v2_path = dirname(dirname(realpath(file)))
sys.path.append(arcsnake_v2_path)
- Navigate to https://www.arduino.cc/en/software
- Scroll down the page and download "Arduino IDE 2.0 RC". It is a much improved IDE than the old Arduino software
- Open up the humiditytest.ino file in the Arduino IDE(arcsnake_v2/ArduinoSensors/humidtytest)
- Make sure that the humidity sensor is wired up according to the pin declared in the Arduino sketch
- Locate drop down menu at the top of the IDE and ensure that your board is selected. The Longa board will show up as a Arduino Leonardo
- Press upload
- Open the Serial monitor with ctrl+shift+m
- Make sure baudrate of serial monitor is 9600
- If the correct readings are printing to the Serial monitor then everything is in order!
- Open the ArduinoSensors.ino file (arcsnake_v2/ArduinoSensors/ArduinoSensors)
- Upload
- Connect the CAN H and CAN L from the Longan board to the appropriate pins on the USB to CAN device
- Run the test_ArduinoSensors.py file
- If the correct numbers are printing on Python's terminal as well as Arduino's terminal then everything is good