0

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?

1
  • Make sure you have stopped gpsd before running the run-fake-gps.sh script. If the problem happens again, collect the complete outpur of sudo netstat -tulpn | grep 2947. Then edit your question to include that output.
    – user535733
    Dec 7, 2018 at 12:23

1 Answer 1

0

If you use the command while you run python follow_me.py:

sudo netstat -ntlp | grep LISTEN

How can I see what ports are open on my machine?

Then you should see your python follow_me.py is using port 2947. You can solve this by using another port in one of both scripts.

2
  • 1
    Problem: gpsd-aware applications expect gpsd data to be on port 2947. There's no negotiation or backup for that port. Better to find out which application is blocking use of the port.
    – user535733
    Dec 7, 2018 at 12:37
  • Thanks, for all the answers. Still trying to solve the issues. I have edited the post with new output. Please have a look. Dec 7, 2018 at 16:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .