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

    Lora<->Wifi Gateway and Threading

    Scheduled Pinned Locked Moved LoPy
    lora gatewaylora wifithreading
    1 Posts 1 Posters 841 Views 2 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.
    • S Offline
      spookyrufus
      last edited by

      Hello. Starting from one of the official examples on how to set up a LoRa Nano-Gateway I am now trying to extend it so, that the 'receiver' part is also connected to the Internet via WiFi, and is able to forward packets received through the LoRa side, to the Internet.
      Such forwarding happens through a HTTP POST reuquest towards an existing data-collection server.

      My question is the following: since each HTTP request likely would take a couple of seconds, and would 'block' the rest of the server code (and notably, the While loop which continuosly checks for received packets from LoRa), what would be a best-practice approach to implement such gateway?
      What I want to achieve is that each individual LoRa node forwards packets to the nano-gateway, and only after the HTTP POST towards the data-collection server has been successful, an ACK is sent back to the node. But of course at the same time the nano-gateway must be able to receive new incoming packets from other existing nodes.

      I was thinking such task could be rather easy perhaps spawning a thread on the nano-gateway each time that a valid LoRa packet is received, and handle the HTTP request within that thread, and only at each thread termination, an ACK can be sent back to the LoRa node, but I'm not quite sure if this would be a viable approach, on a limited hardware.

      I appreciate any form of input coming from more experienced people.

      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