From ec0fdf6a927f88f5b8f58695fce73be35ae57be8 Mon Sep 17 00:00:00 2001 From: JP Meijers Date: Tue, 28 Feb 2017 01:16:26 +0100 Subject: [PATCH] Update run.py Fix gateway MAC to EUI conversion. --- run.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index 798de8b..33eca97 100755 --- a/run.py +++ b/run.py @@ -60,7 +60,9 @@ if os.environ.get("GW_KEY")==None: print ("See https://www.thethingsnetwork.org/docs/gateways/registration.html#via-gateway-connector") sys.exit(0) -my_eui = GWID_PREFIX + format(uuid.getnode(), '012x') +# The FFFE should be inserted in the middle (so xxxxxxFFFExxxxxx) +my_eui = format(uuid.getnode(), '012x') +my_eui = my_eui[:6]+GWID_PREFIX+my_eui[6:] my_eui = my_eui.upper() print ("Gateway Type:\t"+os.environ.get("GW_TYPE")) @@ -269,4 +271,4 @@ while True: # Start forwarder subprocess.call(["./mp_pkt_fwd"]) - time.sleep(15) \ No newline at end of file + time.sleep(15)