I am attempting the following setup:

Sensor--> I2C--> Pycom LoPy4(Node)-->LoRa-RAW-->Pycom LoPy4(Nano Gateway)-->RPi-->AWS

I have established the LoRa RAW connection between the two LoPy4s, now I want to know how to connect the LoPy4 (Nano-Gateway) to the Rpi and send the data received by the gateway to Rpi and then to AWS.

One possible solution that I can think of is: A serial connection between LoPy4 module and Rpi and then save the data in to CSV and then send it to AWS.

I cannot find any specific code/libraries/example to use LoRa-RAW with other device like RPi or sending data to AWS. All examples are using LoRaWAN.

The question that I specifically want answer to is : Is there a limitation in using the the LoRa-RAW protocol when sending the data from gateway upto the cloud?

  • Is there a specific reason you need/want to go through the RPi rather than send directly from the LoPy4 to AWS?
    – jcaron
    Oct 22, 2019 at 8:14
  • I need to go through Rpi because sending data directly from LoPy4 to AWS would need me to use LoRaWAN and the whole connection needs a network server like The Things Network(TTN). TTN has a FUP which does not allow me to send messages as frequently as I need. I need to send messages every 5 minutes which is not in alignment with their FUP so I want to send the data to Rpi first and then to AWS.
    – Yash Deep
    Oct 22, 2019 at 10:36
  • You seem to have a fundamental misunderstanding of how things work. If you can send data from your RPi, you can nearly certainly send it directly from the LoPy4, it has full http and https support. Whether you use LoRaWAN or raw LoRa or even BLE doesn’t affect what you do with the data, just possibly where it happens. You could also use LoRaWAN and your own network server instead of TTN. Also you may want to try to understand the reasons behind the fair use policy, as they are linked to inherent limits of LoRa.
    – jcaron
    Oct 22, 2019 at 11:49
  • I do know that I can send the data directly to the cloud but then it would use LoRaWAN on the LoPy4 instead of LoRa RAW which again restricts me for message frequency. Also, I checked that the limits of LoRa an the Things Network are different. It is possible to send much more number of messages per hour as per LoRa protocol as compared to the Things Network.
    – Yash Deep
    Oct 25, 2019 at 13:52

1 Answer 1


The most obvious way to do this is actually to send the data directly from the LoPy4 to the cloud: the LoPy4 has built-in TCP/IP capabilities, and can do HTTP and HTTPS, and there are libraries for lots of higher-level protocols built on that, as well as MQTT. In the vast majority of cases, if the RPi can do it, the LoPy4 should be able to do it as well.

If you use raw LoRa, it's just a matter of adding the relevant code to send the data to the cloud whenever you receive a packet.

If you use LoRaWAN, then the responsibility will lie with the network server (LNS). Most can send via a variety of protocols, including MQTT or HTTP(s).

If you really want to go through a RPi for some reason (the only one I could think of is that you would need an Ethernet connection, rather than WiFi), then there are many options for this, including simply configuring the RPi as an internet gateway/router (possibly with NAT), using a proxy on the RPi (depends on the actual protocol you use), or writing your own script to relay the data from the LoPy4 to the cloud.

The connection between the LoPy4 and the RPi could be done using WiFi (only option for the first two options above), BLE, serial, and probably quite a few more.

Note that the ESP32 itself can actually do Ethernet as well. Pycom products (other than the upcoming LoRaWAN gateway) don't use this capability, but other ESP32-based products do (including some with PoE), though I'm not sure I know of any ready-made ESP32-based devices with both LoRa and Ethernet.

  • Thank you! Sorry for getting back here late. I actually got the whole system up and running as I intended to. I used the USB serial connection from lopy4 to RPi. The data from the serial port can then be read on the RPi and sent to the cloud. It solves my problem of message frequency as The Things Network allows approximately 30 seconds of Time on Air per day as opposed to the LoRa duty cycle which allows 36 seconds per hour. Just writing this out loud if anyone else comes looking for it in the future. Thank you again, jcaron!
    – Yash Deep
    Nov 14, 2019 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.