hi all,
(sry if my english is not correct, i’m not englishmen)
I’have an and i try send/receive datas on service TTN with ide Arduino 2.0 with file example from Librarie de Thethingnetwork.
1 - I’have install esp32 + Oled + librarie TTNET
2 - Use example of librarie TTNET, here sendOTAA.ino with modification , i’m europe/France and i success in upload but i have issue next :
Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x40086134 PS : 0x00060030 A0 : 0x800d1658 A1 : 0x3ffb26d0
A2 : 0x3ffb26e8 A3 : 0x000003aa A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x800d2468 A9 : 0x3ffb2710
A10 : 0x3ffb26e8 A11 : 0x00000003 A12 : 0x00000005 A13 : 0x00060423
A14 : 0x00060420 A15 : 0x00000001 SAR : 0x0000000e EXCCAUSE: 0x0000001c
EXCVADDR: 0x000003aa LBEG : 0x400861d1 LEND : 0x400861e1 LCOUNT : 0xfffffffeBacktrace:0x40086131:0x3ffb26d00x400d1655:0x3ffb26e0 0x400d17a7:0x3ffb2770 0x400d1925:0x3ffb2790 0x400d19a9:0x3ffb27b0 0x400d210f:0x3ffb27d0 0x400d12bb:0x3ffb27f0 0x400d4646:0x3ffb2820
Thanks for help.
My code in below:
#include <TheThingsNetwork.h>
#include <LoRa.h>
#include <string.h>
#include <SPI.h>
// Set your AppEUI and AppKey
//char TappEui[16]= "0C8B95A5818CFEFF";
//char TappKey[32]= "3F4774A3F9227CF4C658262E4683ED3E";
char TappEui[17] = {'0', 'C', '8', 'B' ,'9' ,'5','A', '5', '8', '1', '8', 'C', 'F' ,'E', 'F','F','\0'};
char TappKey[33] = {'3','F','4','7','7','4','A','3','F','9','2','2','7','C','F','4','C','6','5','8','2','6','2','E','4','6','8','3','E','D','3','E', '\0'};
const char *appEui = TappEui;
const char *appKey = TappKey;
#define SCK 5 // GPIO5 -- SX1278's SCK
#define MISO 19 // GPIO19 -- SX1278's MISO
#define MOSI 27 // GPIO27 -- SX1278's MOSI
#define SS 18 // GPIO18 -- SX1278's CS
#define RST 23 // GPIO14 -- SX1278's RESET
#define DI0 26 // GPIO26 -- SX1278's IRQ(Interrupt Request)
//#define loraSerial LoRa
//#define debugSerial Serial
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
#define freqPlan TTN_FP_EU868
TheThingsNetwork ttn(LoRa, Serial, freqPlan);
void setup()
{
//loraSerial.begin(57600);
Serial.begin(9600);
Serial.println("LoRa Receiver Callback");
SPI.begin(SCK,MISO,MOSI,SS);
LoRa.setPins(SS,RST,DI0);
if (!LoRa.begin(868E6)) {
Serial.println("Starting LoRa failed !");
while (1);
}
else Serial.println("Starting LoRa succed" );
// Wait a maximum of 10s for Serial Monitor
while (!Serial && millis() < 10000);
//debugSerial.println("-- STATUS");
//ttn.showStatus();
Serial.println("-- JOIN");
ttn.join(appEui, appKey);
}
void loop()
{
Serial.println("-- LOOP");
// Prepare payload of 1 byte to indicate LED status
byte payload[1];
payload[0] = (digitalRead(LED_BUILTIN) == HIGH) ? 1 : 0;
// Send it off
ttn.sendBytes(payload, sizeof(payload));
delay(10000);
}