Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Using FiPy Nano-Gateway as node to send data to The Things Network

    Scheduled Pinned Locked Moved MicroPython
    1 Posts 1 Posters 31 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      argo
      last edited by

      Hi,

      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
      _thread.start_new_thread(th_func())

      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)[0][-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?

      Thanks!

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post

      Pycom on Twitter

      Pycom