coloradocube / balloonsat

COTS balloonsat mission to test the RPi 4 with a battery UPS, a quad camarray, a GPS module, a RockBLOCK module, and a small number of Qwiic sensors
0 stars 5 forks source link

Read and log GPS receiver #50

Open ivogeorg opened 2 years ago

ivogeorg commented 2 years ago

Knowledge

  1. See #4
  2. Run Python coordinate converter example.
  3. Read & run Python settings example.
  4. Read, write in Python, and run code to set Flight Mode.
  5. Raspberry Pi setup guide.
  6. WiringPI is a PIN-based GPIO access library for the Raspberry Pi. It is not open-source and also deprecated since 2019. Instructions for the last public release can be found here. Originally inspired by an Arduino wiring library which seems to be deprecated and/or obsolete in its own right. Going forward, it should be abandoned for some newer and better supported open-source library for RPi GPIO access.
  7. The MAX-M8Q can be connected via the RPi HAT or over USB. For the USB connection, especially if this is not the only device connected via the USB, this post is very informative. It will shed light on seemingly clashing /dev/ttyUSB0 setup instructions. For example, the RockBLOCK library hardcodes /dev/ttyUSB0 and the MAX-M8Q setup instructions also hardcode it (though only as an option, as it is irrelevant when the device is on the HAT stack).
NotfatPrince commented 2 years ago

Setup instructions for the MAX-M8Q on the Raspberry Pi HAT

The setup instructions below are taken from here.

  1. Chek if wiringpi is installed:

    gpio -v
  2. If not, install the last public release as follows (link to post):

    mkdir tmp
    cd tmp
    wget https://project-downloads.drogon.net/wiringpi-latest.deb
    sudo dpkg -i wiringpi-latest.deb
    gpio -v
  3. Install Python libraries

    sudo apt-get update
    sudo apt-get install gpsd gpsd-clients gpsd-tools
    sudo pip3 install gps3

    gps3 on Pypi and Github.

    Old instructions, which are a bit strange (e.g. installing another GPIO access library RPi.GPIO):

    sudo apt-get update
    sudo pip install RPi.GPIO
    sudo apt-get install python-serial
    sudo apt-get install gpsd-tools  gpsd-clients 
    sudo -H pip3 install gps3

    Is sudo apt-get install python-serial needed here? Or has it been installed earlier?

  4. Configure gpsd

    # Open gpsd file
    sudo nano /etc/default/gpsd
    # Change the following lines in the file and save
    USBAUTO="false"
    DEVICES="/dev/ttyS0"
    GPSD_OPTIONS="/dev/ttyUSB0"
  5. Download demo code

    mkdir ~/Documents/MAX-XXX_GNSS_HAT_Code
    cd ~/Documents/MAX-XXX_GNSS_HAT_Code/
    wget https://www.waveshare.com/w/upload/0/0f/MAX-XXX_GNSS_HAT_Code.zip
    unzip MAX-XXX_GNSS_HAT_Code.zip
  6. Python example

    cd ~/Documents/MAX-XXX_GNSS_HAT_Code/RaspberryPi/python/coordinate_converter
    sudo python3 main.py
ivogeorg commented 2 years ago

Knowledge

  1. Adafruit gpsd guide.
  2. An oldish writeup.
  3. Slightly more recent forums.