Using FiPy Nano-Gateway as node to send data to The Things Network
I would like to use FiPy Lorawan-Nano-Gateway with LiPo battery and solar panel. Presumably LTE connection takes more power than solar can charge during a day time (especially in the winter), so the gateway should be put to deep sleep for most of the time. In order to know how much time the gateway can be awake I need to know the battery voltage.
I set up lorawan-nano-gateway (currently using wify) that forwards data from node. In main.py I use
and in another file use:
py = Pytrack() def th_func() while True: batt = py.read_battery_voltage() print (str(batt) + " V") s = socket.socket(socket.AF_INET, socket.SOCK_RAW) a = socket.getaddrinfo(config.SERVER, config.PORT)[-1] try: s.connect(a) except OSError as e: raise e packet = ustruct.pack('f', batt) s.send(packet)
As such it gives no errors, but there appear no messages in The Things Network application. This device is added to the application, but I don't know where to use Application EUI and App Key. How should I authenticate?