Closed Luddi96 closed 1 month ago
Debug mode output Enabled, however no additional output.
You are not enabling the debug mode - the wiki page specifies how to do it, either do it in BuildOptUser.h, or define it in your build system. If you are using Arduino IDE, the former is probably easier for you. My guess is that you are probably not using the correct SPI bus, butr that is something that you will need to clarify with the manufacturer.
One crucial piece of information would be your wiring: did you connect 18/19 to your serial monitor, or 20/21?
One crucial piece of information would be your wiring: did you connect 18/19 to your serial monitor, or 20/21?
I am using a USB/UART bridge, connected to pins 20/21
You are not enabling the debug mode - the wiki page specifies how to do it, either do it in BuildOptUser.h, or define it in your build system. If you are using Arduino IDE, the former is probably easier for you.
Ah sorry, missed that. With the debugging turned on, I get this during compile:
note: '#pragma message: RadioLib Info Version: "6.6.0.0" Platform: "ESP32" Compiled: "Jun 25 2024" "20:38:26"' 56 | #pragma message(RADIOLIB_INFO)
And serial output for #define RADIOLIB_DEBUG_BASIC:
[SX1262] Initializing ... RLB_DBG: RadioLib Info Version: "6.6.0.0" Platform: "ESP32" Compiled: "Jun 25 2024" "20:38:29"
Or for #define RADIOLIB_DEBUG_SPI:
[SX1262] Initializing ...
I am pretty sure I have double-checked the pinning according to the datasheet and adjusted NRS, RESET, DIO, BUSY. Is there a way to change the MISO, MOSI, SCK pins as well? Or what are the defaults used for ESP32?
I have found another person with those settings and another library have success. `#define USE_SX1262
Here's the catch: you connected to a different serial port than the usual Serial: the normal Serial is connected to 18/19, while 20/21 is either USBSerial or you need to define USB_MODE=1 and USB_CDC_ON_BOOT=1 or whatever the exact flag is - Google is your friend. So either you enable those two flags, or route the DEBUG_PORT to USBSerial in BuildOpt(User).h. Hoping that I didn't make a mistake... :)
Interesting, I thought it was the other way around.. How come I get some debug information then, from the #define RADIOLIB_DEBUG_BASIC, but not from the #define RADIOLIB_DEBUG_BASIC?
Also, can you give me a hint, where I can find the default MISO/MOSI/SCK pins or where I can change them?
Thank you very much already for the fast and clear responses so far!
The output "[SX1262] Initializing ..." is not from debug, but from Serial.print() in the sketch. So none of the debug output is coming through. I have a sketch already for the CT62 but not at my desk. Will send the missing part for SPI here when possible.
I think I found a fix:
I edited line 95-97 in ArduinoHal.cpp
void inline ArduinoHal::spiBegin() { spi->begin(10,6,7,8); }
Now SPI Debug gives:
Initializing ... RLB_SPI: CMDW 80 RLB_SPI: SI 0 RLB_SPI: SO AA AA RLB_SPI: CMDW 80 RLB_SPI: SI 0 RLB_SPI: SO A2 A2 RLB_SPI: CMDR 1D 3 20 RLB_SPI: SI 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 RLB_SPI: SO A2 A2 A2 A2 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 0 RLB_SPI: CMDW 80 RLB_SPI: SI 0 RLB_SPI: SO AA AA RLB_SPI: CMDW 80 RLB_SPI: SI 0
And the example works as wanted:
[SX1262] Received packet! [SX1262] Data: Hello World! [SX1262] RSSI: -19.00 dBm [SX1262] SNR: 10.75 dB [SX1262] Sending another packet ... transmission finished!
Is or will there be any official way to change the MISO,MOSI, etc. pins? I would like to use this library as the base for a open source project and it would suck to need to tell every user to edit the base library manually...
Good to see your debug output is all good.
& I'm slightly confused by my own sketch, but I assume I've done it right:
#include <RadioLib.h>
#include <SPI.h>
SX1262 radio = new Module(8, 3, 5, 4);
void setup() {
Serial.begin(115200);
SPI.begin(10, 6, 7);
Serial.print(F("[SX1262] Initializing ... "));
int state = radio.begin();
}
Let me know if it works this way, but I'd at least expect (10, 6, 7, 8)
instead of just (10, 6, 7)
, no clue why I did what I did there.
Ahh yes this works too! Very nice, thank you!
So the solution once again, for anyone trying to use a HT-CT62 with this library:
Select ESP32 C3 Dev Module as Board
Set
SX1262 radio = new Module(8, 3, 5, 4);
And do
SPI.begin(10, 6, 7);
before calling radio.begin();
Also you will probably need to call with the correct frequency settings...
868MHz:
radio.begin(868.0, 125.0, 9, 7, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, 10, 8, 1.8, false);
The pinout of the HT-CT62:
Pin Name on SX1262 | Pin Name on C3 | Physical Pin on C3 | GPIO Number on C3 |
---|---|---|---|
MISO | MTCK | 12 | 6 |
MOSI | MTDO | 13 | 7 |
SCK | GPIO10 | 16 | 10 |
NSS | GPIO8 | 14 | 8 |
RST | MTDI | 10 | 5 |
DIO1 | GPIO3 | 8 | 3 |
BUSY | MTMS | 9 | 4 |
Sketch that is causing the module fail
Hardware setup Heltec HT-CT62 Module on breakout PCB
Debug mode output Enabled, however no additional output. Only thing I get is [SX1262] Initializing ... After that, no more information on the serial port..
Additional info (please complete): Using the HT-CT62 Module. It is a combined ESP32-C3 and SX1262 chip See internal schematic here: https://resource.heltec.cn/download/HT-CT62/HT-CT62_Schematic_Diagram.pdf And pinout here: https://heltec.org/project/ht-ct62/
Arduino set to ESP32 C3 Dev Module