01_System Setting - adioshun/Project_ADWISE GitHub Wiki

1. Ubuntu install

2. ROS install

3. miniconda: python 2.7 32bit

4. OpenCv

  • sudo apt-get install python-opencv
  • sudo pip install imutils

5. Tensorflow For Python 2.7 Link

6. IDE

  • sudo pip install jupyter Link
  • jupyter notebook --allow-root

7. AP Mode

apt-get install dnsmasq hostapd
vi /etc/dhcpcd.conf 
vi /etc/network/interfaces
service dhcpd restart
service dhcpcd restart
ifdown wlan0
ifup wlan0
vi /etc/hostapd/hostapd.conf 
/usr/sbin/hostapd /etc/hostapd/hostapd.conf # add to `/etc/rc.local` for start-up service

8. OBD2 Connection

INSTALL THE SUPPORTING BLUETOOTH SOFTWARE:

apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
# OR apt-get install glib2.0 libdbus-1-dev  libudev-dev
sudo apt-get install bluetooth blueman 

bluez installation

cd ~
wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.37.tar.xz
tar xvf bluez-5.37.tar.xz
./bluez-5.37/configure
make
make install

https://learn.adafruit.com/install-bluez-on-the-raspberry-pi/installation

DETECT THE DEVICE - BLUETOOTH

lsusb #find OBD Address eg. 0a5c:2101 
lsusb -v -d 0a5c:2101 # show detailed infor.
dmesg | tail # check kernel msg eg. `Bluetooth: RFCOMM TTY layer initialized`

LINKING the COMM PORT: SYMBOLIC vs HARD

ls -l /dev/ttyS*
ls -l /dev/rf*
sudo chmod 766 /dev/rfcomm0
sudo rm /dev/ttyS3
sudo ln /dev/rfcomm0 /dev/ttyS3
sudo chmod 766 /dev/ttyS3

9. OBD Programming (/w Python)

import obd #pip install obd
connection = obd.OBD() # auto-connects to USB or RF port
cmd = obd.commands.SPEED # select an OBD command (sensor)
response = connection.query(cmd) # send the command, and parse the response
print(response.value) # returns unit-bearing values thanks to Pint
print(response.value.to("mph")) # user-friendly unit conversions

ref

⚠️ **GitHub.com Fallback** ⚠️