From dd71c64ab5ad69b9d0961fce3be3e46c331cad45 Mon Sep 17 00:00:00 2001 From: jpmeijers Date: Thu, 9 Mar 2017 01:33:25 +0100 Subject: [PATCH] Fix a bug, and better error message when querying account server. --- run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index 5676702..49fd38e 100755 --- a/run.py +++ b/run.py @@ -89,7 +89,7 @@ if(os.getenv('SERVER_TTN', True)): response = urllib2.urlopen(req, timeout=30) config_response = response.read() except urllib2.URLError as err: - print ("Unable to fetch configuration from TTN") + print ("Unable to fetch configuration from TTN. Are your GW_ID and GW_KEY correct?") sys.exit(0) # Parse config @@ -104,7 +104,7 @@ if(os.getenv('SERVER_TTN', True)): frequency_plan_url = ttn_config.get('frequency_plan_url', "https://account.thethingsnetwork.org/api/v2/frequency-plans/EU_863_870") if "router" in ttn_config: - router = ttn_config.['router'].get('mqtt_address', "router.dev.thethings.network:1883") + router = ttn_config['router'].get('mqtt_address', "router.dev.thethings.network:1883") router = router[:router.index(':')] #strip port from url, as this is added by mp_pkt_fwd else: router = "router.dev.thethings.network"