From 31059a780b91965bccf32d450bc7cb043ba7696f Mon Sep 17 00:00:00 2001 From: Lemonochrme Date: Mon, 2 Dec 2024 16:24:33 +0100 Subject: [PATCH] Test RN2483A LoRa module --- README.md | 4 ++++ platformio.ini | 7 ++----- src/main.cpp | 44 +++++++++++++++++++++----------------------- 3 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a2e35fc --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ + +Response from "sys get ver" command : +RN2483 1.0.5 Oct 31 2018 15:06:52 + diff --git a/platformio.ini b/platformio.ini index e0e7fb9..96fff1d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,8 +11,5 @@ [env:esp32dev] platform = espressif32 board = esp32dev -framework = arduino -lib_deps = - olikraus/U8g2@^2.36.2 - adafruit/Adafruit SSD1306@^2.5.13 - adafruit/Adafruit GFX Library@^1.11.11 +monitor_speed = 115200 +framework = arduino \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index d93db82..12bef06 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,32 +1,30 @@ #include -#include -#include -#include +#include -#define SCREEN_WIDTH 128 -#define SCREEN_HEIGHT 64 -#define SSD1306_ADDR 0x3C - -Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); +HardwareSerial mySerial(0); // Use UART0 (RX0, TX0) void setup() { - Serial.begin(115200); + Serial.begin(115200); // Initialize Serial Monitor + mySerial.begin(57600); // Initialize RN2483A Serial communication - if(!display.begin(SSD1306_SWITCHCAPVCC, SSD1306_ADDR)) { - Serial.println(F("SSD1306 allocation failed")); - for(;;); + Serial.println("Testing RN2483A module..."); + + // Send a command to the RN2483A module + mySerial.println("sys get ver"); + + // Wait for a response + delay(1000); + + // Read the response from the RN2483A module + while (mySerial.available()) { + String response = mySerial.readString(); + Serial.println("RN2483A Response: " + response); } - delay(2000); - display.clearDisplay(); - - display.setTextSize(1); - display.setTextColor(WHITE); - display.setCursor(0, 10); - // Display static text - display.println("Hello, world!"); - display.display(); } void loop() { - -} + // Idle loop + mySerial.begin(115200); + Serial.println("Idle..."); + delay(1000); +} \ No newline at end of file