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

Primary GPS data source #4

Open ivogeorg opened 3 years ago

ivogeorg commented 3 years ago

Description

This primary GPS data source on the RPi is a u-blox M8 module. We have a choice of 2:

  1. MAX-M8Q GNSS HAT.
  2. BerryGPS IMU V4.

Both are available on I2C.

There is a secondary location data from the Iridium RockBLOCK (See #6), but it has low resolution (several km).

Knowledge

  1. MAX-M8Q device page: https://www.waveshare.com/max-m8q-gnss-hat.htm
  2. Vendor wiki: https://www.waveshare.com/wiki/MAX-M8Q_GNSS_HAT (resources)
  3. ublox u-center: https://www.u-blox.com/en/product/u-center
  4. BerryGPS product page: https://ozzmaker.com/product/berrygps-imu/.
  5. BerryGPS quick start guide: https://ozzmaker.com/berrygps-berrygps-imu-quick-start-guide/.
  6. u-blox M8 receiver and protocol specs: https://www.u-blox.com/sites/default/files/products/documents/u-blox8-M8_ReceiverDescrProtSpec_UBX-13003221.pdf

Deliverables

  1. Python device driver package.
  2. For Flight-mode management, see #12.
ivogeorg commented 3 years ago

No luck with u-center on Windows work laptop. Could not find driver for USB-to-UART bridge.

Connects fine with RPi 4 with jumpers connected in the B configuration, as shown:

The coordinate_converter demo works fine outdoors.

ccason1 commented 2 years ago

Got an error when running the example code from balloonsat/gps/python/RaspberryPi/coordinate_converter/main.py.

GPSDSocket.connect exception is--> [Errno 111] Connection refused
AGPS3 connection to a gpsd at '127.0.0.1' on port '2947' failed

AGPS3 send command fail with [Errno 32] Broken pipe
gps device make wgs84 coordinate
gcj02 coordinate is for amap or google map
bd09 coordinate is for baidu map
 Please press Ctrl+c if want to exit 
Traceback (most recent call last):
  File "/home/pi/Code/balloonsat/gps/python/RaspberryPi/coordinate_converter/main.py", line 18, in <module>
    for new_data in gps_socket:
  File "/home/pi/.local/lib/python3.9/site-packages/gps3/agps3.py", line 119, in next
    self.response = gpsd_response.readline()
  File "/usr/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
OSError: [Errno 107] Transport endpoint is not connected

I ran the command: sudo systemctl start gpsd based on the advice from this forum: https://forums.raspberrypi.com/viewtopic.php?t=269100

and it fixed the issue. This means that gpsd was not active by default on my RPi. Just a heads up for anyone else having this issue.

Here's a link for helpful information about managing services like this: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

ivogeorg commented 2 years ago

Got an error when running the example code from balloonsat/gps/python/RaspberryPi/coordinate_converter/main.py.

GPSDSocket.connect exception is--> [Errno 111] Connection refused
AGPS3 connection to a gpsd at '127.0.0.1' on port '2947' failed

AGPS3 send command fail with [Errno 32] Broken pipe
gps device make wgs84 coordinate
gcj02 coordinate is for amap or google map
bd09 coordinate is for baidu map
 Please press Ctrl+c if want to exit 
Traceback (most recent call last):
  File "/home/pi/Code/balloonsat/gps/python/RaspberryPi/coordinate_converter/main.py", line 18, in <module>
    for new_data in gps_socket:
  File "/home/pi/.local/lib/python3.9/site-packages/gps3/agps3.py", line 119, in next
    self.response = gpsd_response.readline()
  File "/usr/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
OSError: [Errno 107] Transport endpoint is not connected

I ran the command: sudo systemctl start gpsd based on the advice from this forum: https://forums.raspberrypi.com/viewtopic.php?t=269100

and it fixed the issue. This means that gpsd was not active by default on my RPi. Just a heads up for anyone else having this issue.

Here's a link for helpful information about managing services like this: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

@ccason1 Did you get your own MAX-M8Q receiver? Otherwise, I would surprised that you can get anything to run, since it looks like you left the receiver at the office.

ccason1 commented 2 years ago

@ivogeorg Yes, I got my own. I'm getting a power bank today so that I can test it outside (although if the clouds block the signal then I'll have to wait until tomorrow).

ivogeorg commented 2 years ago

Great! I was wondering... :D

GPS signals are not as affected by atmospheric weather conditions. You should be fine testing it even today, though the rest of the week will be all clear, too.

ccason1 commented 2 years ago

I got u-center working. Here's the steps I took:

  1. set up a remote connection with the receiver through the Raspberry Pi. Link: https://ozzmaker.com/using-u-center-to-connect-to-a-raspberry-pi-with-an-attached-berrygps-imu-gsm/

  2. download and install the driver from the u-blox website. Driver: u-blox GNSS Standard Driver for Windows, v1.2.0.8 Link: https://www.u-blox.com/en/product-resources/property_file_product_filter/2779

  3. if it doesn't work right away, close the u-center window and open it up again.

ivogeorg commented 2 years ago

@ccason1, the problem with u-center was that my university-issued laptop wouldn't not pull the driver.

In any case, u-center is not a priority.