Skip to content

Commit

Permalink
Add gps baud rate options
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Jessop authored and Mark Jessop committed Nov 22, 2024
1 parent 21ea764 commit 1aacd2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions start_tx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ TXFREQ=443.500
# Allowed values are from 2 through 17 dBm.
TXPOWER=17

# GPS Port
# GPS Port and baud rate
# Note that we only support uBlox GPS units
# set this to none to disable GPS support
GPSPORT=/dev/ttyACM0
GPSBAUD=115200

# Image settings
# Image scaling - Scale the 'native' image resolution of the attached camera by this much
Expand Down Expand Up @@ -89,7 +90,7 @@ sleep 10
# --waitforlock 10 Wait for up to 10 minutes before timing out and continuing anyway
# --lockcount 60 Wait for 60 sequential valid 3D fixed before exiting (2 Hz update rate, so 60 -> 30 seconds)
# --locksats 6 Only consider a fix as valid if it has more than 6 SVs in use.
#python3 ublox.py --waitforlock 10 --lockcount 60 --locksats 6 $GPSPORT
#python3 ublox.py --waitforlock 10 --lockcount 60 --locksats 6 --baudrate $GPSBAUD $GPSPORT


# Start the main TX Script.
Expand Down Expand Up @@ -125,6 +126,7 @@ python3 tx_picamera2_gps.py \
--serial_port $SERIALPORT \
--tx_power $TXPOWER \
--gps $GPSPORT \
--gpsbaud $GPSBAUD \
--resize $TX_IMAGE_SCALING \
--whitebalance $WHITEBALANCE \
--exposure $EXPOSURE \
Expand Down
4 changes: 3 additions & 1 deletion tx/tx_picamera2_gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
parser = argparse.ArgumentParser()
parser.add_argument("callsign", default="N0CALL", help="Payload Callsign")
parser.add_argument("--gps", default="none", help="uBlox GPS Serial port. Defaults to /dev/ttyACM0")
parser.add_argument("--gpsbaud", default=115200, type=int, help="uBlox GPS Baud rate. (Default: 115200)")
parser.add_argument("--logo", default="none", help="Optional logo to overlay on image.")
parser.add_argument("--rfm98w", default=0, type=int, help="If set, configure a RFM98W on this SPI device number.")
parser.add_argument("--frequency", default=443.500, type=float, help="Transmit Frequency (MHz). (Default: 443.500 MHz)")
Expand Down Expand Up @@ -137,7 +138,8 @@ def handle_gps_data(gps_data):
try:
if args.gps.lower() != 'none':
gps = ublox.UBloxGPS(port=args.gps,
dynamic_model = ublox.DYNAMIC_MODEL_AIRBORNE1G,
dynamic_model = ublox.DYNAMIC_MODEL_AIRBORNE1G,
baudrate= args.gpsbaud,
update_rate_ms = 1000,
debug_ptr = tx.transmit_text_message,
callback = handle_gps_data,
Expand Down

0 comments on commit 1aacd2f

Please sign in to comment.