# Big ESP32 / SX127x topic part 1

**URL:** <https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247>\
**Category:** End Devices (Nodes)\
**Created:** [October 24, 2017, 4:39pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247 "2017-10-24T16:39:55Z")\
**Posts on this page:** 20\
**Page:** 17

<div class="post-metadata">

**Author:** ![Verkehrsrot](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/verkehrsrot/32/46588_2.png) [@Verkehrsrot](https://www.thethingsnetwork.org/forum/u/Verkehrsrot)\
**Post date:** [January 18, 2018, 1:34pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/333 "2018-01-18T13:34:42Z")

</div>

If the test was carried out under exactly the same RF conditions, so that we can exclude i.e. an EMI effect, the root cause for different ping results must stay on the digital side. That’s, on the one hand, the SPI interface between SX127x chip/mode, and on the other hand the LoRa software stack.

If an LMiC stack was used for the ping test: Sure, that the TX\_COMPLETE event was properly handled by the stack, i.e. no events were missed? Data reception with LMiC stack requires properly processing of the events generated by SX127x DIO lines, and properly timing that ensures that the LoRaWAN RX-slot is not missed.

---

<div class="post-metadata">

**Author:** ![Ajj](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ajj/32/25844_2.png) [@Ajj](https://www.thethingsnetwork.org/forum/u/Ajj)\
**Post date:** [January 18, 2018, 1:51pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/334 "2018-01-18T13:51:43Z")

</div>

The statemen over 30 mating cycles for a u.fl connector is incorrect, also in Wikipedia. The datasheet specifies only the contact resistance when 30 mating cycles have been performed. There is no limit on the number of mating cycles in the datasheet, for so far as I can see. Using extreme care, not twisting the cable are obvious precautions to be taken with this very small connector. But for regular connecting/unconnecting actions I agree that e.g. a SMA connector would be far preferable.

On the subject itself, it might be worth the effort to analyse the RF behaviour of the Heltec board with a VNA. As you may recall, on the famous LoRa thingie handed out on the E&A fair in Utrecht last year, they managed to screw up the matching circuit to the ProAnt on-board antenna severely. Perhaps an even trivial case of not entirely understanding the RF part could have happend on this board.

–Ajj

---

<div class="post-metadata">

**Author:** ![petriska](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/p/9f8e36/32.png) [@petriska](https://www.thethingsnetwork.org/forum/u/petriska)\
**Post date:** [January 18, 2018, 3:54pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/335 "2018-01-18T15:54:41Z")

</div>

Sorry I made mistake, PIN20 looks like problem in transmitting but new measurement show that its ok

---

<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:** [January 18, 2018, 4:22pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/336 "2018-01-18T16:22:03Z")

</div>

The connectors on my 1.13 mm coax cables are [I-PEX part number 20278-112R-13](https://www.i-pex.com/Products/detail/129).  
Hirose lists its part number U.FL-LP-068 as being compatible.  
On the [Hirose product site](https://www.hirose.com/product/en/products/U.FL/U.FL-LP-068N1T-A-%28100%29/) it says “Mating/Unmating Cycles: 30”. In their U.FL catalog they call it ‘Durability’.  
So I guess this is probably best interpreted as _‘confirmed specs for (max) 30 mating cycles’_.

---

<div class="post-metadata">

**Author:** ![Verkehrsrot](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/verkehrsrot/32/46588_2.png) [@Verkehrsrot](https://www.thethingsnetwork.org/forum/u/Verkehrsrot)\
**Post date:** [January 18, 2018, 8:22pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/337 "2018-01-18T20:22:51Z")

</div>

Is there really anyone out there who can connect a U.FL connector more than 30 times without breaking it? 🤨

---

<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:** [January 18, 2018, 10:17pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/338 "2018-01-18T22:17:09Z")

</div>

I think I can. 😁

I learned today that there exist tools for manual insertion/removal of I-PEX MHF connectors.

![I-PEX Push Pull JIG Manual Tool](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/7/7927f8d4a2bac9fb84fcc20b7da01300ee3bf9cd.png)

This brochure [Accessories\_for\_MHF\_series.pdf](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/f/f89e7cd3a3c8ec8e054d3712b53535e7a8a9adf6.pdf) (73.9 KB) and this drawing [90224C0(MHF).pdf](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/7/704ced8704324b201e08a37e51b9b8311afd2e07.pdf) (234.3 KB) show a version (90224-001) for both insertion and removal.  
But I can’t find a source where the 90224-001 is available.

[This one (90192-001)](https://uk.rs-online.com/web/p/extraction-tools/0362058/) is suitable for removal only.

---

<div class="post-metadata">

**Author:** ![BBBits](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bbbits/32/20484_2.png) [@BBBits](https://www.thethingsnetwork.org/forum/u/BBBits)\
**Post date:** [January 19, 2018, 12:51am UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/339 "2018-01-19T00:51:05Z")

</div>

I Thought you might be interested with a test I just did using one of those TTGO type devices with the stock antenna provided .  
I Connected to Kotahi Net (in Auckland NZ)  
I am 42Km’s away from their gateway on the sky tower .  
They reliably receive all my transmissions but I couldn’t get an ACK back to any confirmed messages I sent…  
I Connected an 8dbi yagi to the TTGO & Started getting Acknowledges Back .  
The antenna is like one of these [8dbi antenna](https://www.aliexpress.com/item/Universal-Outdoor-Indoor-Yagi-Antenna-11dBi-800-2500Mhz-GSM-CDMA-DCS-3G/1878084736.html)

---

<div class="post-metadata">

**Author:** ![parhamdb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/parhamdb/32/9890_2.png) [@parhamdb](https://www.thethingsnetwork.org/forum/u/parhamdb)\
**Post date:** [January 19, 2018, 5:09am UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/340 "2018-01-19T05:09:46Z")

</div>

I’m having a bit of a weird issue with IRQ  
I added a line to print when arduino\_lmic reads interrupts.

359586: engineUpdate, opmode=0x808  
359767: Uplink data pending  
359924: Airtime available at 359767 (channel duty limit)  
360239: Ready for uplink  
360437: TXMODE, freq=902300000, len=48, SF=7, BW=125, CR=4/5, IH=0  
FIRING IRQ: 0  
366547: irq: dio: 0x0 flags: 0x8  
366555: Scheduled job 0x3ffcce90, cb 0x400d42d8 ASAP  
366561: Running job 0x3ffcce90, cb 0x400d42d8, deadline 0  
366735: Scheduled job 0x3ffcce90, cb 0x400d3ff4 at 428320  
428320: Running job 0x3ffcce90, cb 0x400d3ff4, deadline 428320  
428447: RXMODE\_SINGLE, freq=923300000, SF=7, BW=500, CR=4/5, IH=0  
FIRING IRQ: 0  
429936: irq: dio: 0x0 flags: 0x40  
429951: Scheduled job 0x3ffcce90, cb 0x400d57e8 ASAP  
429955: Running job 0x3ffcce90, cb 0x400d57e8, deadline 0  
430150: Received downlink, window=RX1, port=0, ack=1  
LORA EVENT EV\_TXCOMPLETE

Now this works perfectly but every now and then that IRQ gets fired but somehow lmic code misses it.  
I added ESP32 IRQ handling with callback and saw this happening. esp32 interrupt detects interrupt, but lmic doesn’t.  
So it never fires EV\_TXCOMPLETE and gets stuck.  
This can happen anywhere from packet 2 to packet 70. its pretty random!  
Anybody else seen anything like this?ve tested this on 2 heltec modules and 1 TTGO module.  
I’ve already opened issue:

> <https://github.com/matthijskooijman/arduino-lmic/issues/135>

From ESP32-Arduino i understand attach/detach interrupts used by arduino-lmic hal.cpp is not actually implemented in esp32.

---

<div class="post-metadata">

**Author:** ![parhamdb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/parhamdb/32/9890_2.png) [@parhamdb](https://www.thethingsnetwork.org/forum/u/parhamdb)\
**Post date:** [January 20, 2018, 3:46am UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/341 "2018-01-20T03:46:39Z")

</div>

Ok! I figured this out.  
I used ESP32 IDF methods and threads.  
So when mixing arduino and esp-idf code you have to make sure sending data is performed from the same thread/core as LMIC. I think there can be race conditions.

---

<div class="post-metadata">

**Author:** ![88bit](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/88bit/32/35697_2.png) [@88bit](https://www.thethingsnetwork.org/forum/u/88bit)\
**Post date:** [January 20, 2018, 9:22am UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/342 "2018-01-20T09:22:30Z")

</div>

Hi I’m trying to get my first Lora node connected to my RAK gate way, and I need some help.  
I’m using the LmiC code and everything seems to work however I don’t have the Device EUI,  
how can I get this from the Heltec Board? The board got an LCD so I can printe it to that.  
Also is there a way to confirm that I’m transmitting on 915 AU.  
I can see on the TCP dump on my gateway that I receive some packets but not able to see anything on the ThingsNetwork.

Thank you for your help

---

<div class="post-metadata">

**Author:** ![Verkehrsrot](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/verkehrsrot/32/46588_2.png) [@Verkehrsrot](https://www.thethingsnetwork.org/forum/u/Verkehrsrot)\
**Post date:** [January 20, 2018, 2:32pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/343 "2018-01-20T14:32:52Z")

</div>

I’m also coding with mixed arduino (for LMiC) and ESP32 IDF, using platformIO on Visual Studio Code.  
Had some trouble with race conditions, too. Not sure if i really cleared them.  
Could you share your code here or on github?

I’m looking for a solution to switch off core 1. In ESP-IDF this is done with a build option, but doen’t work on arduino framework, probably because it uses precompiled ESP32 libs. Any ideas how to switch off core 1 in platformIO?

---

<div class="post-metadata">

**Author:** ![kayakpete](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kayakpete/32/46523_2.png) [@kayakpete](https://www.thethingsnetwork.org/forum/u/kayakpete)\
**Post date:** [January 20, 2018, 11:02pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/344 "2018-01-20T23:02:25Z")

</div>

Great thread. Thanks to everyone who shared information. It’s gotten me almost the whole way.

I’m running the Heltec at 915 MHz, and have adjusted my arduino-lmic library config.h to reflect this. I’m running @nicbkw example code, but can’t get past “EV\_JOIN\_FAILED”

I see OTAA join requests up at TTN, and my APPEUI, DEVEUI are in LSB format, and APPKEY is in MSB format. All looks good, but I just still get stuck at the ev join failed message.

Any ideas on what I might be missing?

---

<div class="post-metadata">

**Author:** ![kayakpete](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kayakpete/32/46523_2.png) [@kayakpete](https://www.thethingsnetwork.org/forum/u/kayakpete)\
**Post date:** [January 20, 2018, 11:09pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/345 "2018-01-20T23:09:20Z")

</div>

Ok, I plugged in my second module and it works fine. I’m guessing I have a bad board.

---

<div class="post-metadata">

**Author:** ![stormforce133](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/stormforce133/32/7319_2.png) [@stormforce133](https://www.thethingsnetwork.org/forum/u/stormforce133)\
**Post date:** [January 20, 2018, 11:52pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/346 "2018-01-20T23:52:43Z")

</div>

Guys, this is a great thread, but I need you help.  
I have a ESP32 dev module with a Adafruit RFM95W breakout and I can’t get it to work, neither OTAA or ABP.  
I used the examples from the arduino-lora repo… with OTAA, I always get the EV\_JOIN\_FAILED and with ABP it seems that the message goes out but I don’t see any activity on TTN.

Here is my prototype:

![image](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/b/b45e0fff7b2946cd52e03aa94d672eb60911b88e.jpg)

The big question is… EV\_TXCOMPLETE (using ABP) means that my wiring between the ESP32 and the RFM95w module is working? Is this maybe a configuration error?

Thanks in advance!

PD: Here is my gateway:

![image](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/b/bf1db21700ead3b0a7bc1f0483b6100db09e1ff5.jpg)

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [January 21, 2018, 10:00am UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/347 "2018-01-21T10:00:06Z")

</div>

> [@88bit](#):
>
> I don’t have the Device EUI,
> 
> how can I get this from the Heltec Board?

You can’t; the board does not provide one.

You could generate a semi-random one yourself (possibly based on the onboard WiFi’s MAC address), **see [DevEUI for non-hardware assigned values](https://www.thethingsnetwork.org/forum/t/deveui-for-non-hardware-assigned-values/2093/) for rules to take into account**. Or simply have TTN Console generate one for you by clicking the 🔀 icon at the start of the input field; see [screenshots and a warning](https://www.thethingsnetwork.org/forum/t/deveui-for-non-hardware-assigned-values/2093/40) at the same link.

---

<div class="post-metadata">

**Author:** ![Verkehrsrot](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/verkehrsrot/32/46588_2.png) [@Verkehrsrot](https://www.thethingsnetwork.org/forum/u/Verkehrsrot)\
**Post date:** [January 21, 2018, 11:07am UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/348 "2018-01-21T11:07:59Z")

</div>

I have one Heltec board working properly, and one not working with LMiC, too. That one not working has issues when data is to be transmitted.

Found out that one working has a CPU ESP32 Hw Revision 1, while that one not working has a CPU ESP32 Hw Revision 0.

Can you check this with your boards, please? Perhaps this is the reason, eventually timings or something else on the SPI interface between ESP32 and SX1276 goes wrong.

You can see the CPU revision when flashing with esptool, it shows CPU type and revision.

There are some [bugs reported](http://espressif.com/sites/default/files/documentation/eco_and_workarounds_for_bugs_in_esp32_en.pdf) for CPU ESP32, esp. for revision 0.

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [January 21, 2018, 3:31pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/349 "2018-01-21T15:31:01Z")

</div>

3 posts were merged into an existing topic: [DevEUI for non-hardware assigned values](https://www.thethingsnetwork.org/forum/t/deveui-for-non-hardware-assigned-values/2093)

---

<div class="post-metadata">

**Author:** ![kayakpete](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kayakpete/32/46523_2.png) [@kayakpete](https://www.thethingsnetwork.org/forum/u/kayakpete)\
**Post date:** [January 21, 2018, 2:05pm UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/352 "2018-01-21T14:05:52Z")

</div>

Greetings, @Verkehrsrot -

it looks like I have two Rev 1 boards.

```
.\Documents\Arduino\hardware\heltec\esp32\tools>esptool -p com9 -b 115200 flash_id
esptool.py v2.1
Connecting....
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Manufacturer: ef
Device: 4016
Detected flash size: 4MB
Hard resetting...

.\Documents\Arduino\hardware\heltec\esp32\tools>esptool -p com9 -b 115200 flash_id
esptool.py v2.1
Connecting....
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Manufacturer: ef
Device: 4016
Detected flash size: 4MB
Hard resetting...

.\Documents\Arduino\hardware\heltec\esp32\tools>

```

I’ve noticed that I don’t have consistent performance on my second board either, to my local RAK831 gateway. So, I’m not out of the woods yet.

---

<div class="post-metadata">

**Author:** ![88bit](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/88bit/32/35697_2.png) [@88bit](https://www.thethingsnetwork.org/forum/u/88bit)\
**Post date:** [January 22, 2018, 9:05am UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/353 "2018-01-22T09:05:51Z")

</div>

I need some help trying to connect my Helltec board to my RAK 831 Gatway.

I’m using the Lmic source in the Arduino environment.

Here is my code  
Hi I was wondering if you know of a working Heltec configuration on the AUS915 spectrum.  
I set up a gateway in Mount Kuring Gai and it is connected to the The Thingsnetwork.

But I’m having a bit of a hard time to get the node I have configured.

I have a Helltec board and using the Arduino Core Lmic.  
However I fail to register EV\_JOIN\_FAILD.  
Find the code and the serial window output from the Arduino IDE.

May thanks for your help.

Here is the code I’m using:  
// This should also be in little endian format, see above.  
static const u1\_t PROGMEM DEVEUI[8] = { 0x9B, 0xF6, 0x59, 0x64, 0x71, 0xFB, 0x02, 0x00 };  
void os\_getDevEui (u1\_t\* buf) {  
memcpy\_P(buf, DEVEUI, 8);  
}

// This key should be in big endian format (or, since it is not really a  
// number but a block of memory, endianness does not really apply). In  
// practice, a key taken from ttnctl can be copied as-is.  
// The key shown here is the semtech default key.  
static const u1\_t PROGMEM APPKEY[16] = { 0xA9, 0x43, 0xB5, 0x11, 0xEB, 0xFB, 0xA5, 0xC1, 0xB7, 0xA1, 0x42, 0xBC, 0x7E, 0xB4, 0x7C, 0x79 };  
void os\_getDevKey (u1\_t\* buf) {  
memcpy\_P(buf, APPKEY, 16);  
}

static uint8\_t mydata[] = “Hi”;  
static osjob\_t sendjob;

// Schedule TX every this many seconds (might become longer due to duty  
// cycle limitations).  
const unsigned TX\_INTERVAL = 30;

// Pin mapping  
const lmic\_pinmap lmic\_pins = {  
.nss = 18,  
.rxtx = LMIC\_UNUSED\_PIN,  
.rst = 14,  
.dio = {26, 33, 32},  
};

void onEvent (ev\_t ev) {  
Serial.print(os\_getTime());  
u8x8.setCursor(0, 5);  
u8x8.printf(“TIME %lu”, os\_getTime());  
Serial.print(": ");  
switch (ev) {  
case EV\_SCAN\_TIMEOUT:  
Serial.println(F(“EV\_SCAN\_TIMEOUT”));  
u8x8.drawString(0, 7, “EV\_SCAN\_TIMEOUT”);  
break;  
case EV\_BEACON\_FOUND:  
Serial.println(F(“EV\_BEACON\_FOUND”));  
u8x8.drawString(0, 7, “EV\_BEACON\_FOUND”);  
break;  
case EV\_BEACON\_MISSED:  
Serial.println(F(“EV\_BEACON\_MISSED”));  
u8x8.drawString(0, 7, “EV\_BEACON\_MISSED”);  
break;  
case EV\_BEACON\_TRACKED:  
Serial.println(F(“EV\_BEACON\_TRACKED”));  
u8x8.drawString(0, 7, “EV\_BEACON\_TRACKED”);  
break;  
case EV\_JOINING:  
Serial.println(F(“EV\_JOINING”));  
u8x8.drawString(0, 7, “EV\_JOINING”);  
break;  
case EV\_JOINED:  
Serial.println(F(“EV\_JOINED”));  
u8x8.drawString(0, 7, "EV\_JOINED ");

// Disable link check validation (automatically enabled  
// during join, but not supported by TTN at this time).  
LMIC\_setLinkCheckMode(0);  
break;  
case EV\_RFU1:  
Serial.println(F(“EV\_RFU1”));  
u8x8.drawString(0, 7, “EV\_RFUI”);  
break;  
case EV\_JOIN\_FAILED:  
Serial.println(F(“EV\_JOIN\_FAILED”));  
u8x8.drawString(0, 7, “EV\_JOIN\_FAILED”);  
break;  
case EV\_REJOIN\_FAILED:  
Serial.println(F(“EV\_REJOIN\_FAILED”));  
u8x8.drawString(0, 7, “EV\_REJOIN\_FAILED”);  
//break;  
break;  
case EV\_TXCOMPLETE:  
Serial.println(F(“EV\_TXCOMPLETE (includes waiting for RX windows)”));  
u8x8.drawString(0, 7, “EV\_TXCOMPLETE”);  
digitalWrite(BUILTIN\_LED, LOW);  
if (LMIC.txrxFlags & TXRX\_ACK) {  
Serial.println(F(“Received ack”));  
u8x8.drawString(0, 7, “Received ACK”);  
}  
if (LMIC.dataLen) {  
Serial.println(F(“Received “));  
u8x8.drawString(0, 6, “RX “);  
Serial.println(LMIC.dataLen);  
u8x8.setCursor(4, 6);  
u8x8.printf(”%i bytes”, LMIC.dataLen);  
Serial.println(F(” bytes of payload”));  
u8x8.setCursor(0, 7);  
u8x8.printf(“RSSI %d SNR %.1d”, LMIC.rssi, LMIC.snr);  
}  
// Schedule next transmission  
os\_setTimedCallback(&sendjob, os\_getTime() + sec2osticks(TX\_INTERVAL), do\_send);  
break;  
case EV\_LOST\_TSYNC:  
Serial.println(F(“EV\_LOST\_TSYNC”));  
u8x8.drawString(0, 7, “EV\_LOST\_TSYNC”);  
break;  
case EV\_RESET:  
Serial.println(F(“EV\_RESET”));  
u8x8.drawString(0, 7, “EV\_RESET”);  
break;  
case EV\_RXCOMPLETE:  
// data received in ping slot  
Serial.println(F(“EV\_RXCOMPLETE”));  
u8x8.drawString(0, 7, “EV\_RXCOMPLETE”);  
break;  
case EV\_LINK\_DEAD:  
Serial.println(F(“EV\_LINK\_DEAD”));  
u8x8.drawString(0, 7, “EV\_LINK\_DEAD”);  
break;  
case EV\_LINK\_ALIVE:  
Serial.println(F(“EV\_LINK\_ALIVE”));  
u8x8.drawString(0, 7, “EV\_LINK\_ALIVE”);  
break;  
default:  
Serial.println(F(“Unknown event”));  
u8x8.setCursor(0, 7);  
u8x8.printf(“UNKNOWN EVENT %d”, ev);  
break;  
}  
}

void do\_send(osjob\_t\* j) {  
// Check if there is not a current TX/RX job running  
if (LMIC.opmode & OP\_TXRXPEND) {  
Serial.println(F(“OP\_TXRXPEND, not sending”));  
u8x8.drawString(0, 7, “OP\_TXRXPEND, not sent”);  
} else {  
// Prepare upstream data transmission at the next possible time.  
LMIC\_setTxData2(1, mydata, sizeof(mydata) - 1, 0);  
Serial.println(F(“Packet queued”));  
u8x8.drawString(0, 7, “PACKET QUEUED”);  
digitalWrite(BUILTIN\_LED, HIGH);  
}  
// Next TX is scheduled after TX\_COMPLETE event.  
}

void setup() {

Serial.begin(115200);

u8x8.begin();  
u8x8.setFont(u8x8\_font\_chroma48medium8\_r);  
u8x8.drawString(0, 1, “LoRaWAN LMiC”);

SPI.begin(5, 19, 27);

// LMIC init  
os\_init();  
// Reset the MAC state. Session and pending data transfers will be discarded.  
LMIC\_reset();

// Start job (sending automatically starts OTAA too)  
do\_send(&sendjob);

pinMode(BUILTIN\_LED, OUTPUT);  
digitalWrite(BUILTIN\_LED, LOW);  
}

## void loop() { os\_runloop\_once(); }

And this is the serial output from the Arduino IDE  
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON\_RESET),boot:0x17 (SPI\_FAST\_FLASH\_BOOT)  
configsip: 0, SPIWP:0xee  
clk\_drv:0x00,q\_drv:0x00,d\_drv:0x00,cs0\_drv:0x00,hd\_drv:0x00,wp\_drv:0x00  
mode:DIO, clock div:1  
load:0x3fff0018,len:4  
load:0x3fff001c,len:956  
load:0x40078000,len:0  
load:0x40078000,len:13076  
entry 0x40078a58  
RXMODE\_RSSI  
39430: engineUpdate, opmode=0x8  
Packet queued  
42206: EV\_JOINING  
46471: engineUpdate, opmode=0xc  
46504: TXMODE, freq=902300000, len=23, SF=7, BW=125, CR=4/5, IH=0  
362894: RXMODE\_SINGLE, freq=923300000, SF=7, BW=500, CR=4/5, IH=0  
426139: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
428712: engineUpdate, opmode=0xc  
439700: engineUpdate, opmode=0xc  
439725: TXMODE, freq=903000000, len=23, SF=8, BW=500, CR=4/5, IH=0  
754027: RXMODE\_SINGLE, freq=923300000, SF=7, BW=500, CR=4/5, IH=0  
817271: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
819844: engineUpdate, opmode=0xc  
907207: engineUpdate, opmode=0xc  
907232: TXMODE, freq=911900000, len=23, SF=8, BW=125, CR=4/5, IH=0  
1226861: RXMODE\_SINGLE, freq=923300000, SF=8, BW=500, CR=4/5, IH=0  
1290082: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
1292654: engineUpdate, opmode=0xc  
1332794: engineUpdate, opmode=0xc  
1332819: TXMODE, freq=903000000, len=23, SF=8, BW=500, CR=4/5, IH=0  
1647121: RXMODE\_SINGLE, freq=923300000, SF=7, BW=500, CR=4/5, IH=0  
1710366: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
1712938: engineUpdate, opmode=0xc  
2169543: engineUpdate, opmode=0xc  
2169568: TXMODE, freq=912500000, len=23, SF=9, BW=125, CR=4/5, IH=0  
2495037: RXMODE\_SINGLE, freq=925100000, SF=9, BW=500, CR=4/5, IH=0  
2558209: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
2560782: engineUpdate, opmode=0xc  
2571713: engineUpdate, opmode=0xc  
2571738: TXMODE, freq=907800000, len=23, SF=8, BW=500, CR=4/5, IH=0  
2886040: RXMODE\_SINGLE, freq=925100000, SF=7, BW=500, CR=4/5, IH=0  
2949284: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
2951859: engineUpdate, opmode=0xc  
3188834: engineUpdate, opmode=0xc  
3188859: TXMODE, freq=906700000, len=23, SF=10, BW=125, CR=4/5, IH=0  
3524727: RXMODE\_SINGLE, freq=926900000, SF=10, BW=500, CR=4/5, IH=0  
3587804: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
3590376: engineUpdate, opmode=0xc  
3613090: engineUpdate, opmode=0xc  
3613115: TXMODE, freq=912600000, len=23, SF=8, BW=500, CR=4/5, IH=0  
3927417: RXMODE\_SINGLE, freq=926900000, SF=7, BW=500, CR=4/5, IH=0  
3990661: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
3993234: EV\_JOIN\_FAILED  
3998768: engineUpdate, opmode=0xc  
4250120: engineUpdate, opmode=0xc  
4250148: TXMODE, freq=911900000, len=23, SF=10, BW=125, CR=4/5, IH=0  
4586017: RXMODE\_SINGLE, freq=923300000, SF=10, BW=500, CR=4/5, IH=0  
4649093: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
4651665: engineUpdate, opmode=0xc  
4666741: engineUpdate, opmode=0xc  
4666766: TXMODE, freq=903000000, len=23, SF=8, BW=500, CR=4/5, IH=0  
4981070: RXMODE\_SINGLE, freq=923300000, SF=7, BW=500, CR=4/5, IH=0  
5044313: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
5046886: EV\_JOIN\_FAILED  
5052402: engineUpdate, opmode=0xc  
5164684: engineUpdate, opmode=0xc  
5164711: TXMODE, freq=908700000, len=23, SF=10, BW=125, CR=4/5, IH=0  
5500581: RXMODE\_SINGLE, freq=923300000, SF=10, BW=500, CR=4/5, IH=0  
5563657: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
5566229: engineUpdate, opmode=0xc  
5598334: engineUpdate, opmode=0xc  
5598359: TXMODE, freq=903000000, len=23, SF=8, BW=500, CR=4/5, IH=0  
5912661: RXMODE\_SINGLE, freq=923300000, SF=7, BW=500, CR=4/5, IH=0  
5975906: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
5978478: EV\_JOIN\_FAILED  
5983995: engineUpdate, opmode=0xc  
6820817: engineUpdate, opmode=0xc  
6820845: TXMODE, freq=906100000, len=23, SF=10, BW=125, CR=4/5, IH=0  
7156714: RXMODE\_SINGLE, freq=925100000, SF=10, BW=500, CR=4/5, IH=0  
7219790: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
7222364: engineUpdate, opmode=0xc  
7277965: engineUpdate, opmode=0xc  
7277990: TXMODE, freq=907800000, len=23, SF=8, BW=500, CR=4/5, IH=0  
7592292: RXMODE\_SINGLE, freq=925100000, SF=7, BW=500, CR=4/5, IH=0  
7655536: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
7658109: EV\_JOIN\_FAILED  
7663645: engineUpdate, opmode=0xc  
8514192: engineUpdate, opmode=0xc  
8514219: TXMODE, freq=909300000, len=23, SF=10, BW=125, CR=4/5, IH=0  
8850089: RXMODE\_SINGLE, freq=925100000, SF=10, BW=500, CR=4/5, IH=0  
8913165: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
8915737: engineUpdate, opmode=0xc  
8969401: engineUpdate, opmode=0xc  
8969426: TXMODE, freq=907800000, len=23, SF=8, BW=500, CR=4/5, IH=0  
9283728: RXMODE\_SINGLE, freq=925100000, SF=7, BW=500, CR=4/5, IH=0  
9346973: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
9349545: EV\_JOIN\_FAILED  
9355057: engineUpdate, opmode=0xc  
10130487: engineUpdate, opmode=0xc  
10130515: TXMODE, freq=905100000, len=23, SF=10, BW=125, CR=4/5, IH=0  
10466383: RXMODE\_SINGLE, freq=926900000, SF=10, BW=500, CR=4/5, IH=0  
10529460: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
10532032: engineUpdate, opmode=0xc  
10584482: engineUpdate, opmode=0xc  
10584507: TXMODE, freq=912600000, len=23, SF=8, BW=500, CR=4/5, IH=0  
10898810: RXMODE\_SINGLE, freq=926900000, SF=7, BW=500, CR=4/5, IH=0  
10962054: RXMODE\_SINGLE, freq=923300000, SF=12, BW=500, CR=4/5, IH=0  
10964627: EV\_JOIN\_FAILED

[https://www.thethingsnetwork.org/forum/t/rn2903-au-firmware/7127/7](https://www.thethingsnetwork.org/forum/t/rn2903-au-firmware/7127/7)

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [January 22, 2018, 9:03am UTC](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247/354 "2018-01-22T09:03:26Z")

</div>

this is not very forum friendly… please read [How do I format my forum post?](https://www.thethingsnetwork.org/forum/t/how-do-i-format-my-forum-post/8735)

[Previous page](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247.md?page=16)

[Next page](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247.md?page=18)
