# Arduino Pro Mini, RFM95 - data transmission aborted

**URL:** <https://www.thethingsnetwork.org/forum/t/arduino-pro-mini-rfm95-data-transmission-aborted/50893>\
**Category:** LMIC\
**Created:** [August 23, 2021, 8:29am UTC](https://www.thethingsnetwork.org/forum/t/arduino-pro-mini-rfm95-data-transmission-aborted/50893 "2021-08-23T08:29:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PROE\_WS\_LT](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/proe_ws_lt/32/35697_2.png) [@PROE\_WS\_LT](https://www.thethingsnetwork.org/forum/u/PROE_WS_LT)\
**Post date:** [August 23, 2021, 8:29am UTC](https://www.thethingsnetwork.org/forum/t/arduino-pro-mini-rfm95-data-transmission-aborted/50893/1 "2021-08-23T08:29:25Z")

</div>

Hi together,

I try to built a LoraNode with an Arduino Pro mini 3,3V and a RFM95 Lora-Module. I checked different topic here but couldn’t find one solving my problem. The problem is:  
I had one transmission to the TTN, so that I saw the Uplink data in the Live Data of the End Device. But after this no other transmission was made.  
When I check the serial monitor/debugger of Arduino IDE an unkown event occurs and seems to abort the transmission but I can’t find out, what creates this event.

Here is the Code:

> /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> - INCLUDE FILES
> 
> * * *
> 
> \*/  
> #include “lmic.h”  
> #include \<hal/hal.h\>  
> #include \<SPI.h\>  
> #include \<LowPower.h\>  
> #include \<Wire.h\>  
> #include “adcvcc.h”
> 
> /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> - DEFINES
> 
> * * *
> 
> \*/  
> #define debugSerial Serial  
> #define SHOW\_DEBUGINFO  
> #define debugPrintLn(…) { if (debugSerial) debugSerial.println( **VA\_ARGS** ); }  
> #define debugPrint(…) { if (debugSerial) debugSerial.print( **VA\_ARGS** ); }
> 
> #define FASTINTERVAL 60 // 60 seconds (for testing)  
> #define NORMALINTERVAL 900 // (5)15 minutes (normal)
> 
> /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \*Verbindung zum LoraChip RFM95w und TTN-Verbinungsdaten  
> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
> // Pin mapping CH2I (check out : [Full Arduino Mini LoraWAN below 1uA Sleep Mode](https://www.thethingsnetwork.org/forum/t/full-arduino-mini-lorawan-and-1-3ua-sleep-mode/8059) )  
> //Definieren der Anschlüsse zum RFM95-LoRaModul:  
> /\*Nss – Arduino Pin 6  
> \*RxTx – Unused  
> \*RST – Arduino Pin 5  
> \*DIO0 – Arduino Pin 2  
> \*DIO1 – Arduino Pin 3  
> \*DIO0 – Arduino Pin 4  
> \*/  
> const lmic\_pinmap lmic\_pins = {  
> .nss = 6,  
> .rxtx = LMIC\_UNUSED\_PIN,  
> .rst = 5,  
> .dio = {2, 3, 4},  
> };
> 
> // UPDATE WITH YOURE TTN KEYS AND ADDR  
> static const PROGMEM u1\_t NWKSKEY[16] = {0xFB, 0xEA, 0xE5, 0x62, 0xD2, 0x20, 0xCA, 0x05, 0xAC, 0x41, 0x48, 0x2E, 0xB7, 0x47, 0xEF, 0xFB}; // LoRaWAN NwkSKey, network session key (msb)  
> static const u1\_t PROGMEM APPSKEY[16] = {0x3D, 0xCA, 0x49, 0xB8, 0xC2, 0xFB, 0x23, 0xFC, 0x53, 0x42, 0x17, 0x4E, 0xA2, 0x38, 0xBF, 0xD8} ; // LoRaWAN AppSKey, application session key (msb)  
> static const u4\_t DEVADDR = 0x260BB22F ; // LoRaWAN end-device address (DevAddr)
> 
> // These callbacks are only used in over-the-air activation, so they are  
> // left empty here (we cannot leave them out completely unless  
> // DISABLE\_JOIN is set in config.h, otherwise the linker will complain).  
> void os\_getArtEui (u1\_t\* buf) { }  
> void os\_getDevEui (u1\_t\* buf) { }  
> void os\_getDevKey (u1\_t\* buf) { }
> 
> /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> - weitere Parameter  
> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
> static osjob\_t sendjob;
> 
> // global enviromental parameters - Testdaten  
> static float temp = 10.0;  
> static float pressure = 0.0;  
> static float humidity = 25.0;
> 
> int interval = FASTINTERVAL;
> 
> //Übertragungs-Überwachungsparameter  
> byte LMIC\_transmitted = 0;  
> byte LMIC\_event\_Timeout = 0;
> 
> /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> - Funktions-Defnitionen  
> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_/  
> /_ ======================================================================  
> Function: ADC\_vect  
> Purpose : IRQ Handler for ADC  
> Input : -  
> Output : -  
> Comments: used for measuring 8 samples low power mode, ADC is then in  
> free running mode for 8 samples  
> ====================================================================== \*/  
> ISR(ADC\_vect)  
> {  
> // Increment ADC counter  
> \_adc\_irq\_cnt++;  
> }
> 
> void onEvent (ev\_t ev) //Fehlerüberwachung mit Debug-Code für Seriellen Monitor  
> {  
> debugPrint(os\_getTime());  
> debugPrint(": ");  
> debugPrintLn(ev);  
> switch(ev)  
> {  
> case EV\_SCAN\_TIMEOUT:  
> debugPrintLn(F(“EV\_SCAN\_TIMEOUT”));  
> break;  
> case EV\_BEACON\_FOUND:  
> debugPrintLn(F(“EV\_BEACON\_FOUND”));  
> break;  
> case EV\_BEACON\_MISSED:  
> debugPrintLn(F(“EV\_BEACON\_MISSED”));  
> break;  
> case EV\_BEACON\_TRACKED:  
> debugPrintLn(F(“EV\_BEACON\_TRACKED”));  
> break;  
> case EV\_JOINING:  
> debugPrintLn(F(“EV\_JOINING”));  
> break;  
> case EV\_JOINED:  
> debugPrintLn(F(“EV\_JOINED”));  
> break;  
> case EV\_RFU1:  
> debugPrintLn(F(“EV\_RFU1”));  
> break;  
> case EV\_JOIN\_FAILED:  
> debugPrintLn(F(“EV\_JOIN\_FAILED”));  
> break;  
> case EV\_REJOIN\_FAILED:  
> debugPrintLn(F(“EV\_REJOIN\_FAILED”));  
> break;  
> case EV\_TXCOMPLETE:  
> debugPrintLn(F(“EV\_TXCOMPLETE”));  
> if (LMIC.txrxFlags & TXRX\_ACK)  
> debugPrintLn(F(“R ACK”)); // Received ack  
> if (LMIC.dataLen)  
> {  
> debugPrintLn(F(“R “));  
> debugPrintLn(LMIC.dataLen);  
> debugPrintLn(F(” bytes”)); // of payload  
> }  
> // Schedule next transmission  
> // os\_setTimedCallback(&sendjob, os\_getTime()+sec2osticks(TX\_INTERVAL), do\_send);  
> LMIC\_transmitted = 1;  
> break;  
> case EV\_LOST\_TSYNC:  
> debugPrintLn(F(“EV\_LOST\_TSYNC”));  
> break;  
> case EV\_RESET:  
> debugPrintLn(F(“EV\_RESET”));  
> break;  
> case EV\_RXCOMPLETE:  
> // data received in ping slot  
> debugPrintLn(F(“EV\_RXCOMPLETE”));  
> break;  
> case EV\_LINK\_DEAD:  
> debugPrintLn(F(“EV\_LINK\_DEAD”));  
> break;  
> case EV\_LINK\_ALIVE:  
> debugPrintLn(F(“EV\_LINK\_ALIVE”));  
> break;  
> default:  
> debugPrintLn(F(“Unknown event”));  
> break;  
> }  
> }
> 
> /\*
> 
> - Sendefunktion: Überprüft, ob gerade eine Übertragung stattfindet.
> 
> - Wenn nicht werden die Parameter berechnet und im
> 
> - seriellen Monitor ausgegeben. Anschließend werden die Parameter als Paket
> 
> - in mydata angelegt und so das zu sendende Paket erstellt (Ausgabe "Packet ready).
> 
> - Mit LMIC\_setTxData2() wird das Paket als Sende Daten an den Chip übergeben und anschließend
> 
> - “Packet Queued” ausgegeben.  
> _/  
> void do\_send(osjob\_t_ j)  
> {  
> // Check if there is not a current TX/RX job running  
> if (LMIC.opmode & OP\_TXRXPEND)  
> {  
> debugPrintLn(F(“OP\_TXRXPEND”)); //P\_TXRXPEND, not sending  
> }  
> else  
> {
> 
> /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> - Setup  
> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
> void setup() {  
> Serial.begin(115200); //Baud-Rate, bei seriellem Monitor muss dasselbe eingestellt sein  
> debugPrintLn(F(“\n—Starting—”));
> 
> void loop() {  
> // put your main code here, to run repeatedly:  
> // Start job  
> do\_send(&sendjob);  
> debugPrintLn(F(“do\_send() finished\n”));  
> // Wait for response of the queued message (check if message is send correctly)  
> os\_runloop\_once();  
> debugPrintLn(F(“os\_runloop\_once() finished\n”));
> 
> // Continue until message is transmitted correctly  
> debugPrintLn(“\tWaiting for transmittion\n”);  
> while(LMIC\_transmitted != 1) //Solange keine Übertragung abgeschlossen wurde (EC\_TXCOMPLETE im Monitor), wird gewartet. Nach 60s Abbruch  
> {  
> os\_runloop\_once();  
> // Add timeout counter when nothing happens:  
> LMIC\_event\_Timeout++;  
> delay(1000);  
> if (LMIC\_event\_Timeout \>= 60)  
> {  
> // Timeout when there’s no “EV\_TXCOMPLETE” event after 60 seconds  
> debugPrintLn(F(“\tETimeout, msg not tx\n”));  
> break;  
> }  
> }
> 
> ```
> //Übetragung wurde abgeschlossen, da while() verlassen, Parameter zurücksetzen
> LMIC_transmitted = 0;
> LMIC_event_Timeout = 0;
> 
> //debugPrintLn(F("Going to sleep."));
> delay(1000); // allow serial to send.
> 
> for (int i = 0; i < interval; i++)
> {  
> i +=7 ; // no normal 1 second run but 8 second loops m.      
> // Enter power down state for 8 s with ADC and BOD module disabled
> LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);   
> }  
> debugPrintLn("--- LOOP END ---");
> 
> ```
> 
> }

The Serial Monitor:  
10:27:48.896 → —Starting—  
10:27:48.896 → Setup complete  
10:27:49.922 → T=10.00  
10:27:49.922 → P=0.00  
10:27:49.922 → H=25.00  
10:27:49.922 → B=31  
10:27:49.922 → BV=31  
10:27:49.922 → Packet ready  
10:27:49.922 →   
10:27:49.969 → 67046: 17  
10:27:49.969 → Unknown event  
10:27:49.969 → Pac⸮  
10:27:51.472 → —Starting—

Has anybody here an Idea how to solve this?

Thanks for the support! 🙂

---

<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:** [August 23, 2021, 3:19pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-pro-mini-rfm95-data-transmission-aborted/50893/2 "2021-08-23T15:19:33Z")

</div>

Please specify exactly which LMiC repo you used, and at what head / version.

Generally it’s going to be challenging to get this to work on a pro mini, as up to date version like MCCI LMiC probably won’t fit.

---

<div class="post-metadata">

**Author:** ![PROE\_WS\_LT](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/proe_ws_lt/32/35697_2.png) [@PROE\_WS\_LT](https://www.thethingsnetwork.org/forum/u/PROE_WS_LT)\
**Post date:** [August 28, 2021, 12:41pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-pro-mini-rfm95-data-transmission-aborted/50893/3 "2021-08-28T12:41:00Z")

</div>

I use the MCCI LoRaWAN LMIC library. In the README is written that at least Arduino IDE 1.6.6 is required. So is it even possible to get this running on Arduino Pro mini?

---

<div class="post-metadata">

**Author:** ![al1fch](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/al1fch/32/46861_2.png) [@al1fch](https://www.thethingsnetwork.org/forum/u/al1fch)\
**Post date:** [August 28, 2021, 8:14pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-pro-mini-rfm95-data-transmission-aborted/50893/4 "2021-08-28T20:14:06Z")

</div>

For information

Board Arduino Pro Mini with ‘out of the box’ bootloader  
Transceiver : SX1276, RFM95…  
Library : MCCI Catena LMIC V4.0.0 [https://github.com/mcci-catena/arduino-lmic](https://github.com/mcci-catena/arduino-lmic)  
IDE Arduino 1.8.15

Code : _ttn-otaa.ino_, unmodified (except FILLME datas and LMIC\_CLOCK\_ERROR ).  
No sleep mode used

Runs OK on TheThing Stack and gives :

> ```
> Le croquis utilise 24744 octets (80%) de l'espace de stockage de programmes. Le maximum est de 30720 octets.
> 
> ```
> 
> Les variables globales utilisent 1517 octets (74%) de mémoire dynamique, ce qui laisse 531 octets pour les variables locales

So , not much space left for own additionnal code but ‘it works’ with recent LMIC library w Pro Mini 🙂

With sleep mode ?  
OK again (Pro Mini and same V4.0.0.LMIC libray) with Jack Gruber’s Code on PlatformIO :  
[https://github.com/JackGruber/Arduino-Pro-Mini-LoRa-Sensor-Node](https://github.com/JackGruber/Arduino-Pro-Mini-LoRa-Sensor-Node)

---

<div class="post-metadata">

**Author:** ![PROE\_WS\_LT](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/proe_ws_lt/32/35697_2.png) [@PROE\_WS\_LT](https://www.thethingsnetwork.org/forum/u/PROE_WS_LT)\
**Post date:** [September 27, 2021, 10:36am UTC](https://www.thethingsnetwork.org/forum/t/arduino-pro-mini-rfm95-data-transmission-aborted/50893/5 "2021-09-27T10:36:47Z")

</div>

Hi together,

I solved the problem. Thanks for the hint with the library. I’m using the IBM LMIC framework and now I’m only using 89% of the storage space, so that’ better.  
But the actual problem was that the wiring had a sometimes loose contact because of the connectors we used. We changed everything to a breadboard and now the code is running fine.

Thanks for the support! 🙂
