-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
108 lines (75 loc) · 2.96 KB
/
notes.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
99
100
101
102
103
104
105
106
107
108
Username: pi
Password: d2Cq0zkISO
Linux setup:
# For ANT USB device, create file /etc/udev/rules.d/garmin-ant2.rules containing the following:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fcf", ATTRS{idProduct}=="1008", RUN+="/sbin/modprobe usbserial vendor=0x0fcf product=0x1008", MODE="0666", OWNER="pi", GROUP="root"
# To run camera & display from command line, use:
> /usr/bin/raspivid -t 0 -f --mode 5 -ex sports -fps 49 -w 1296 -h 730 --flush
# Allow Pi to be shutdown cleanly by connecting GPIO pin BCM 3 to ground.
# Not needed if detecting button press from Python code.
Add in /boot/config.txt:
dtoverlay=gpio-shutdown,debounce=1000
# To allow login over serial connection:
Add in /boot/config.txt:
enable_uart=1 # Enable serial communication to allow login via USB adapter
dtoverlay=disable-bt # This is needed to force primary UART (the one on GPIO) to be ttyAMA0/PL011
Then disable bluetooth with:
> sudo systemctl disable hciuart
> sudo systemctl disable bluetooth
# To disable Wi-Fi:
Add in /boot/config.txt:
dtoverlay=disable-wifi
# To create service:
> sudo mv bikemon.service /lib/systemd/system/
> sudo chmod 644 /lib/systemd/system/bikemon.service
> sudo systemctl daemon-reload
> sudo systemctl enable bikemon
Physical setup:
* Connect button to ground (pin 6) and GPIO 3 (pin 5) for shutdown.
Connect LED of button to GPIO 14 UART Transmit (pin 8) to have it light up when the Pi is on.
For serial communication using UART-to-USB Bridge:
* Black ground pin of the Bridge to Pin 6 (GND) of the RPi
* White RX Pin of the Bridge to Pin 8 (GPIO 14 / TXD) of the RPi
* Green TX Pin of the Bridge to Pin 10 (GPIO 15 / RXD) of the RPi
Settings:
Speed (baud): 115200 (set in device properties)
Data bits: 8
Stop bits: 1
Parity: None
Flow control: None
When connecting via PuTTY or MobaXterm, press Enter to get login prompt
Useful commands:
### To check status ###
> systemctl status bikemon
### To see standard out/err ###
> journalctl -u bikemon
### Mount and copy to USB ###
> lsblk -f (to find out what USB device name is)
> sudo mkdir /media/usb-drive (if folder does not already exist)
> sudo mount /dev/sda1 /media/usb-drive (assuming "sda1" is USB device)
> cp -r ~/Bicycle-Monitor/data /media/usb-drive
> sudo umount /media/usb-drive
### Check temperature of CPU ###
> vcgencmd measure_temp
or
> cat /sys/class/thermal/thermal_zone0/temp
### Check if GPS daemon is running ###
> sudo systemctl status gpsd.socket
### Test/debug GPS daemon ###
> sudo systemctl stop gpsd.socket
> sudo gpsd /dev/ttyUSB1 -F /var/run/gpsd.sock
> cgps
> sudo killall gpsd
### Test video display ###
(currently set as hdmi_group=1, hdmi_mode=16 in /boot/config.txt)
list supported modes:
> tvservice –m CEA
> tvservice –m DMT
show current state:
> tvservice -s
### Bluetooth ###
> sudo modprobe btusb
> service bluetooth status
> service hciuart status
### GPIO and other info (from gpiozero library) ###
> pinout