Jump to content

GPSD Problem


V3sth4cks153
 Share

Recommended Posts

Hi everyone !

So I recently bought myself a GlobalSat BU-353-S4 GPS reciever, to try wardriving/warwalking with the Mark V. I managed to make everything run fine by reseting the Pineapple, installing kismet-server and GPSD with OPKG, and customizing kismet.conf. To start GPSD up, I use this command:

gpsd -N -D5 /dev/ttyUSB0 -F /var/run/gpsd.soc

Then a LED started blinking on the GPS reciever, to show that everything is up and running. When I was done with my wardrive/warwalk, I simply powered off the Pineapple. The next day, when I powered the Pineapple back on, and ran the GPSD command, the LED on the reciever didn't blink (even after several minutes). The only way I found to make it all work again was to reset the Pineapple and then reinstalling everything, which is just too much pain to do everytime.

Am I missing something, like stopping GPSD before powering off ? Or is it just an error with GPSD ?

Thanks,

V3sth4cks153

Link to comment
Share on other sites

Okay, got unlazy. We're running a newcore based kismet, so we really don't need gpsd. It can read serial devices without it. Here is the default gps part of the kismet.conf file.

# Do we have a GPS?
gps=true
# Do we use a locally serial attached GPS, or use a gpsd server?
# (Pick only one)
gpstype=gpsd
# gpstype=serial
# What serial device do we look for the GPS on?
gpsdevice=/dev/rfcomm0
# Host:port that GPSD is running on.  This can be localhost OR remote!
gpshost=localhost:2947
# Do we lock the mode?  This overrides coordinates of lock "0", which will
# generate some bad information until you get a GPS lock, but it will
# fix problems with GPS units with broken NMEA that report lock 0
gpsmodelock=false
# Do we try to reconnect if we lose our link to the GPS, or do we just
# let it die and be disabled?
gpsreconnect=true

This is what you need to change. Basically the gpstype= and the gpsdevice= lines. Forgot you can't change text color with the code tags... Damn, now I can't add a comment under this last code block... You're still going to need to ssh into the pineapple to shutdown kismet_server properly. Just pulling the plug will corrupt the current database.

# Do we have a GPS?
gps=true
# Do we use a locally serial attached GPS, or use a gpsd server?
# (Pick only one)
# gpstype=gpsd
gpstype=serial
# What serial device do we look for the GPS on?
gpsdevice=/dev/ttyUSB0
# Host:port that GPSD is running on.  This can be localhost OR remote!
gpshost=localhost:2947
# Do we lock the mode?  This overrides coordinates of lock "0", which will
# generate some bad information until you get a GPS lock, but it will
# fix problems with GPS units with broken NMEA that report lock 0
gpsmodelock=false
# Do we try to reconnect if we lose our link to the GPS, or do we just
# let it die and be disabled?
gpsreconnect=true

Edited by barry99705
Link to comment
Share on other sites

Okay, got unlazy. We're running a newcore based kismet, so we really don't need gpsd. It can read serial devices without it. Here is the default gps part of the kismet.conf file.

# Do we have a GPS?
gps=true
# Do we use a locally serial attached GPS, or use a gpsd server?
# (Pick only one)
gpstype=gpsd
# gpstype=serial
# What serial device do we look for the GPS on?
gpsdevice=/dev/rfcomm0
# Host:port that GPSD is running on.  This can be localhost OR remote!
gpshost=localhost:2947
# Do we lock the mode?  This overrides coordinates of lock "0", which will
# generate some bad information until you get a GPS lock, but it will
# fix problems with GPS units with broken NMEA that report lock 0
gpsmodelock=false
# Do we try to reconnect if we lose our link to the GPS, or do we just
# let it die and be disabled?
gpsreconnect=true

This is what you need to change. Basically the gpstype= and the gpsdevice= lines. Forgot you can't change text color with the code tags... Damn, now I can't add a comment under this last code block... You're still going to need to ssh into the pineapple to shutdown kismet_server properly. Just pulling the plug will corrupt the current database.

