Raspberry Pi – couple of questions

Home Forums Forums Technical Support for the OzzMaker SARA-R5 LTE-M GPS + 10DOF Raspberry Pi – couple of questions

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #18420
    Jimbob17
    Participant

    Hi,

    I seem to have this HAT setup and working on my headless Pi4 for my telescope mount but there’s a couple of things I can’t quite work out,

    1. Restarting the Pi with shutdown -r now results in the mux connection disappearing on reboot. /dev/pts only has 0 (when I ssh in) and ptmx on the reboot. How can I fix this? The only way I have found to get the mux back is to power down everything, which isn’t ideal! The /tmp entries are there at reboot but show as red as the links can’t be reached. Do I need to delete these at shutdown?
    2. I’ve updated the python script for python 3 (couple of small changes like the print uses brackets now) but I would like it to be able to differentiate between when the SIM card is available and when it isn’t. To get the normal GPS working with no assistance, I need to add AT+UGIND=1 to the list of commands but this isn’t needed if the SIM is available and the AssistNow connection and download works. Can the Python script be changed to realise when the AT+UGIND=1 is needed? My python skills are non-existent … running the script when the SIM card isn’t in the HAT results in the normal GPS not working (I think)

    Thanks!

     

    Jimbob

    #18435
    Mark Williams
    Keymaster

    Hi JimBob

    1. You need to start gsmMuxd on every boot. You can use the rc.local to start it.
    You also need to shut it down or kill in when rebooting the Pi. This disables the mux on both the 5G modem and the Pi itself. a simple sudo killall gsmMuxd will do.
    We are working on a guide to create a systemd file to look after all this so it is automated

    2.Even if you try assist online and you dont have a SIM in, it should still work, it will just fail to download the data and rely on normal data it receives from the satellites in the sky. AT+UGIND=1 is only used to report results. This command AT+UGPS=1,1,71 can be used to stat with local aiding only.

    Mark --OzzMaker.com --

    #18436
    Jimbob17
    Participant

    Hmmm … interesting. I do have gsmMuxd starting via systemd and I assume it gets closed down as part of the shutdown (or reboot) process. My simple service file is attached and started before the python script and gpsd.

    I *think* I’ve managed to change the python script to check if the SIM is present to fix question 2 … just need to check it actually works. Its working correctly without the SIM card inserted and need to check it works with the SIM and downloads the AssistNow data.

    Thanks.

    #18575
    Jimbob17
    Participant

    I can see you have updated the mux setup pages to help fix the missing mux on reboot … not tried it yet but have yet another question about this board. I noticed the attached on the SparkFun guide linked here for a firmware issue with the PPS setup with the version 2.06 firmware – attached is an image of the relevant text. I assume this is an issue with your board too or has it been resolved? One of the main reason for buying this board was the A-GPS capability but I also need to use the PPS sync … if this is impossible then what can you do to resolve this?

    I purchased my board from PiHut in the UK and pretty sure they will augh if I try to return it now after the setup issues raised above.

    Thanks!

    #18578
    richardp
    Participant

    Regarding sparkfun’s guide, I think that may be related to the use the LED.

    We did test this in the past.. and I just tested now, it does work. The Pi can see the pin go high

    On a Pi 4 i connected the TP pin from the SARA-R5 to GPIO21 on the PI.
    I created a python script to see when this goes high;

    import RPi.GPIO as GPIO
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(21, GPIO.IN)
    while True:
            if GPIO.input(21):
                    print (" high!")

    I then configured the below commands on the SARA-R5

    AT+UTIMEIND=1
    AT+UTIME=1,1
    AT+UGPS=1,4,67

    The python script was able to see the pin go high every second.

    Richard --OzzMaker.com --

    #18583
    Jimbob17
    Participant

    Hi Richard,

    Phew! Thanks for putting my mind at rest. I guess I’ll be digging out the soldering iron to attach some pins then.

    #18597
    Jimbob17
    Participant

    This is definitely not working for me and the more I try to debug what is happening the more frustrating things become …

    As mentioned at the start I’m using the python script to setup the GPS but when I check this script against the commands in the web page there are things missing – should these be in the python script? An example is the AT+CGACT=1,1 command. I also have to amend this script for it to actually run – the main example is the print statements need to contained in brackets plus the ser.write line needs the command to be changed to command.encode(). The UBLOX AT commands document is a bit of a bible and wading through this while flicking between windows is not ideal!

    I now have nothing working … no gpsmon and the gsmmuxd seems to be as flaky as hell when using minicom or the device is just crashing … again, I can’t actually tell what is going on here. I have reverted to the python script on one of the GPS pages for this device and nothing.

    It feels like I need to reset the device back to it’s factory settings and start again or just give up completely and write off the cash I have spent on this device. Like I said, frustrating …

    Another thing I have noticed is there is no SHM entry for the GPS device like I see for cheaper GPS modules, usually I have chrony using the SHM for the GPS – is this normal?

    #18599
    Mark Williams
    Keymaster

    Hi, i am so sorry you are having issues.

    What web page are you getting the python script from? is it this one?

    Assisted GPS on OzzMaker SARA-R5 LTE-M GPS + 10DOF

    Mark --OzzMaker.com --

    #18609
    Jimbob17
    Participant

    Yes, that is the script I’m using. The only changes I’ve made is a check to see if the SIM card is present, if it’s not then don’t bother trying to set up the modem to download the AssistNow data because it’s a waste of time. The AT+UPSDA seems to take longer when there is no SIM card in the HAT.

    Problem I am seeing with the PPS commands is I cannot start the GPS with the AT+UGPS after I use the AT+UTIMEIND and AT+UTIME commands shown above. First I thought I might need the fully AT+UTIME command as 1,1,1,100 but this makes no difference whatsoever.

    This is the output of my python script,

    Oct 08 13:12:13 stellarmate systemd[1]: Started Python script for Ozzmaker GPS.
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: Command sent: b’AT+CFUN=0′
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: response b’OK\r\n’
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: Command sent: b’AT+CGDCONT=0,”IP”,”hologram”‘
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: response b’ERROR\r\n’
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: Command sent: b’AT+UTIMEIND=1′
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: response b’OK\r\n’
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: Command sent: b’AT+UTIME=1,1′
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: response b”
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: Command sent: b”
    Oct 08 13:12:26 stellarmate ozzmaker-gps.py[1153]: response b’OK\r\n\r\n+UUTIMEIND: 1,0,0,0\r\n\r\n+UUTIMEIND: 4,2,0,0\r\nAT+UGPS=1,4,71\r\r\nERROR\r\n’
    Oct 08 13:12:26 stellarmate systemd[1]: ozzmaker.service: Succeeded.

    It doesn’t seem to matter what I enter for the AT+UGPS command as all the combinations I’ve tried so far result in the ERROR message. Neither gpsd or cgps show any data coming from the ublox module via /dev/ttyGSM2. The uBlox AT commands bible seems to suggest the PPS pin needs to be setup before trying to use it and I think this is pre-configured already.

    Removing the UTIMEIND and UTIME commands results in a working GPS but no PPS sync. For the record, I have the PPS pin setup on the Raspberry Pi to use GPIO18 (previously used with my bog standard GPS modules) and have also tried to use GPIO21 from your example above.

    I haven’t tried to solder a blob on JP1 and everytime I want to try a change I have to power everything down and restart. What am I doing wrong? It seems the UUTIMEIND reply above is trying to use the LTE modem, do I need the time commands after I’ve started the GPS messages?

    #18679
    Jimbob17
    Participant

    Just picking this up again as it is still not working and I don’t particularly want to consign £60 (around AU$120) worth of kit to the dust bin …

    Brand new install on a Pi Zero using the lite image burnt to an SD card via the Raspberry Pi Imager software. I have gsmMuxd built and working and I have also soldered the jumper to power cycle the HAT on reboot. Still encountering the issues mentioned above – using the information from post 18578, I get this,

    Welcome to minicom 2.8

    OPTIONS: I18n
    Port /dev/ttyGSM0, 14:49:27

    Press CTRL-A Z for help on special keys

    AT
    OK
    AT+UTIMEIND=1
    OK
    AT+UTIME=1,1
    OK

    +UUTIMEIND: 1,0,0,0

    +UUTIMEIND: 4,2,0,0
    AT
    OK
    AT+UGPS=1,1,71
    ERROR

    Doesn’t matter if I use ttyGSM0 or ttyGSM1, I get the same error message plus it doesn’t matter what the AT+UGPS command is as nothing works and everything results in ERROR. It seems as soon as I use AT+UTIME then I cannot start the GPS module at all. Is this a super bad bug or just something out of sequence? Is there an email address for support as the forum doesn’t seem to be helping much to get PPS working on this HAT.

    Currently using my $5 u-blox module from AliExpress which surprisingly “just works” after I realised the interference from the USB3.0 connections on the Pi 4 were blocking the module / antenna – quick ferrite core suppressor added to the cable and it works.

    #18680
    Jimbob17
    Participant

    Just found this thread on the u-blox forums,

    https://portal.u-blox.com/s/question/0D52p0000CyE6wTCQS/cannot-get-time-pulse-output-on-sarar510m8s

    Seems to be pretty similar to the issues I’m seeing and thinking this module is badly flawed …

    #18681
    Mark Williams
    Keymaster

    It looks like the GPS cannot be used for PPS when the GPS is streaming to the Cellular module.

    I just tested with using LTE module as the source for time and it works

    AT+UTIME=1,2

    The only difference is that it is not as accurate, 500ns instead of 50ns

     

    Mark --OzzMaker.com --

    #18686
    Jimbob17
    Participant

    Hi Mark,

    Thanks for this. I’ve just tried using this via ttyGSM0 this morning and after an initial hiccup when I lost the mux connections the AT+UTIME=1,2 comes back with an OK but I still have no consistent pulse going into the raspberry pi from what I can see. I used the python code in this thread to check the pin I’m using (GPIO18) and it goes high a couple of times then pauses for a minute or two and then goes high. I think I’ll drop The Pi Hut a message and see what my options are as this isn’t providing what I need.

    For example, I’m looking for the time pulse information to go into gpsd (like most GPS modules provide) and at first glance this seems impossible.

    #18688
    Jimbob17
    Participant

    Small update, the gsmMuxd seems to crash or fail or something (I can’t tell because my Pi is running headless) after 2 hours and rebooting with the JP1 jumper fix does not bring it back (this is using the raspi-gpio commands on the mux setup page). No idea what is happening but a full power down for 5 mins or so fixes this. I do wonder about the quality of the u-blox firmware / implementation for this chip as it seems to be flaky as hell.

    One question I have asked the Pi Hut is, could I have a faulty HAT? Mark, I’m sure you’re not seeing the issues I am with the gsmMuxd software and general stability for this module …

    • This reply was modified 8 months, 1 week ago by Jimbob17.
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…