Creating a LORAWAN gatway from esp32

I am new to Lorawan and after research I found that TTN would be the choice which would help in my task. I want to create a loraWAN gateway from the sx1276 lora module.

  1. I want to ask if it is possible to make a single channel single node gateway using the esp32 and register it to TTN.
  2. Secondly If it is not possible what is the best choice of lora chip and the controller that would do it.
  3. Finally I would like to ask if esp32 would be able to perform that of task of gateway or not? I have seen implementation on rasperry pi but not on the esp32. Any special reason?
    Kindly guide me in these and help me to follow a better way as I can be wrong in the modules selection. I shall be thankful.

Simple answer NO!

LoRaWAN required a minimum of 8 channels support with options for concurrent demod of any of the supported SpreadingFactors (typically SF7-12 + potentially FSK) Think of it as a 48/49 option demoduator where min 8 are fully operational at any time and where overlapping received messages can be scheduled and handled. SX1276 - indeed any of the newer SX126x or prior generation SX127x devices are node only single channel/single SF at a time products. To create a LoRaWAN Gateway you need to pair the MCU with a full concentrator baseband device (SX130x) and the associated RF FE chip set. The MCU then also needs to be powerfull enought to run an effective, predicatable scheduler/os and to hand the running of an associated Packet Forwarder package.

Single channel LoRa devices can be used to create what some mistakenly (and misleadingly call) a LoRa Gateway (Note lack of WAN and support for L-A specification), these are perhaps better described as single channel media converters or single channel packet forwarders (SCPF). (And no a Dual Channel version doesnt cut it either!).

DO NOT ATTEMPT TO CONNECT SUCH A DEVICE TO TTN - YOU WILL BE IMPLEMENTING A FLAWED SOLUTION THAT ACTS AS A DOS TO YOURSELF AND OTHER TTN USERS IN RANGE…

This has been much discussed and answered on the TTN Forum over the years (use search)

Are you looking for the challenge of building something rather complicated or trying to save money?

As @Jeff-UK outlines above, unfortunately you are mistaken in believing that TTN would be the choice - as a community network you would be causing issues not only for yourself but also for all other users in radio range. And as you appear to be based at a university, this could potentially interfere with your colleagues learning & research.

But as a university maybe they have a gateway - there is nothing on the gateway maps but they may have kept it private. Or they may buy one for student & community use.

Hi,

I have looked at the forum for a couple of hours now and read through a lot of threads and haven’t seen anything about what I’m going to ask/question. Also note I am applying this Raspberry Pi.

You said the SX126 cannot be used as a gateway. From my understanding this module cannot be used as a gateway and it explicitly defines it. However, Wave Share also do another module and apparently it can be used as a gateway with a Raspberry Pi or PC.

Is it the SX1262 that cannot be used as a gateway so you have to use the SX130X? The SX130X is more expensive than I would like so I am trying to get a module that goes onto a Raspberry Pi and use the two as a gateway.

Do you have any information on this? I cannot find any information on the internet or via here for the HAT that claims it can be used as part of a gateway.

Regards
Ashley

@descartes @Jeff-UK Will I be able to create a gateway using the multiple channel lora modules and register it to TTN? Scondly Is it possible to do that using esp32 as it also has a wifi with it?I found many sites which have implemneted it on the raspberry pi but no information on esp32.
Also is the 8 channel a requirement of the TTN or all gateways needs to be of a minimum 8 channels? Kindly help me if it is possible and if you could share some resource that would be very kind.

It is a Lora Alliance requirement for LoRaWAN compliant gateways. Other network operators will impose the same requirement.

The SX130X is more expensive because it has (roughly) 48 times the capabilities of the SX1262. And those capabilities are required for a gateway.
Waveshare mentions a single channel gateway on their page, there is no such thing as a LoRaWAN compliant single channel gateway. Single channel solutions do not meet the requirements as stated by the Lora Alliance.

Perhaps you should start with the Lora Alliance documentation, the LoRaWAN specification including regional parameters will make clear what is required of a gateway. Then match those requirements with the available hardware…

Wrong! Read what you have linked to again…… it says it can be used with a gateway….not it is a gateway……it’s just a more specialised node implementation….one adding GNSS capabilities!

Re SX130x we would all like cheaper but it is as Jac has outlined…… it is a far more complex beast and larger piece of Si but the family and the concentrator cards built using then have become much cheaper over time and are now a fraction of the price a few years ago. I don’t like the price of a Ferrari, but my bike is no substitute and a poor comparison/replacement and it doesn’t matter how many bikes I bolt together I still wont have a Ferrari ! :wink:

Very hard to say because you didn’t answer my question above, are you looking for the challenge of building something - if so, what skills do you have?

Yes, but just because it has WiFi on it doesn’t necessarily make it a good fit for your purpose.

Some people might call that a BIG HINT - if there were lots of posts on using the ESP32, you can assume that it is something that possible, if you can only find lots of posts on using Raspberry Pi but not ESP32, then what reasonable assumptions could you make?

