I have a TTGO LORA32 T3 V1.6.1 board that I'm trying to setup to 1) receive a signal from a separate board that's setup as a LORA transmitter and 2) transmit that signal back out via Bluetooth. For now, I'm working with just a "Hello World" message; I've gone through the documentation and added what I believe is the correct code to do this (below). The code compiles fine, uploads fine, and everything seems to operate with no errors. Problem is, any device that I then try to use to "see" and connect to the TTGO as a Bluetooth device just can't see it (have tried my iphone, laptop, bluetooth serial app on phone, etc.).
No issues with the LoRa side of the code, that all works fine. And I do see the "The device is now ready to pair for Bluetooth" message come through via the serial monitor. I feel like I'm missing something obvious...any help is appreciated!
#include <SPI.h>
#include <LoRa.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "BluetoothSerial.h"
//LORA pins
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
#define DIO0 26
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run 'make menuconfig' to and enable it
#endif
BluetoothSerial SerialBT;
void setup() {
//Initialize Serial & Bluetooth
Serial.begin(115200);
Serial.println("Serial port initialized.");
SerialBT.begin("ESP32test");
Serial.println("The device is now ready to pair for Bluetooth");
// Initialize LORA
SPI.begin(SCK, MISO, MOSI, SS);
LoRa.setPins(SS, RST, DIO0);
if (!LoRa.begin(915E6)) {
delay(1000);
Serial.println("LoRa initialization failed.");
delay(1000);
while (1);
}
else {
delay(1000);
Serial.println("LoRa initialized.");
delay(1000);
}
}
void loop() {
int packetSize = LoRa.parsePacket();
if (packetSize) {
while (LoRa.available()) {
String receivedMessage = LoRa.readString();
Serial.print("Received: ");
Serial.println(receivedMessage);
}
SerialBT.println(packetSize);
}
}