I am working on a dronekit
follow_me project. So in one terminal, I am running python follow_me.py
and in another terminal running run-fake-gps.sh
. Then an error appears as below:
Sending fake GPS data
Processing fake-gps-data.log
gpsd:ERROR: can't bind to IPv4 port 2947, Address already in use
gpsd:ERROR: maybe gpsd is already running!
gpsd:ERROR: can't bind to IPv6 port 2947, Address already in use
gpsd:ERROR: maybe gpsd is already running!
Maybe these errors are causing my follow_me.py
to stop before ending.
To stop the process I ran
start-stop-daemon -K --name gpsd
When I ran sudo netstat -ntlp | grep 2947
I got below:
tcp 0 0 127.0.0.1:2947 0.0.0.0:* LISTEN 1/init
tcp6 0 0 ::1:2947 :::* LISTEN 1/init
While running python follow_me.py it automatically connects to
Connecting to vehicle on: tcp:127.0.0.1:5760
I did run in a new terminal
sudo netstat -ntlp | grep LISTEN
The output appears as follows:
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 1775/dnsmasq
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 832/cupsd
tcp 0 0 0.0.0.0:5760 0.0.0.0:* LISTEN 15355/apm
tcp 0 0 0.0.0.0:5762 0.0.0.0:* LISTEN 15355/apm
tcp 0 0 0.0.0.0:5763 0.0.0.0:* LISTEN 15355/apm
tcp 0 0 127.0.0.1:2947 0.0.0.0:* LISTEN 1/init
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 836/mongod
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 998/mysqld
tcp6 0 0 :::80 :::* LISTEN 1197/apache2
tcp6 0 0 :::21 :::* LISTEN 961/vsftpd
tcp6 0 0 ::1:631 :::* LISTEN 832/cupsd
tcp6 0 0 ::1:2947 :::* LISTEN 1/init
What could be the problem and how can I fix it?
run-fake-gps.sh
script. If the problem happens again, collect the complete outpur ofsudo netstat -tulpn | grep 2947
. Then edit your question to include that output.