TTGO LORA32 868Mhz - CayenneLPP

Hi Guys

Please can I get some assistance.
I would like to integrate Cayenne LPP onto my TTGO LORA32.
In The below code I need to modify Serial1.

Link to the product:
2Pcs LILYGO® TTGO LORA32 868Mhz ESP32 LoRa OLED 0.96 Inch Blue Display bluetooth WIFI ESP-32 Development Board Module With Antenna Sale - Banggood USA sold out-arrival notice

#include <TheThingsNetwork.h>
#include <CayenneLPP.h>

// Set your AppEUI and AppKey
const char appEui = "************************";
const char *appKey = “**************************”;

#define loraSerial Serial1
#define debugSerial Serial

// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
#define freqPlan TTN_FP_EU868

TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
CayenneLPP lpp(51);

void setup()
{
loraSerial.begin(57600);
debugSerial.begin(9600);

// Wait a maximum of 10s for Serial Monitor
while (!debugSerial && millis() < 10000)
;

debugSerial.println(“-- STATUS”);
ttn.showStatus();

debugSerial.println(“-- JOIN”);
ttn.join(appEui, appKey);
}

void loop()
{
debugSerial.println(“-- LOOP”);

lpp.reset();
lpp.addTemperature(1, 22.5);
lpp.addBarometricPressure(2, 1073.21);
lpp.addGPS(3, 52.37365, 4.88650, 2);

// Send it off
ttn.sendBytes(lpp.getBuffer(), lpp.getSize());

delay(10000);
}

you will need to use code similar to this https://github.com/ElectronicCats/CayenneLPP/blob/master/examples/WeatherStation_LMIC/WeatherStation_LMIC.ino

Thank you Shramik, I got it working :slight_smile:

2 Likes