-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoRaWAN support #58
Comments
Hello,
With this configuration is possible to create a simple LoRaWAN protocol.
See yaa! |
Thank you for taking your time to contribute! I already did some work on this, starting with band plans. I did run into quite a few issues, since LoRaWAN Regional Parameters specification has several different ways of specifying channels. Ideally this LoRaWAN implementation will support all regions. At the same time though, it must be light enough to fit onto low-end MCUs, such as Arduino Uno. PS: Please make sure to use |
I think is needed to create a virtual function on the |
It might be better to implement each method separately ( |
I was testing and ( |
You can create a |
Hello, https://github.com/ricaun/RadioLib/tree/lorawan We need to normalize the funcions.
I know the sx127X don't have the setInvertIQ function, this function is needed to receive downlink. I design this library that's make the encode and decode of the LoRaWan, I really don't know is a good idea to add all the LoRaMacCrypto stuff on your code. https://github.com/ricaun/LoRaWanPacket See yaa. |
I don't think it's a good idea to separate LoRaWAN implementation from the library - mainly because Arduino has no way to manage dependencies. IQ inversion is not implemented on SX127x, but I believe that setting is somewhere in the registers, so it can be added. I'm still playing around with the idea of having radio-agnostic LoRaWAN implementation, to get the possibility of "LoRaWAN-like" network with non-LoRa modules. The main issue is the LoRa parameters: spreading factor, bandwidth and coding rate. I'm thinking that on FSK modules, bandwidth could be represented by frequency deviation (receiver filter bandwdith) and spreading factor by the bitrate, but that still leaves coding rate unaccounted for - perhaps the GFSK shaping parameter could be used here? On a side note, it's not a good idea to implicitly return |
I know the Arduino has the
In some frequency plan, the LoRaWAN has a single FSK channel, it's needed to investigate on the LoRaWAN.
Good |
I'm aware of that, though I'm unable to find the FSK parameters (frequency deviation and signal shaping) anywhere in the specification or regional parameters. Is that channel even used? |
sx1276 RegInvertIQ 0x33 6bit (status 0 - normal, 1 - inverted I Q) |
Totally random user/bystander here, but I honestly have mixed feelings about integration of more advanced layers into a single library. The "plugability" you've developed with the Module and PhysicalLayer abstraction are great, but I think that's a reason to build a set of interconnectable libraries, rather than one giant one. I at least don't want to have to disentangle LoraWAN functionality from the core drivers. |
@Timvrakas that's a very good point - the original purpose of I'm still clinging on to the hope that I'll get to try out LoRaWAN on non-LoRa modules. The parameters obviously won't map onto each other exactly (e.g.: FSK modules don't have spreading factor), but I'm thinking that some could be replaced with parameters that have similar impact (FSK bit rate could be considered a counterpart of spreading factor in this example). |
That is ussual. Try looking at LoRaMac-node or BasicMAC radio drivers, I've seen it somewhere in there.
Doesn't have to, but can be. I've successfully tested it once, its use seems to be quite rare tho. Thing is that your end device does not necessarily need to support that channel to be LoRaWAN compatible. What it MUST support to be LoRaWAN compatible (apart from other features) is subset of predefined channels in most channel plans. For EU868 that is 3 channels with LoRa modulation using SF12 to SF7.
This would be long chapter on its own. If you would omit LoRa modulation, then you would most likely have to make your own gateway (HW and SW) and server software to make this kind of WAN network. There may be one way to let non-LoRa devices comunicate with LoRaWAN network (don't confuse it with LoRaWAN compatible - it is not) which is using that dedicated FSK channel, but beware of that you're opening pandoras box ;) That is simillar when people try to make single-channel LoRa gateway - it may be able to comunicate with LoRaWAN network, but it creates whole lot of confusion as it can never be LoRaWAN compatible anyways. |
Just in case this is of use - a different TTN LoRaWAN implementation, https://github.com/adafruit/TinyLoRa/ and https://github.com/brentru/TinyLoRa apologies if this is already known or not helpful. |
What is the current status for implementing the lorawan protocol for the SX127x? |
@MystikReasons unfortunately there was no progress on this from my side due to lack of time. |
Hello. Great work. Do you have any expectations of advancement on LORAWAN for SX1262? |
@ivanboesing Well the good news is that once the LoRaWAN driver is ready, it won't care one bit which module is it using. The bad news is that I still don't have the time to work on it. |
I created a LoRa device by using your library. I want to integrate my module to the Gateway, How to generate Dev EUI, Join EUI, APP EUI on the device ? |
@UdayChaduvula unfortunately, LoRaWAN is not supported yet. |
@jgromes May you publish LoRaWAN branch? |
@IhorNehrutsa all the work that was done is already on the development branch (https://github.com/jgromes/RadioLib/tree/development), but that's all there is so far. |
Basic LoRaWAN support was added, see https://github.com/jgromes/RadioLib/blob/master/examples/LoRaWAN/LoRaWAN_End_Device/LoRaWAN_End_Device.ino It's been tested against a Waveshare SX1302 gateway connected to TTN. Caveats:
This doesn't yet complete this issue, however, it's something that can be built upon. I will keep this issue open until points 1 - 4 are resolved. Points 5 and 6 would be good to have and point 7 I would see as optional. In theory, having also the gateway side implemented in RadioLib would allow to "extend" LoRaWAN over non-LoRa devices. EDIT 2023-08-12: resolved point 1, partially resolved points 2 and 5 |
In the examples for LoRaWAN OTAA, you use a char array of size 16(17) for the appKey. On TTN, the hex array has 32 symbols (which does match w.r.t. length) - but how should I convert this? A straight conversion from hex to ASCII results in VERY weird characters which I am not really able to put into the appKey array. I would love to be able to copy the array straight over from TTN to the code, just as is the case for the joinEUI and devEUI. By the way: the default name for the third parameter on TTN is appKey, but the code says that the nwkKey should be used and appKey set to NULL for <1.1.0. I think that this is quite confusing, or am I missing something maybe? Moreover, the OTAA example shows the following lines:
But, at least for my board (one of the Heltec ESP32 boards with a SX1262), the order should be NSS, DIO1, RESET, BUSY. Is that a naming issue, or a documentation issue? |
@StevenCellist LoRaWAN mandates AES-128, which has 16-byte keys. I chose to represent them as ASCII strings. A 16-character string will be 32 symbols when represented as hexadecimals numbers. I have assumed that it is common knowledge in C programming that string is a an array of charaters and that it does not matter whether you treat them as char* or uint8_t*. But seeing as there is already a PR addressing the same thing (#811), perhaps I have assumed wrong. I will update the example so that the keys are not a C-string.
You will not be able to, it still needs to be formatted as hex array (e.g.
I was confused by this too, and now I'm convinced this is incorrect in TTN web interface. There is no appKey in LoRaWAN 1.0.x, as can be seen in the diagram below - directly from LoRaWAN 1.1 specification.
SX126x has different pins than SX127x, see the SX126x examples. |
@jgromes thanks for the feedback, and implementing the change towards hex arrays!!
If this codebase is going to end up popular, I expect a lot of people (like me) trying out the examples without looking into the difference in pins for the different series of SX. My suggestion is to add a (commented) version for the different series to the examples, such that it is more clear that we should look for a different naming scheme :) |
@StevenCellist All RadioLib protocols run on any of its supported transceivers (there are some exceptions caused by hardware, but that's beside the point). The number of possible combinations is huge, so I don't think that's a step in the right direction.
Sorry, but my answer to that is going to be "read the docs". RadioLib is not for beginners, and it assumes you know how to use the hardware you have. It's intended for people who are building systems that have to run on wide range of platforms/with various transceivers and still provide the same interface. |
It does. Click on the <> and you get: 0x70, 0xB3, 0xD5, 0x7E, 0xD0, 0x01, 0xC4, 0xEF And then you can click the clipboard icon. However the default clipboard does yield: 70B3D57ED001C4EF So you're both right!
Very few devices are on 1.0.4 yet, let alone 1.1, so the console shows end-user-engineer reality. It's most definitely not wrong, unless the Tech Director who's on the LA committees writing the specs who wants to make TTS a completely LW compliant LNS has lost the plot. If you select v1.1.0, you'll find the advanced settings provide entry fields for AppKey and NwkKey - the tooltips on the ? explain the various combinations. Frankly I think it's a muddle but if you are the TTS target audience of a volume user, your provisioning workflow will look after you. Consequently one of the LMn 'bugs' or is it an issue, definitely a gotcha, is that some combos of config won't join unless you set the AppKey and the NwkKey to be the same, started seeing this when we moved to TTS v3 with the new STM32WL a couple of years back. As I may have mentioned, mostly devices are still moving to v1.0.4, but for the DIY community, most LNS's support v1.1 so using that is entirely feasible, even if we all get confused by the changes in the specs with far less developers around to answer the questions. |
LoL or is that Sob? TTN forum experience clearly indicates that RTFM isn't a thing now - I get feedback for even suggesting it. Perhaps the best thing is to build up a list of product names with the pin mapping as well as something to explain connections for those soldering their own radios. LMIC-node should provide a useful source of info to get that started. |
@HeadBoffin overall, I appreciate the feedback, but next time please open a new issue or discussion. I will close this one shortly, it's been open for way too long and since the 6.2.0 update, it can be considered resolved in my opinion. Further work is of course needed, but I'll keep tracking that in separate issues as feedback from users arrives.
Didn't know that, thanks - the examples have been using hexadecimal arrays for a while now.
Somehow I doubt the Tech Director is the one implementing the web interface. I've actually seen quite a few bugs in it my testing (not able to change parameters of node after changing its frequency band or version, the web interface crashing after re-opening more than one tab etc.). I'm not talking about the backend at all (which obviously works fine), just the interface.
I don't understand what you're trying to say, sorry.
I'll think about it, though I'm not really keen to be maintaining such a list. Products have variants, they appear and disappear off the market, and it would be up to RadioLib/me to ensure the list is up to date. PS: In general, please try using less abbreviations. It's a bit hard to wrap one's head around what you're trying to say. |
Closing since basic LoRaWAN suport has been released in update 6.2.0, with future work to be done based on user feedback. |
Reading The Flipping Manual is now considered an act of desperation - people will post issues first to get someone else to do the research / thinking for them. They won't even search issues, just open a new one. |
RadioLib could be extended to support LoRaWAN networks (and it's been on the TODO/WIP list for quite a while now).
The text was updated successfully, but these errors were encountered: