# Adafruit M0 with LoRa, data is not transmitted periodically

**URL:** <https://www.thethingsnetwork.org/forum/t/adafruit-m0-with-lora-data-is-not-transmitted-periodically/64241>\
**Category:** LMIC\
**Created:** [August 7, 2023, 5:57am UTC](https://www.thethingsnetwork.org/forum/t/adafruit-m0-with-lora-data-is-not-transmitted-periodically/64241 "2023-08-07T05:57:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![parkchanyeong](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/p/90ced4/32.png) [@parkchanyeong](https://www.thethingsnetwork.org/forum/u/parkchanyeong)\
**Post date:** [August 7, 2023, 5:57am UTC](https://www.thethingsnetwork.org/forum/t/adafruit-m0-with-lora-data-is-not-transmitted-periodically/64241/1 "2023-08-07T05:57:07Z")

</div>

My code is as below.  
I wrote the code for sending data every five minutes, but the COMPLETE code didn’t come up at all  
Is there a problem with my code?  
#include \<lmic.h\>  
#include \<hal/hal.h\>  
#include \<SPI.h\>  
#include \<Arduino.h\> // required before wiring\_private.h  
#include “wiring\_private.h” // pinPeripheral() function  
#include \<PMS.h\>

#define DEVICE\_1\_CHANNEL\_FREQUENCY 922100000 // Frequency for Device 1 (in Hz)  
#define DEVICE\_1\_DR\_RANGE\_MAP DR\_RANGE\_MAP(DR\_SF12, DR\_SF7) // Data rate range for Device 1  
#define ContinueMode 0  
#define PollingMode 1

String value\_convert(String value);

static const u1\_t PROGMEM APPEUI[8] = { 0x25, 0xDE, 0xB2, 0x9A, 0xFF, 0xD9, 0xE0, 0x9E };  
void os\_getArtEui (u1\_t\* buf) { memcpy\_P(buf, APPEUI, 8); }  
// This should also be in little endian format  
static const u1\_t PROGMEM DEVEUI[8] = { 0x52, 0x00, 0x06, 0xD0, 0x7E, 0xD5, 0xB3, 0x70 };  
void os\_getDevEui (u1\_t\* buf) { memcpy\_P(buf, DEVEUI, 8); }  
// This key should be in big endian format  
static const u1\_t PROGMEM APPKEY[16] = { 0x92, 0x92, 0x4E, 0x98, 0xB0, 0x7B, 0xC6, 0x45, 0x7F, 0x71, 0x97, 0xBE, 0x76, 0xC6, 0x0B, 0x6F };  
void os\_getDevKey (u1\_t\* buf) { memcpy\_P(buf, APPKEY, 16); }

static uint8\_t mydata[50] = “\0”;  
static osjob\_t sendjob;  
// Schedule TX every this many seconds (might become longer due to duty  
// cycle limitations).  
const unsigned TX\_INTERVAL = 300;  
// Pin mapping  
const lmic\_pinmap lmic\_pins = {  
.nss = 8,  
.rxtx = LMIC\_UNUSED\_PIN,  
.rst = LMIC\_UNUSED\_PIN,  
.dio = {3, 5, LMIC\_UNUSED\_PIN},  
};

Uart Serial2(&sercom5, A5, 6, SERCOM\_RX\_PAD\_0, UART\_TX\_PAD\_2);  
void SERCOM5\_Handler()  
{  
Serial2.IrqHandler();  
}

//no2  
Uart Serial3(&sercom1, 12, 10, SERCOM\_RX\_PAD\_3, UART\_TX\_PAD\_2);  
void SERCOM1\_Handler()  
{  
Serial3.IrqHandler();  
}  
//so2  
Uart Serial4(&sercom0, A4, A3, SERCOM\_RX\_PAD\_1, UART\_TX\_PAD\_0);  
void SERCOM0\_Handler()  
{  
Serial4.IrqHandler();  
}

PMS pms(Serial1);  
PMS::DATA data;

char buffer[30];  
char CO\_data[50];  
char NO2\_data[50];  
char SO2\_data[50];  
int dust = 0;

void readData(){  
pms.requestRead();  
if(pms.readUntil(data)){  
dust = data.PM\_AE\_UG\_2\_5;  
}  
#if PollingMode  
Serial2.write(‘\r’);  
Serial3.write(‘\r’);  
Serial4.write(‘\r’);  
delay(1000);  
#else  
delay(100);  
#endif

```
int i = 0;

```

while (Serial2.available()){  
CO\_data[i] = Serial2.read();  
i++;  
}  
i = 0;  
while (Serial3.available()){  
NO2\_data[i] = Serial3.read();  
i++;  
}  
i = 0;  
while (Serial4.available()){  
SO2\_data[i] = Serial4.read();  
i++;  
}  
delay(100);  
String str\_co\_data = “”;  
String str\_no2\_data = “”;  
String str\_so2\_data = “”;

for(int j = 12; j \< 18; j++){  
str\_co\_data += CO\_data[j];  
str\_no2\_data += NO2\_data[j];  
str\_so2\_data += SO2\_data[j];  
}  
String dustData, coPPB, no2PPB, so2PPB;  
dustData = String(dust);  
coPPB = value\_convert(str\_co\_data);  
no2PPB = value\_convert(str\_no2\_data);  
so2PPB = value\_convert(str\_so2\_data);  
snprintf(mydata, sizeof(mydata), “%s,%s,%s,%s,%s”, dustData.c\_str(), coPPB.c\_str(), no2PPB.c\_str(), so2PPB.c\_str());  
}

void onEvent (ev\_t ev) {  
Serial.print(os\_getTime());  
Serial.print(": ");  
switch(ev) {  
case EV\_SCAN\_TIMEOUT:  
Serial.println(F(“EV\_SCAN\_TIMEOUT”));  
break;  
case EV\_BEACON\_FOUND:  
Serial.println(F(“EV\_BEACON\_FOUND”));  
break;  
case EV\_BEACON\_MISSED:  
Serial.println(F(“EV\_BEACON\_MISSED”));  
break;  
case EV\_BEACON\_TRACKED:  
Serial.println(F(“EV\_BEACON\_TRACKED”));  
break;  
case EV\_JOINING:  
Serial.println(F(“EV\_JOINING”));  
break;  
case EV\_JOINED:  
Serial.println(F(“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”));  
break;  
case EV\_JOIN\_FAILED:  
Serial.println(F(“EV\_JOIN\_FAILED”));  
break;  
case EV\_REJOIN\_FAILED:  
Serial.println(F(“EV\_REJOIN\_FAILED”));  
break;  
break;  
case EV\_TXCOMPLETE:  
Serial.println(F(“EV\_TXCOMPLETE (includes waiting for RX windows)”));  
if (LMIC.txrxFlags & TXRX\_ACK)  
Serial.println(F(“Received ack”));  
if (LMIC.dataLen) {  
Serial.println(F(“Received “));  
Serial.println(LMIC.dataLen);  
Serial.println(F(” bytes of payload”));  
}  
// Schedule next transmission  
os\_setTimedCallback(&sendjob, os\_getTime()+sec2osticks(TX\_INTERVAL), do\_send);  
break;  
case EV\_LOST\_TSYNC:  
Serial.println(F(“EV\_LOST\_TSYNC”));  
break;  
case EV\_RESET:  
Serial.println(F(“EV\_RESET”));  
break;  
case EV\_RXCOMPLETE:  
// data received in ping slot  
Serial.println(F(“EV\_RXCOMPLETE”));  
break;  
case EV\_LINK\_DEAD:  
Serial.println(F(“EV\_LINK\_DEAD”));  
break;  
case EV\_LINK\_ALIVE:  
Serial.println(F(“EV\_LINK\_ALIVE”));  
break;  
default:  
Serial.println(F(“Unknown event”));  
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”));  
} else {  
// Prepare upstream data transmission at the next possible time.  
LMIC\_setTxData2(1, mydata, sizeof(mydata)-1, 0);  
Serial.println(F(“Packet queued”));  
}  
// Next TX is scheduled after TX\_COMPLETE event.  
}  
void setup() {  
Serial.begin(9600);  
Serial1.begin(9600);  
Serial2.begin(9600);  
Serial3.begin(9600);  
Serial4.begin(9600);

```
  //co
pinPeripheral(6, PIO_SERCOM);
pinPeripheral(A5, PIO_SERCOM_ALT);
//no2
pinPeripheral(10, PIO_SERCOM);
pinPeripheral(12, PIO_SERCOM);
//so2
pinPeripheral(17ul, PIO_SERCOM_ALT);
pinPeripheral(18ul, PIO_SERCOM_ALT);
//pms
pinPeripheral(1, PIO_SERCOM_ALT);
pinPeripheral(0, PIO_SERCOM_ALT);

pms.passiveMode();

// LMIC init
os_init();
// Reset the MAC state. Session and pending data transfers will be discarded.
LMIC_reset();
LMIC_setDrTxpow(DR_SF7, 14);
LMIC_setupChannel(0, DEVICE_1_CHANNEL_FREQUENCY, DEVICE_1_DR_RANGE_MAP, BAND_CENTI);
readData();
// Start job (sending automatically starts OTAA too)
do_send(&sendjob);

```

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

String value\_convert(String value){  
int start = value.indexOf(‘,’) + 1; // 시작 인덱스  
int end = value.indexOf(‘,’, start); // 끝 인덱스

// 쉼표와 쉼표 사이의 값  
String con\_value = value.substring(start, end);  
//int convalue = con\_value.toInt();  
return con\_value;  
}  
 ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/7/e/7e26d3d066699408c197e2e5d2f20387e0711406.png)

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [August 7, 2023, 7:36am UTC](https://www.thethingsnetwork.org/forum/t/adafruit-m0-with-lora-data-is-not-transmitted-periodically/64241/2 "2023-08-07T07:36:42Z")

</div>

The comment about seconds is wrong, it’s in ms, so you are trying to send every 300ms.

Set it to `(5 * 60 * 1000)` which will make it super clear what you are aiming for.

---

<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:** [August 7, 2023, 9:28am UTC](https://www.thethingsnetwork.org/forum/t/adafruit-m0-with-lora-data-is-not-transmitted-periodically/64241/3 "2023-08-07T09:28:52Z")

</div>

> [@parkchanyeong](#):
>
> ```auto
> LMIC_reset();
> LMIC_setDrTxpow(DR_SF7, 14);
> LMIC_setupChannel(0, DEVICE_1_CHANNEL_FREQUENCY, DEVICE_1_DR_RANGE_MAP, BAND_CENTI);
> readData();
> 
> ```

Only one channel ?

---

<div class="post-metadata">

**Author:** ![parkchanyeong](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/p/90ced4/32.png) [@parkchanyeong](https://www.thethingsnetwork.org/forum/u/parkchanyeong)\
**Post date:** [August 7, 2023, 11:21am UTC](https://www.thethingsnetwork.org/forum/t/adafruit-m0-with-lora-data-is-not-transmitted-periodically/64241/4 "2023-08-07T11:21:11Z")

</div>

I changed the code as below, but the data can only be transmitted once…  
#include \<lmic.h\>  
#include \<hal/hal.h\>  
#include \<SPI.h\>  
#include \<Arduino.h\> // required before wiring\_private.h  
#include “wiring\_private.h” // pinPeripheral() function  
#include \<PMS.h\>  
#include “DFRobot\_OzoneSensor.h”  
#define ContinueMode 0  
#define PollingMode 1  
#define TX\_INTERVAL 300000 // Time interval in seconds  
#define COLLECT\_NUMBER 20  
#define Ozone\_IICAddress OZONE\_ADDRESS\_3  
//function  
String value\_convert(String value);  
//co  
Uart Serial2(&sercom5, A5, 6, SERCOM\_RX\_PAD\_0, UART\_TX\_PAD\_2);  
void SERCOM5\_Handler()  
{  
Serial2.IrqHandler();  
}  
//no2  
Uart Serial3(&sercom1, 12, 10, SERCOM\_RX\_PAD\_3, UART\_TX\_PAD\_2);  
void SERCOM1\_Handler()  
{  
Serial3.IrqHandler();  
}  
//so2  
Uart Serial4(&sercom0, A4, A3, SERCOM\_RX\_PAD\_1, UART\_TX\_PAD\_0);  
void SERCOM0\_Handler()  
{  
Serial4.IrqHandler();  
}  
//dust  
PMS pms(Serial1);  
PMS::DATA data;  
DFRobot\_OzoneSensor Ozone;  
//variable  
char buffer[30];  
char CO\_data[50];  
char NO2\_data[50];  
char SO2\_data[50];  
int dust = 0;  
// This EUI must be in little-endian format, see the comments in your code  
static const u1\_t PROGMEM APPEUI[8] = { 0x57, 0x74, 0xD8, 0x7B, 0x21, 0xD7, 0xCA, 0x1E };  
void os\_getArtEui (u1\_t\* buf) { memcpy\_P(buf, APPEUI, 8); }  
// This should also be in little endian format  
static const u1\_t PROGMEM DEVEUI[8] = { 0xEF, 0xFC, 0x05, 0xD0, 0x7E, 0xD5, 0xB3, 0x70 };  
void os\_getDevEui (u1\_t\* buf) { memcpy\_P(buf, DEVEUI, 8); }  
// This key should be in big endian format  
static const u1\_t PROGMEM APPKEY[16] = { 0xDF, 0xE0, 0xEE, 0x5F, 0x67, 0x2A, 0xB5, 0xCE, 0x7C, 0x9C, 0xD5, 0x65, 0x22, 0x96, 0xF8, 0x95 };  
void os\_getDevKey (u1\_t\* buf) { memcpy\_P(buf, APPKEY, 16); }  
static osjob\_t sendjob;  
// Pin mapping  
const lmic\_pinmap lmic\_pins = {  
.nss = 8,  
.rxtx = LMIC\_UNUSED\_PIN,  
.rst = LMIC\_UNUSED\_PIN,  
.dio = {3, 5, LMIC\_UNUSED\_PIN},  
};  
void onEvent (ev\_t ev) {  
// Serial.print(os\_getTime());  
// Serial.print(": ");  
switch(ev) {  
case EV\_SCAN\_TIMEOUT:  
Serial.println(F(“EV\_SCAN\_TIMEOUT”));  
break;  
case EV\_BEACON\_FOUND:  
Serial.println(F(“EV\_BEACON\_FOUND”));  
break;  
case EV\_BEACON\_MISSED:  
Serial.println(F(“EV\_BEACON\_MISSED”));  
break;  
case EV\_BEACON\_TRACKED:  
Serial.println(F(“EV\_BEACON\_TRACKED”));  
break;  
case EV\_JOINING:  
Serial.println(F(“EV\_JOINING”));  
break;  
case EV\_JOINED:  
Serial.println(F(“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”));  
break;  
case EV\_JOIN\_FAILED:  
Serial.println(F(“EV\_JOIN\_FAILED”));  
break;  
case EV\_REJOIN\_FAILED:  
Serial.println(F(“EV\_REJOIN\_FAILED”));  
break;  
break;  
case EV\_TXCOMPLETE:  
Serial.println(F(“EV\_TXCOMPLETE (includes waiting for RX windows)”));  
if (LMIC.txrxFlags & TXRX\_ACK)  
Serial.println(F(“Received ack”));  
if (LMIC.dataLen) {  
Serial.println(F(“Received “));  
Serial.println(LMIC.dataLen);  
Serial.println(F(” bytes of payload”));  
}  
// Schedule next transmission  
os\_setTimedCallback(&sendjob, os\_getTime()+sec2osticks(TX\_INTERVAL), do\_send);  
break;  
case EV\_LOST\_TSYNC:  
Serial.println(F(“EV\_LOST\_TSYNC”));  
break;  
case EV\_RESET:  
Serial.println(F(“EV\_RESET”));  
break;  
case EV\_RXCOMPLETE:  
// data received in ping slot  
Serial.println(F(“EV\_RXCOMPLETE”));  
break;  
case EV\_LINK\_DEAD:  
Serial.println(F(“EV\_LINK\_DEAD”));  
break;  
case EV\_LINK\_ALIVE:  
Serial.println(F(“EV\_LINK\_ALIVE”));  
break;  
default:  
// Serial.println(F(“Unknown event”));  
break;  
}  
}  
void do\_send(osjob\_t\* j) {  
char mydata[100];  
// Check if there is not a current TX/RX job running  
if (LMIC.opmode & OP\_TXRXPEND) {  
Serial.println(F(“OP\_TXRXPEND, not sending”));  
} else {  
// Prepare upstream data transmission at the next possible time.  
pms.requestRead();  
if (pms.readUntil(data)) {  
dust = data.PM\_AE\_UG\_2\_5;  
}  
#if PollingMode  
Serial2.write(‘\r’);  
Serial3.write(‘\r’);  
Serial4.write(‘\r’);  
delay(1000);  
#else  
delay(100);  
#endif  
int i = 0;  
while (Serial2.available()) {  
CO\_data[i] = Serial2.read();  
i++;  
}  
i = 0;  
while (Serial3.available()) {  
NO2\_data[i] = Serial3.read();  
i++;  
}  
i = 0;  
while (Serial4.available()) {  
SO2\_data[i] = Serial4.read();  
i++;  
}  
int16\_t ozoneConcentration = Ozone.readOzoneData(COLLECT\_NUMBER);  
delay(100);  
/\*for(int e = 0; e \< 50; e++){  
Serial.print(CO\_data[e]);  
}  
Serial.println();  
_/  
String str\_co\_data = “”;  
String str\_no2\_data = “”;  
String str\_so2\_data = “”;  
for (int loopIdx = 12; loopIdx \< 18; loopIdx++) {  
str\_co\_data += CO\_data[loopIdx];  
str\_no2\_data += NO2\_data[loopIdx];  
str\_so2\_data += SO2\_data[loopIdx];  
}  
String dustData, coPPB, no2PPB, so2PPB, allData;  
 [//Serial.println](https://Serial.println)(str\_co\_data);  
dustData = String(dust);  
coPPB = value\_convert(str\_co\_data);  
no2PPB = value\_convert(str\_no2\_data);  
so2PPB = value\_convert(str\_so2\_data);  
Serial.println(ozoneConcentration);  
String ozone = String(ozoneConcentration);  
Serial.println(ozone);  
//allData = dustData + ’ ’ + coPPB + ’ ’ + no2PPB + ’ ’ + so2PPB;  
 [//Serial.println](https://Serial.println)(allData);  
snprintf(mydata, sizeof(mydata), “%s,%s,%s,%s,%s”, dustData.c\_str(), coPPB.c\_str(), no2PPB.c\_str(), so2PPB.c\_str(),ozone.c\_str());  
LMIC\_setTxData2(1, (uint8\_t_)mydata, strlen(mydata), 0);  
// Serial.println(F(“Packet queued”));  
// Serial.println(mydata);  
Serial.println(“send”); // 데이터를 보냈을 때 시리얼에 "send"를 출력  
}  
// Schedule next transmission  
// os\_setTimedCallback(j, os\_getTime() + sec2osticks(TX\_INTERVAL), do\_send);  
// Next TX is scheduled after TX\_COMPLETE event.  
// TX\_COMPLETE 이벤트 이후에 다음 전송이 예약됩니다.  
}  
void setup() {  
Serial.begin(9600);  
Serial1.begin(9600);  
Serial2.begin(9600);  
Serial3.begin(9600);  
Serial4.begin(9600);  
//co  
pinPeripheral(6, PIO\_SERCOM);  
pinPeripheral(A5, PIO\_SERCOM\_ALT);  
//no2  
pinPeripheral(10, PIO\_SERCOM);  
pinPeripheral(12, PIO\_SERCOM);  
//so2  
pinPeripheral(17ul, PIO\_SERCOM\_ALT);  
pinPeripheral(18ul, PIO\_SERCOM\_ALT);  
//pms  
pinPeripheral(1, PIO\_SERCOM\_ALT);  
pinPeripheral(0, PIO\_SERCOM\_ALT);  
pms.passiveMode();  
while(!Ozone.begin(Ozone\_IICAddress)) {  
Serial.println(“I2c device number error !”);  
delay(1000);  
} Serial.println(“I2c connect success !”);  
Ozone.setModes(MEASURE\_MODE\_PASSIVE);  
// delay(1000);  
// Serial.println(F(“Starting”));  
// LMIC init  
os\_init();  
// Reset the MAC state. Session and pending data transfers will be discarded.  
LMIC\_reset();  
//LMIC\_selectSubBand(1);  
LMIC\_setClockError(MAX\_CLOCK\_ERROR \* 1 / 100);  
// Start job (sending automatically starts OTAA too)  
// 초기 전송 작업 수행  
do\_send(&sendjob);  
}  
void loop() {  
os\_runloop\_once();  
}  
//function definition  
String value\_convert(String value){  
int start = value.indexOf(‘,’) + 1; // 시작 인덱스  
int end = value.indexOf(‘,’, start); // 끝 인덱스  
// 쉼표와 쉼표 사이의 값  
String con\_value = value.substring(start, end);  
//int convalue = con\_value.toInt();  
return con\_value;  
}

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [August 7, 2023, 12:05pm UTC](https://www.thethingsnetwork.org/forum/t/adafruit-m0-with-lora-data-is-not-transmitted-periodically/64241/5 "2023-08-07T12:05:44Z")

</div>

Please edit your code to only include the changes, tell us what indicates it can send only once and format the code block & logs with the \</\> tools on the toolbar.

---

<div class="post-metadata">

**Author:** ![parkchanyeong](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/p/90ced4/32.png) [@parkchanyeong](https://www.thethingsnetwork.org/forum/u/parkchanyeong)\
**Post date:** [August 8, 2023, 5:30am UTC](https://www.thethingsnetwork.org/forum/t/adafruit-m0-with-lora-data-is-not-transmitted-periodically/64241/6 "2023-08-08T05:30:18Z")

</div>

I’m sorry that I couldn’t ask a detailed question and provide the data.  
Currently, the above question is still being attempted.  
Before that, I saw a post in Feather M0 LoRa saying that you need to connect DI01 and D6 to use TTN.  
 ![1](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/e/7/e7bd68551b7dc851013a7349fc5c42cad2277f35.jpeg)

The source of the text is "[GitHub - werktag/m0-lorawan-ttn: Adafruit Feather m0 LoRa on The Things Network](https://github.com/werktag/m0-lorawan-ttn) ".

![2](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/2/e/2ef87e6dce8ec3c52177203983f7d5109999fe3a.jpeg)

> **[Adafruit Feather M0 Radio with LoRa Radio Module](https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module/pinouts)**
>
> This is the Adafruit Feather M0 RFM95 LoRa Radio (433 or 900 MHz) - our take on an microcontroller with a "Long Range (LoRa)" packet radio transceiver with built in USB and battery charging. Its an Adafruit Feather M0 with a Long Range radio module...

Below is the Pinmap of the father M0 LoRa.  
I don’t know why it’s D6.

Can you tell me why?

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [August 8, 2023, 8:02am UTC](https://www.thethingsnetwork.org/forum/t/adafruit-m0-with-lora-data-is-not-transmitted-periodically/64241/7 "2023-08-08T08:02:42Z")

</div>

> [@parkchanyeong](#):
>
> The source of the text is "[GitHub - werktag/m0-lorawan-ttn: Adafruit Feather m0 LoRa on The Things Network](https://github.com/werktag/m0-lorawan-ttn) ".

I’d use the official Adafruit instructions, particularly as that repro is 5 years old and broken links!

> [@parkchanyeong](#):
>
> I don’t know why it’s D6.

Because that’s the one you set in the pin map. Or not, as you haven’t or have used some other random source of LMIC and left it as is. The official version has the pin map set correctly for you.

But you’ll still need to read the instructions for LMIC, it’s not something you can just do out the box - or you use LMIC-node which has the very best instructions which you’ll still need to read.

And it would be good to edit your post above with the \</\> tool please.
