Fixes to run.py

This commit is contained in:
jpmeijers 2017-02-26 18:35:46 +01:00
parent 47a64b4a08
commit a1ed75054c

6
run.py
View File

@ -4,7 +4,7 @@ Author: JP Meijers
Date: 2017-02-26 Date: 2017-02-26
Based on: https://github.com/rayozzie/ttn-resin-gateway-rpi/blob/master/run.sh Based on: https://github.com/rayozzie/ttn-resin-gateway-rpi/blob/master/run.sh
""" """
import os.environ import os
import os.path import os.path
import sys import sys
import urllib2 import urllib2
@ -146,12 +146,12 @@ gateway_conf['contact_email'] = os.getenv('GW_CONTACT_EMAIL', "")
gateway_conf['description'] = description gateway_conf['description'] = description
# Use hardware GPS # Use hardware GPS
if(os.getenv('GW_GPS', True): if(os.getenv('GW_GPS', True)):
gateway_conf['gps'] = True gateway_conf['gps'] = True
gateway_conf['fake_gps'] = False gateway_conf['fake_gps'] = False
gateway_conf['gps_tty_path'] = os.getenv('GW_GPS_PORT', "/dev/ttyAMA0") gateway_conf['gps_tty_path'] = os.getenv('GW_GPS_PORT', "/dev/ttyAMA0")
# Use fake GPS with coordinates from TTN # Use fake GPS with coordinates from TTN
if(os.getenv('GW_GPS', False) and latitude!=0 and longitude!=0)) if(os.getenv('GW_GPS', False) and latitude!=0 and longitude!=0):
gateway_conf['gps'] = True gateway_conf['gps'] = True
gateway_conf['fake_gps'] = True gateway_conf['fake_gps'] = True
gateway_conf['ref_latitude'] = latitude gateway_conf['ref_latitude'] = latitude