This repository has been archived by the owner on Sep 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRPI_Setup.txt
98 lines (93 loc) · 2.94 KB
/
RPI_Setup.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
1. Setup RPI SD:
- Flash Image
- Setup WIFI:
/etc/wpa_supplicant/wpa_supplicant.conf :
Add following block with ssid and psk generated from wpa_passphrase command:
network={
ssid="ssid"
psk= #psk="" or wpa_passphrase ssid
}
- Enable ssh
touch "ssh" in boot partition
2. Enter SD to RPI:
- Connect to RPI with "ssh [email protected]" and default password raspberry
- Change password with "passwd"
- Enable USB Serial
boot config.txt : add at end: # For USB Serial
dtoverlay=dwc2
enable_uart=0 # CHANGED FROM 1
boot cmdline.txt : add after rootwait:
modules-load=dwc2,g_serial
- With "sudo raspi-config":
raspi-config/Networking/Hostname -> serialhmd
Not working: raspi-config/Interface/Serial -> Disable console, enable serial
TRY: raspi-config/Interface/Serial -> Disable console, disable serial
raspi-config/Interface/I2C -> enable
raspi-config/Interface/SPI -> enable
raspi-config/Interface/ssh -> enable
- Reboot/Shutdown
3. Setup SerialHMD
- Copy over files to "home/pi":
startup.sh
SerialHMDInterface.py
- Connect to RPI with "ssh [email protected]"
- Add startup entry to "etc/rc.local":
echo "Starting tmux session 'session'"
/usr/bin/tmux new-session -d -s session
/usr/bin/tmux set-option -t session set-remain-on-exit on
/usr/bin/tmux new-window -d -n 'startup' -t session:1 'cd /home/pi; sudo sh ./startup.sh'
OR
cd /home/pi
sudo sh ./startup.sh &
- sudo apt install python-serial
- USB Serial Port on RPi: /dev/ttyGS0
4. Setup RTIMULib2 /w MPU9250
- Clone RTIMULib2 with MPU9250 support from Nick-Currawong
- Follow instructions to verify I2C (check ports, change baudrate, i2cdetect adress 68, set i2c privileges)
sudo apt-get install i2c-tools
ls -l /dev/i2c-*
sudo i2cdetect -y 1
sudo nano /etc/udev/rules.d/90-i2c.rules
KERNEL=="i2c-[0-7]",MODE="0666"
sudo udevadm control --reload
- Install cmake: sudo apt install cmake
- Build RTIMULib2 core:
cd RTIMULib2-master/RTIMULib
mkdir build
cd build
cmake ..
make -j4
sudo make install
sudo ldconfig
- Build RTIMULib calibration + drive:
cd RTIMULib2-master/Linux
mkdir build
cd build
cmake -DBUILD_GL=OFF -DBUILD_DRIVE10=OFF -DBUILD_DRIVE11=OFF -DBUILD_DEMO=OFF ..
make -j4
sudo make install
sudo ldconfig
- Calibrate: cd home + sudo RTIMULibCal
- Test: RTIMULibDrive
- Change RTIMULib.ini to increase sample rate and increase precision
- Install python bindings
sudo apt install python-dev
cd RTIMULib2-master/Linux/python
python setup.py build
sudo python setup.py install
- Test python: cd tests + python Fusion.py
- Copy RTIMULib.ini file to working dir, call RTIMULibCal whenever needed
Some manually:
- Enable ssh
touch "ssh" in boot partition
- Change hostname:
/etc/hosts :
change "raspberrypi" at end to "rpihmd"
/etc/hostname :
change "raspberrypi" to "rpihmd"
- Enable USB Serial
boot config.txt : add at end: # For USB Serial
dtoverlay=dwc2
enable_uart=1
boot cmdline.txt : add after rootwait:
modules-load=dwc2,g_serial