# Do we have a GPS?
gps=true
# Do we use a locally serial attached GPS, or use a gpsd server?
# (Pick only one)
# gpstype=gpsd
gpstype=serial
# What serial device do we look for the GPS on?
gpsdevice=/dev/ttyUSB0
# Host:port that GPSD is running on.  This can be localhost OR remote!
gpshost=localhost:2947
# Do we lock the mode?  This overrides coordinates of lock "0", which will
# generate some bad information until you get a GPS lock, but it will
# fix problems with GPS units with broken NMEA that report lock 0
gpsmodelock=false
# Do we try to reconnect if we lose our link to the GPS, or do we just
# let it die and be disabled?
gpsreconnect=true

Thanks ! I'll try that too. Didn't really look that much into serial once I got GPSD working. You're right about not using GPSD: It just adds another thing that can fail... But do I just need to kill the process to shutdown kismet_server properly ? Or do I need to stay connected and do a ctrl+c to stop it ? (Sorry if I sound dumb, I'm pretty new at this )

Link to comment
Share on other sites

Ok so I've tested this a few times, and it seems like kismet_server doesn't fail cleanly if the power is cut. However, I found that if I ssh in and kill the service with this command:

kill -15 <pid>

kismet_server quits cleanly, and I can then cut the power.
Also, using the GPS in serial is perfect, and far easier that GPSD.
Thanks barry99705 and Sebkinne for your help !
Problem solved !

EDIT: Just came back from a test run, and it seems like I can't kill the process after sometime, even though I run the command... Any ideas why that might happen ?

Edited by V3sth4cks153
Link to comment
Share on other sites

From your ssh session issue the following command,

echo -e '\n!0 shutdown' | nc localhost 2501

If you want to get really fancy, do a "nano stop_kismet.sh" past the above, then save it. Chmod the stop_kismet.sh 755. Make this script on your sd card so it doesn't go away on pineapple updates. This way you can just run the stop_kismet.sh script so you don't have to remember the command.

Link to comment
Share on other sites

Damn, now I've done it....

nano start_kismet.sh

#!/bin/bash
kismet_server --daemonize

chmod 755 start_kismet.sh

ln -s /sd/kismet_logs/start_kismet.sh /sbin/start_kismet.sh <-- edit to point to where you made the script on your sd card!

nano stop_kismet.sh

#!/bin/bash
echo -e '\n!0 shutdown' | nc localhost 2501

chmod 755 stop_kismet.sh

ln -s /sd/kismet_logs/stop_kismet.sh /sbin/stop_kismet.sh <-- edit to point to where you made the script on your sd card!!

Now you can just ssh in, type start_kismet.sh and it will start kismet_server! Later you can ssh back in and type stop_kismet.sh and it will gracefully shut it down. Someone could probably make a couple buttons in the pineapple gui to fire off those scripts, but I don't know enough to do it, and ssh is fine for me.

Also don't forget to edit your kismet.conf to dump the log files to the correct location!!! Mine looks like this,

logtemplate=/sd/kismet_logs/%p%n-%D-%t-%i.%l
Edited by barry99705
Link to comment
Share on other sites

Damn, now I've done it....

nano start_kismet.sh

#!/bin/bash
kismet_server --daemonize

chmod 755 start_kismet.sh

ln -s /sd/kismet_logs/start_kismet.sh /sbin/start_kismet.sh <-- edit to point to where you made the script on your sd card!

nano stop_kismet.sh

#!/bin/bash
echo -e '\n!0 shutdown' | nc localhost 2501

chmod 755 stop_kismet.sh

ln -s /sd/kismet_logs/stop_kismet.sh /sbin/stop_kismet.sh <-- edit to point to where you made the script on your sd card!!

Now you can just ssh in, type start_kismet.sh and it will start kismet_server! Later you can ssh back in and type stop_kismet.sh and it will gracefully shut it down. Someone could probably make a couple buttons in the pineapple gui to fire off those scripts, but I don't know enough to do it, and ssh is fine for me.

Also don't forget to edit your kismet.conf to dump the log files to the correct location!!! Mine looks like this,

logtemplate=/sd/kismet_logs/%p%n-%D-%t-%i.%l

Works perfectly ! Thanks a lot ! :grin:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...