Startup & Logs
Ways to start DroneBridge modules & how to access logs generated by the started modules

Startup

All modules can be started manually but it is preferred to use start_db_modules.py script. On DroneBridge for Raspberry Pi the startup of modules is done by the start_db service. The source code sits inside the root directory of the repository. The service can be updated/registered using:
1
sudo cp /home/pi/DroneBridge/start_db /etc/init.d/start_db
2
sudo update-rc.d -f start_db remove
3
sudo update-rc.d start_db defaults
Copied!
The status of the DroneBridge modules can be checked using:
1
sudo /etc/init.d/start_db [status|start|stop]
Copied!
or:
1
service start_db [status|start|stop]
Copied!

Logs

Local logs when connected via ssh

Since it is a service, all logs will be written to the journal. The logs can be viewed using one of the following commands:
1
journalctl -u start_db.service [-f for real-time]
Copied!
1
systemctl | grep start_db | less
Copied!

Local logs when access via SD-card

All DroneBridge modules log to syslog. In /DroneBridge/log/db_modules.log are all relevant log entries.

Remote real-time logging

Connect via TCP to the Raspberry Pi on port 1605 and you will receive realtime syslog logs. Forward the messages to your favourite log viewer like Syslog Watcher. Or use the provided Python 3 script below to output directly to console.
1
import socket
2
from time import sleep
3
4
UDP_PORT_SYSLOG_SERVER = 1605
5
# Raspberry Pi IP when connected to GND station via WiFi: 192.168.2.1
6
7
if __name__ == '__main__':
8
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
9
reconnect = True
10
while reconnect:
11
try:
12
sock.connect(('IP-OF-RPi', UDP_PORT_SYSLOG_SERVER))
13
reconnect = False
14
except ConnectionRefusedError:
15
print("Retrying")
16
sleep(1)
17
18
while True:
19
try:
20
data = sock.recv(1024)
21
print(data.decode("utf-8"))
22
except KeyboardInterrupt:
23
break
24
socket.socket.close(sock)
Copied!
Last modified 1yr ago