Having trouble getting data

Forums Technical Support for BerryGPS and BerryGPS-IMU Having trouble getting data

Tagged: 

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #15879
    webtop
    Participant

    I'm using an RPi 3, trying to get data from GPS/IMU for work on a project. I believe everything is set up correctly, however when I run some of the code example and gps tools, I get incorrect or no values.

    I've attached a file of the output of all that is needed.

    One thing I noticed, is that even though I have the value in /etc/default/gpsd for the device set to /dev/serial0, when looking at gpspipe it shows zero devices.

    Thanks for any help, let me know if you need more info.

    Here is an example output of cat /dev/serial0:

    $GNRMC,235153.00,A,4528.32731,N,12250.20109,W,0.641,,110620,,,A*79
    
    $GNVTG,,T,,M,0.641,N,1.188,K,A*3E
    
    $GNGGA,235153.00,4528.32731,N,12250.20109,W,1,05,3.88,77.2,M,-21.3,M,,*4B
    
    $GNGSA,A,3,29,21,05,,,,,,,,,,9.09,3.88,8.22*1A
    
    $GNGSA,A,3,68,69,,,,,,,,,,,9.09,3.88,8.22*16
    
    $GPGSV,4,1,13,05,24,048,19,10,04,213,,13,20,090,,15,26,124,*72
    
    $GPGSV,4,2,13,16,20,318,,18,67,289,,20,34,213,12,21,41,275,20*7B
    
    $GPGSV,4,3,13,25,10,183,,26,37,284,09,29,62,123,28,46,37,189,*74
    
    $GPGSV,4,4,13,51,35,159,*44
    
    $GLGSV,3,1,09,68,34,040,19,69,55,115,12,70,16,176,,74,11,235,*65
    
    $GLGSV,3,2,09,75,25,290,,76,12,339,,83,16,094,,84,63,040,*64
    
    $GLGSV,3,3,09,85,34,307,*52
    
    $GNGLL,4528.32731,N,12250.20109,W,235153.00,A,A*67
    Attachments:
    1. output.txt
    #15881
    webtop
    Participant

    I also just added user gpsd to dialout group, after checking status of gpsd service and noticed it was failing with permission denied on /dev/serial0

    Restarted the service and the permission error went away, but even after reboot, no change in getting values from code.

     

    #15882
    webtop
    Participant

    Okay, this may be an issue:

    sudo systemctl status gpsd

    ● gpsd.service - GPS (Global Positioning System) Daemon

    Loaded: loaded (/lib/systemd/system/gpsd.service; disabled; vendor preset: enabled)

    Active: active (running) since Thu 2020-06-11 17:26:08 PDT; 1min 25s ago

    Process: 1528 ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES (code=exited, status=0/SUCCESS)

    Main PID: 1529 (gpsd)

    Tasks: 1 (limit: 2077)

    Memory: 388.0K

    CGroup: /system.slice/gpsd.service

    └─1529 /usr/sbin/gpsd /dev/serial0

    Jun 11 17:26:08 hab-pi-3 systemd[1]: Starting GPS (Global Positioning System) Daemon...

    Jun 11 17:26:08 hab-pi-3 systemd[1]: Started GPS (Global Positioning System) Daemon.

    Jun 11 17:26:55 hab-pi-3 gpsd[1529]: gpsd:ERROR: SER: device open of /dev/serial0 failed: Permission denied - retrying read-only

    Jun 11 17:26:55 hab-pi-3 gpsd[1529]: gpsd:ERROR: SER: read-only device open of /dev/serial0 failed: Permission denied

    Jun 11 17:26:55 hab-pi-3 gpsd[1529]: gpsd:ERROR: /dev/serial0: device activation failed.

    Jun 11 17:26:55 hab-pi-3 gpsd[1529]: gpsd:ERROR: /dev/serial0: activation failed, freeing device

     

    Then after running: sudo systemctl restart gpsd

    sudo systemctl status gpsd
    ● gpsd.service - GPS (Global Positioning System) Daemon
    Loaded: loaded (/lib/systemd/system/gpsd.service; disabled; vendor preset: enabled)
    Active: active (running) since Thu 2020-06-11 17:29:25 PDT; 6s ago
    Process: 1797 ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES (code=exited, status=0/SUCCESS)
    Main PID: 1798 (gpsd)
    Tasks: 1 (limit: 2077)
    Memory: 448.0K
    CGroup: /system.slice/gpsd.service
    └─1798 /usr/sbin/gpsd /dev/serial0

    Jun 11 17:29:25 hab-pi-3 systemd[1]: Starting GPS (Global Positioning System) Daemon...
    Jun 11 17:29:25 hab-pi-3 systemd[1]: Started GPS (Global Positioning System) Daemon.

    But then after a while, it goes back to the permission denied status

    #15884
    PeterP
    Participant

    thats strange.

    Whats the output of these commands?
    sudo gpsd -V
    ls -l /dev/serial*
    cat /etc/default/gpsd
    cat /lib/systemd/system/gpsd.socket

    stop gpsd and then see if this at least with this
    gpsmon /dev/serial0

    Peter --OzzMaker.com --

    #15886
    webtop
    Participant

    sudo gpsd -V

    gpsd: 3.17 (revision 3.17)

    ls -l /dev/serial*

    lrwxrwxrwx 1 root root 5 Jun 11 18:11 /dev/serial0 -> ttyS0
    lrwxrwxrwx 1 root root 7 Jun 11 18:11 /dev/serial1 -> ttyAMA0

    cat /etc/default/gpsd

    # Default settings for the gpsd init script and the hotplug wrapper.
    
    # Start the gpsd daemon automatically at boot time
    
    START_DAEMON="false"
    
    # Use USB hotplugging to add new USB devices automatically to the daemon
    
    USBAUTO="false"
    
    # Devices gpsd should collect to at boot time.
    
    # They need to be read/writeable, either by user gpsd or the group dialout.
    
    DEVICES="/dev/serial0"
    
    # Other options you want to pass to gpsd
    
    GPSD_OPTIONS=""

    cat /lib/systemd/system/gpsd.socket

    [Unit]
    
    Description=GPS (Global Positioning System) Daemon Sockets
    
    [Socket]
    
    ListenStream=/var/run/gpsd.sock
    
    ListenStream=[::1]:2947
    
    ListenStream=127.0.0.1:2947
    
    SocketMode=0600
    
    [Install]
    
    WantedBy=sockets.target

    I purposefully set START_DAEMON="false" while I was testing.

    I noticed something interesting though: if I run sudo gpsmon /dev/serial0 I do get the gpsmon output, and I do see results, but then after a few seconds it stops with "Error reading device", and then subsequent runs do not produce any output.

    I'm pretty versed in Linux, and work as a software engineer, so if I need to deep dive into anything I'm fine doing so.

    Thanks

    #15892
    webtop
    Participant

    Running: sudo gpsmon -D3 /dev/serial0

    gpsmon:INFO: startup at 2020-06-13T20:51:56.000Z (1592081516)

    gpsmon:INFO: SER: opening GPS data source type 2 at '/dev/serial0'

    gpsmon:INFO: SER: speed 9600, 8N1

    gpsmon:INFO: SER: speed 9600, 8O1

    gpsmon:INFO: SER: speed 9600, 8N1

    gpsmon:INFO: SER: speed 9600, 8N1

    gpsmon:INFO: SER: speed 9600, 8N1

    gpsmon:INFO: gpsd_activate(1): activated GPS (fd 3)

    gpsmon:INFO: KPPS:/dev/serial0 cannot set PPS line discipline Input/output error

    gpsmon:WARN: KPPS:/dev/serial0 kernel PPS unavailable, PPS accuracy will suffer

    gpsmon:WARN: PPS:/dev/serial0 die: no TIOMCIWAIT, nor RFC2783 CANWAIT

    Read error from device

    #15893
    webtop
    Participant

    Okay, final shot at getting help...

    I tried some troubleshooting with gpsd, and managed to get a valid result from gspmon.

    The problem is still, the screen stays up for a few seconds and then dies with: Error reading from device.

    Not sure what the error was or how I can find out, but I'll keep looking.

    #15894
    PeterP
    Participant

    Do you have anything lese using the serial0 device?
    whats the output of
    dmesg | grep tty

    sudo lsof /dev/serial0

    Peter --OzzMaker.com --

    #15897
    webtop
    Participant

    sudo lsof /dev/serial0

    COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    gpsd    403 gpsd    7u   CHR   4,64      0t0 1160 /dev/ttyS0

    dmesg | grep tty

    [    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=tty1 console=ttyS0,115200 root=PARTUUID=3182ef26-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
    [    0.000902] console [tty1] enabled
    [    0.932110] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2
    [    0.939617] console [ttyS0] disabled
    [    0.942576] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 31250000) is a 16550
    [    1.978964] console [ttyS0] enabled
    [    4.519258] systemd[1]: Created slice system-serial\x2dgetty.slice.
    [   14.525950] pps pps0: source "/dev/ttyS0" added
    [   15.565988] pps pps0: source "/dev/ttyS0" added

    Thanks for any help you can offer. I'm thinking this is a configuration/setup issue but I'm not sure from where. The reason I believe this is because when I run cat /dev/serial0 I get good output. I'd just rather not have to code for that.

    Thanks.

    #15898
    PeterP
    Participant

    This line shows that you still have the console enabled on the serial port.
    [ 1.978964] console [ttyS0] enabled

    Use sudo raspi-config to disable it as shown here

    Peter --OzzMaker.com --

    #15899
    webtop
    Participant

    Oh lordy! I was originally doing this inside of Docker containers, and at one point reimaged the device...and I didn't disabled the console afterwards.

    Thank you so much for your help.

    #15939
    joe-esi
    Participant

    BerryGPS-IMU and RealVNC

    I have discovered that if I run RealVNC on the RPi 3B+ it prevents me from seeing any GPS data on the serial port. Without VNC running the serial data is present.

    Any idea how to prevent VNC from halting the GPS data?

    Thanks

    #15940
    PeterP
    Participant

    I'm not sure about that one.
    do you still see data with cat /dev/serial0

    Peter --OzzMaker.com --

    #15947
    joe-esi
    Participant

    I am still working on the issue but there are some indications that my first 3B+ board may have hardware GPIO issues. Not sure why I was going around in circles all yesterday on this. Thanks for the reply.

    Joe

    #15962
    joe-esi
    Participant

    The GPS has been working OK now. Running berryIMU-simple.py produces data that changes with the board's orientation. But running bmp280.py reads all zero data for coefficients and pressure/temperature and terminates with a divide by zero error because of the bad data.

    Any suggestions?

    Joe

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop...