Send Sensor data using to server using LoRa



  • Hello Team,

    Can anyone help me with sending the sensor data from (Ex. using FiPy & Pysense ) to server using LoRa. Node should send the sensor data to gateway, where gateway is connected to our local pc / internet from where i should be able to send the data to server. I have tried with setting up one node & one gateway and tried with the code provided in the documentation but not getting the output.

    I have setup, Node side using pysene with fipy so that it can send sensor data to gateway, gateway side again used fipy with expansion borad.

    Kindly help me with this.

    Thank You



  • @jmarcelino
    Am getting the error at gateway side. Error message with line number is as below
    Traceback (most recent call last):
    File "<stdin>", line 47, in <module>
    TypeError: unsupported types for add: 'str', 'bytes'

    Gateway code is attached also node side code is attached. And also please let me know whether i have used correct method to send data to server in the gateway code, using below lines of code

    response = urequests.get("http://localhost/ksn/server.php?data=" + msg)
    response.close()

    1_1523684617338_node.py 0_1523684617338_gateway.py



  • @nazz said in Send Sensor data using to server using LoRa:

    unsupported types for add: 'str', 'bytes'"

    Can you post the full error message including line number and where is the error is it on the node or gateway? It'll then be easier to help you.

    Sounds like a very straightforward error where you are trying to add something which is not a string to a string, so look closer at code locations where you do those concatenations.



  • @jmarcelino

    Hello, Am using attached two codes at node side and gateway side. but at the gateway side am getting an below error.
    "TypeError: unsupported types for add: 'str', 'bytes'"

    Please reply as soon as possible.

    1_1523608147214_node.py 0_1523608147184_gateway.py



  • @jmarcelino

    Thank you for your response, basically from India. Am using the code from following link

    https://docs.pycom.io/chapter/tutorials/lora/lora-mac-nano-gateway.html

    And about the gateway i did not setup in TTN. I have just connected 1-FiPy with lora antenna to one computer as considering as node and running node code in that , & 1-FiPy with lora antenna to other computer considering as gateway and running gateway code in that. And am able to receive data from node to gateway(i,e one computer to other).

    We have our server hosted and mongo db installed, now i wanted to send the data received at gateway from node to the mongo db.

    Thank You



  • Hi @nazz,

    Where are you based? It helps to know your LoRaWAN region and also exactly which code you are using (there are different versions for different regions)

    Also can you describe your gateway setup a bit better. Where is your gateway connected to, is it The Things Network? Do you see the gateway online there?



Pycom on Twitter