Skip to content

Commit

Permalink
Merge pull request #714 from anarkiwi/gpsd
Browse files Browse the repository at this point in the history
handle gpsd non functional at boot.
  • Loading branch information
anarkiwi authored Jun 13, 2023
2 parents 9334ba5 + d723b97 commit 9b825ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gamutrf/mqtt_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ def connect(self):
self.mqttc = mqtt.Client()
self.mqttc.connect(self.mqtt_server)
self.mqttc.loop_start()
if self.gps_server:
gpsd.connect(host=self.gps_server, port=2947)

def get_heading(self):
try:
Expand All @@ -61,6 +59,8 @@ def add_gps(self, publish_args):
try:
if self.compass:
self.get_heading()
if gpsd.gpsd_stream is None:
gpsd.connect(host=self.gps_server, port=2947)
packet = gpsd.get_current()
publish_args.update(
{
Expand Down

0 comments on commit 9b825ef

Please sign in to comment.