# TTIG and SX1261 not connecting + LoRaWAN design considerations

**URL:** <https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613>\
**Category:** TTIG - The Things Indoor Gateway\
**Created:** [April 30, 2020, 6:47pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613 "2020-04-30T18:47:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![micronetwork](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/micronetwork/32/25844_2.png) [@micronetwork](https://www.thethingsnetwork.org/forum/u/micronetwork)\
**Post date:** [April 30, 2020, 6:47pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/1 "2020-04-30T18:47:27Z")

</div>

I went ahead and bought 2x E22900M30S from Ebyte (SX1262) and with the library from @LoRaTracker I was able to make a successful connection between the two.

Incited by the success of my first Lora project I ordered the TTIG 868 gateway, and here comes the problem: nothing goes through. When starting the gateway, green steady LED on my eui-58a0cbfffe801d6e My console says connected and after some time the status changes to not connected.  
Received messages is 0. I don’t have other Lora devices than the SX1262.

So my question is: Is the SX1262 to “new” and not compatible in some way, or do I miss someting?  
Totally new here. Any help Is highly appreciated.

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [April 30, 2020, 7:28pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/2 "2020-04-30T19:28:40Z")

</div>

You need quite different software when using LoRaWAN to a gateway, than you do when doing point-to-point raw LoRa between simple devices.

In terms of hardware compatibility, there’s some difference in how the LoRa packet pre-amble should be set for SX1262 vs older devices in order to achieve the same result on-air. If it mismatches in theory no packets would be seen, though in practice occasional packets with the wrong preamble do tend to get through.

The main thing though is that you’ve provided no information on the software used when attempting to interact with the LoRaWAN gateway, so the most likely cause of failure is that you are either not using LoRaWAN software to operate the SX1262, or using LoRaWAN software with gross configuration (frequencies, etc) which mismatches your region and gateway.

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [April 30, 2020, 8:27pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/3 "2020-04-30T20:27:50Z")

</div>

The library I wrote is for point to point LoRa only, it does not claim to support LoRaWAN and there are no LoRaWAN examples in the library.

---

<div class="post-metadata">

**Author:** ![micronetwork](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/micronetwork/32/25844_2.png) [@micronetwork](https://www.thethingsnetwork.org/forum/u/micronetwork)\
**Post date:** [April 30, 2020, 8:31pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/4 "2020-04-30T20:31:21Z")

</div>

OK, let me be more specific, the Arduino library is from @LoRaTracker

> **[LoRaTracker/SX12XX-LoRa](https://github.com/LoRaTracker/SX12XX-LoRa)**
>
> Library for SX12XX LoRa devices. Contribute to LoRaTracker/SX12XX-LoRa development by creating an account on GitHub.

Hardware: ESP32 WeMos

I selected this library because it’s supporting SPI bus

In the Settings.h file:

* * *

//LoRa Modem Parameters  
const uint32\_t Frequency = 868300000; //frequency of transmissions in hertz  
const uint32\_t Offset = 0; //offset frequency for calibration purposes

const uint8\_t Bandwidth = LORA\_BW\_125; //LoRa bandwidth  
const uint8\_t SpreadingFactor = LORA\_SF7; //LoRa spreading factor  
const uint8\_t CodeRate = LORA\_CR\_4\_5; //LoRa coding rate  
const uint8\_t Optimisation = LDRO\_AUTO; //low data rate optimisation setting, normally set to auto

const int8\_t TXpower = 10; //LoRa transmit power in dBm

* * *

I have tried other frequencies

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [April 30, 2020, 8:36pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/5 "2020-04-30T20:36:41Z")

</div>

I have no idea as to what point you are making.

That library is very specifically for point to point LoRa use, it is not for LoRaWAN\TTN use.

This is the TTN forum …

---

<div class="post-metadata">

**Author:** ![micronetwork](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/micronetwork/32/25844_2.png) [@micronetwork](https://www.thethingsnetwork.org/forum/u/micronetwork)\
**Post date:** [April 30, 2020, 8:38pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/6 "2020-04-30T20:38:17Z")

</div>

Thank you so much @LoRaTracker for clarifying. I didn’t know it was a difference, it’s all about learning 🙂

Do you have knowledge if there is a library that support LoRaWAN?

Sorry about previous post it was in production and a reply to @cslorabox when you posted, so it ended up beeing meaningless after seeing your post

---

<div class="post-metadata">

**Author:** ![micronetwork](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/micronetwork/32/25844_2.png) [@micronetwork](https://www.thethingsnetwork.org/forum/u/micronetwork)\
**Post date:** [April 30, 2020, 9:51pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/7 "2020-04-30T21:51:10Z")

</div>

Do anyone know if there is a library for SX126X that support LoRaWAN?

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [April 30, 2020, 10:53pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/8 "2020-04-30T22:53:38Z")

</div>

How about using google? It took me all of 30 seconds to find [LoRaMac-node](https://github.com/Lora-net/LoRaMac-node) which supports the sx126x devices.  
For TTN limit yourself to class A.

---

<div class="post-metadata">

**Author:** ![micronetwork](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/micronetwork/32/25844_2.png) [@micronetwork](https://www.thethingsnetwork.org/forum/u/micronetwork)\
**Post date:** [April 30, 2020, 11:42pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/9 "2020-04-30T23:42:18Z")

</div>

Thanks @kersing for the tip but looking at this library and the need to port it over to arduino is way over my league.

---

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [May 1, 2020, 9:15pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/10 "2020-05-01T21:15:58Z")

</div>

You may have a look at [https://github.com/LacunaSpace/basicmac](https://github.com/LacunaSpace/basicmac)

BasicMac is a spinoff from LMIC, not LoRaMac-node.

@matthijskooijman’s Arduino port of BasicMac supports SX1262.  
It is as far as I’m aware currently the only generic public LoRaWAN Arduino library that supports SX1262.

(Generic here means not bound to a specific hardware platform, in contrast to e.g. Heltec’s CubeCell Arduino support which only works with CubeCell ASR650x (SiP with ARM MCU + SX1262) modules.)

_(Semtech unfortunately ceased further development of BasicMac)_

---

<div class="post-metadata">

**Author:** ![micronetwork](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/micronetwork/32/25844_2.png) [@micronetwork](https://www.thethingsnetwork.org/forum/u/micronetwork)\
**Post date:** [May 1, 2020, 10:09pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/11 "2020-05-01T22:09:01Z")

</div>

Thank you so much @bluejedi  
This library was perfect! Just what I needed 🙂

---

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [May 1, 2020, 10:13pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/12 "2020-05-01T22:13:05Z")

</div>

Success and please share your experiences.

---

<div class="post-metadata">

**Author:** ![alpu](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/alpu/32/37083_2.png) [@alpu](https://www.thethingsnetwork.org/forum/u/alpu)\
**Post date:** [May 2, 2020, 10:18pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/13 "2020-05-02T22:18:13Z")

</div>

> [@micronetwork](#):
>
> E22900M30S from Ebyte (SX1262)

It is hard to understand why Semtech would stop development of generic Arduino libraries for official Semtech chips or derived modules like the E22900M30S from Ebyte. Can anyone explain me why? These modules are ok, very affordable, low power…

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [May 3, 2020, 1:29am UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/14 "2020-05-03T01:29:19Z")

</div>

> [@alpu](#):
>
> It is hard to understand why Semtech would stop

“stop” would imply there was ever such a project. Was there? The statement above is that they ceased work on BasicMac itself, not the 3rd party Arduino port of BasicMac.

> [@](#):
>
> development of generic Arduino libraries

Not surprising at all. Arduino is an extremely goofy and non-standard approach to software, actively hostile to good software engineering practices. Supporting Arduino (for something with as complex an interplay with the processor as a LoRaWAN stack) would largely mean having to do everything twice, as the Arduino versions would be rejected out of hand in most _product_ settings.

Take a look at something like Arduino-ified LMiC and start evaluating all the work you’d need to do to make it build instead in a _normal_ embedded way (been there, done that…)

Anyway, there’s a link in the thread to an sx1262 LMiC derivative that claims it has some sort of script that will munge its file organization sufficiently to work with Arduino. It also points out that the various LMiC derivatives have diverged - which is somewhat understating things. There turn out to be insufficiencies in how LMiC tried to implement LoRaWAN, and different people have different opinions on the architectural changes appropriate to enable fixing those. I suspect the linked repo doesn’t have (and equivalent to) some of the bug fixes that others do.

---

<div class="post-metadata">

**Author:** ![alpu](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/alpu/32/37083_2.png) [@alpu](https://www.thethingsnetwork.org/forum/u/alpu)\
**Post date:** [May 3, 2020, 9:44am UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/15 "2020-05-03T09:44:50Z")

</div>

Thank you for clarifying.

---

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [May 3, 2020, 10:32am UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/16 "2020-05-03T10:32:57Z")

</div>

> [@alpu](#):
>
> It is hard to understand why Semtech would stop development of generic Arduino libraries for official Semtech chips … Can anyone explain me why?

- Semtech has not ever developed a (public) Arduino LoRaWAN library yet.  
The BasicMac Arduino version was ported to the Arduino framework by @matthijskooijman (with support from LacunaSpace), one of the the main contributors who also ported IBM’s LMiC to the Arduino platform which is still a great success and is used by many people (and forks are now further maintained by others).

- Why Semtech has ceased further support for BasicMac has not been made clear, but could have different reasons (commercial, political, technical and possibly because of other new developments).  
As alternative, for new designs Semtech recommends using their LoRaMAC-node library.  
But unfortunately there is no public generic LoRaMac-node implementation available for the Arduino framework.

---

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [May 3, 2020, 10:42am UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/17 "2020-05-03T10:42:27Z")

</div>

> [@cslorabox](#):
>
> Not surprising at all. Arduino is an extremely goofy and non-standard approach to software, actively hostile to good software engineering practices.

> [@cslorabox](#):
>
> Take a look at something like Arduino-ified LMiC and start evaluating all the work you’d need to do to make it build instead in a _normal_ embedded way (been there, done that…)

> [@cslorabox](#):
>
> There turn out to be insufficiencies in how LMiC tried to implement LoRaWAN, and different people have different opinions on the architectural changes appropriate to enable fixing those.

> [@cslorabox](#):
>
> I suspect the linked repo doesn’t have (and equivalent to) some of the bug fixes that others do.

**What’s your point?**  
**Above statements are not contributing to the contents of this thread in any way whatsoever.**  
**If they don’t contribute then don’t.**

_Your views appear to be from a commericial embedded software developer._  
_Many TTN/LoRaWAN users are not and do not have the skills, tools and education of a commercial embedded software developer. These people use technologies like the Arduino framework because it requires lower skill level, is supported for many hardware platforms, supports cross platform development, is free and open source and has wide community support._

_While from software engineering theory and practices perspective the Arduino framework may not be the best platform; from accessibility perspective, ease of use, cross platform support and availability of many software libraries and examples it is still the platform of choice for many._

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [May 3, 2020, 2:50pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/18 "2020-05-03T14:50:00Z")

</div>

Someone was surprised that Semtech doesn’t publish Arduino code. I explained that they do not because that would not meet the needs of their professional customers. It goes without saying that the monetarily significant market for LoRa chips is in commercial products running professionally developed firmware, not hobbyist projects.

The unfixed bugs in BasicMac vs other LMiC branches come from the readme of BasicMac itself in the context of knowledge of the kinds of bug fixes and architectural changes to work around design deficiencies that have gone on in other LMiC repos.

In terms of practical advice, while it looks like BasicMac is an Arduino-ified LMiC supporting the sx1262, it’s probably better for less experienced users to stick to sx127x/RFM9x as supported by the more active Arduino LMiCs and within the knowledge of more community members who can serve as resources, unless one is in a position to do some serious comparative archaeology on the evolution of LMiC internals and start to update BasicMac to catch up.

---

<div class="post-metadata">

**Author:** ![alpu](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/alpu/32/37083_2.png) [@alpu](https://www.thethingsnetwork.org/forum/u/alpu)\
**Post date:** [May 3, 2020, 10:06pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/19 "2020-05-03T22:06:58Z")

</div>

I think there is no such “black-white” division between “professional commercial developers” and “hobbyists”. There is definitely a grey area, e.g. education, citizen science communities, entry market or self built nodes where Arduino may be a valid option (even if you can argue about considering that ‘serious’)

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [May 3, 2020, 10:11pm UTC](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613/20 "2020-05-03T22:11:05Z")

</div>

That would still not be where Semtech is making their money.

Most of the volume of chip sales goes on in settings where someone designs something and then there are tens to hundreds of thousands of copies of that same exact hardware and firmware running. They really want the node chip to be in your washing machine and the gateway chip in your neighbor’s cable box.

Where it’s _easy_ to do so, chip companies do sometimes target some support at the hobby-crossover market sometimes including some Arduino code, as that’s good for exposure. But this isn’t a circumstance where it’s “easy” - as a curious fact, even Arduino’s own LoRaWAN product the MKRWAN-1300 does not run an Arduino-code LoRaWAN stack but rather has a conventional sort of firmware for that which performs operations on behalf of the user Arduino sketch running on the application MCU. You _can_ get an Arduino-based LMiC and mostly applicable Arduino BSP for the Murata radio/mcu module on the board, but from MCCI rather than Arduino.

[Next page](https://www.thethingsnetwork.org/forum/t/ttig-and-sx1261-not-connecting-lorawan-design-considerations/36613.md?page=2)
