啟動時自動執行
LXDE做法,桌面環境啟動時執行,修改 ~/.config/autostart/xxx.desktop
每個要啟動時執行的程序都要獨立寫成一個檔案。
藍牙4.0 BLE server, for iPhone 4S up
pi@raspberrypi:~ $ cat .config/autostart/bt40-ble-server.desktop
[Desktop Entry]
Exec=/usr/bin/sudo /usr/bin/node /home/pi/Bluetooth/Node/index.js
Type=Application
藍牙2.0 保持discoverable狀態
pi@raspberrypi:~ $ cat .config/autostart/bt20-keepdiscoverable.desktop
[Desktop Entry]
Exec=/usr/bin/sudo /usr/bin/python /home/pi/Bluetooth/Python/keepdiscoverable.py
Type=Application
藍牙2.0 spp server, for All Andriod
pi@raspberrypi:~ $ cat .config/autostart/bt20-spp-server.desktop
[Desktop Entry]
Exec=/usr/bin/sudo /home/pi/Bluetooth/spp/dist/Debug/GNU-Linux/spp
Type=Application
確認系統啟動時自動執行對應服務,檢查對應port是否啟動
netstat -ntulp | grep LISTEN
slarpi應用程式
pi@raspberrypi:~ $ cat .config/autostart/solarpi.desktop
[Desktop Entry]
Exec=/usr/bin/python3 /home/pi/solarpi/dev/main.py
Type=Application