Please ensure you have read and internalised the entire of the Learn section so we don’t have to answer LoRaWAN 101. Also look at the getting started documentation so you can see what is normal for LW, followed by reading the gateways and devices sections. If you are starting out with new technology it is highly recommended that you use mainstream kit with a large body of support until you know what you are doing.

If you look around the forum you will see many people asking questions about configuring a pre-made gateway HAT for a RPi and many people asking questions about creating their own devices. I believe there is one post from someone who designed a gateway HAT, out of tens of thousands of posts.

Ideally you understand the why as well - because there are other similar products around that may appear at first glance to support LoRaWAN but don’t and not all vendors say so, or indeed understand themselves.

Where does it say this? I’m asking because if we know where it says it, we can ask them to remove it.

As it’s a WaveShare product, have you tried asking them - their support email is pretty good - just consider timezone differences.

What it does say on the wiki page is that “Combined with a LoRa gateway, it can be connected to servers such as TTN to build a LoRaWAN network.” The demo code, in Python, is for two point to point setups - both do pretty much the same thing, just one of them is labelled ‘gateway’ when it’s actually just a receiver.

Please consider reading the sections linked for Learn & Docs in my post above, it will fill in many blanks.

It doesnt see my answer above!

What it actually says is
Combined with a LoRa gateway, it can be connected to servers such as TTN to build a LoRaWAN network” as you called out I see…

And even then misworded as it should say LoRaWAN Gateway!!! Sloppy use of language but not native English users I suspect so a little slack given to their marketing team…

I wasn’t asking you and I know this because I say so later on! :wink:

I was asking the OP so that if we’d missed anything!

I am sure the typical reason for people wanting to build single channel ESP32 gateways is because it can be built for $10.

Sure, I can save money but at what cost?

These just aren’t gateways - they cause disruption to the network they are attached to for the owner and other users around them if they are running them on a shared network like TTN.

And if you’re not running it on a network or your own private LW setup, why not do point to point - so much simpler to code & run.

And then there is the configuration of the devices that trips people up due to the LNS expecting 8 channels at differing SF’s to be available.


If you are going to buy a bunch of devices that are LW, configuring them for a SCPF is likely to fail and if you are buying the devices, you can probably run to a TTIG.

If you are making DIY devices, then just use the really simple code for P2P that’s in the Arduino LoRa library - which means you can use Nano’s & Pro Mini’s without issue as the code fits.


We aren’t allowed to drive unfit cars on the road - you may get away with it but eventually it will come to bite you - same deal applies here.

PS, I use P2P with an ESP32 using Sandeeps library & it works really really well - but this is LoRaWAN / TTI / TTN only forum - check out the Arduino forum for assistance in that area.

@descartes But I would like to bring my node data on the server like the TTN. node to node comunication is possible but bringing it to the network of ttn is the main task

Then as discussed you need a LoRaWAN GW!!! Your node sends message to LoRaWAN GW which then passes it on to the TTN LNS… have you bothered to read any of the Learn docs, looked at the TTN Youtube LoRaWAN101 video or anything to show you the system architecture? As suggested by Nick barely 5hours ago? (even the incorrect docs you & @abeechey2002 keep refering to show some of this…)

You need to look longer, harder and in the right places… start wth the links already given…

WHY?

A LoRaWAN network server ONLY provides a mechanism for passing data from a device to an end point - it doesn’t do dashboards or store information. Its only purpose is to manage that relay at scale - like 1000’s or more devices.

As you are student that appears to need to get a DIY device online then your university should provide a gateway as for them it is a tiny one off expense and leverages a whole range of potential activities. Without getting overly geopolitical, Kabul has 11 gateways, if they can I’m sure Islamabad can run to a TTIG given they have a university that is for technical subjects.

If your tutor has tasked you with building a gateway then they should understand that a Pi HAT is going to cost ~$100. If they actually want you to build one on ESP32, perhaps they should try it first to see how actually hard it is going to be.

Although with some better searching of this forum or the internet at large you may find that it’s all done for you, you just have to be incredibly good at soldering and buy about $90 worth of components - get it wrong and you’ll have to spend more $$$ so probably best to buy a HAT.

If they have a problem with this feedback, then they can contact us on here and we’ll debug the issue with them.

If you don’t want to pass this information on to your tutors, I really can’t see where this topic will head, so best act decisively, you never know, your tutors may be able to help if you ask, which is what you’d have to do if you were employed and your manager needed you to get something done - ask for resources.

@descartes Right Sir thankyou for the help and Ill surely now move toward using the dragnino multi channel gateway and buy one.

2 Likes

There is a proper gateway that can be built under 35€

2 Likes

Hi DanMan - Links? SW Stack/Packet Forwarder used?

Saw your dual mPCIe add on for Microtik about a year back - hope this is as effective! :wink: