Which board for Lora+sensors?

Hello there

I got a SX1262 module and a sensor that I would like to connect to a board and power it with a Lipo 3.7v battery(with a buckboost in between).

So the board need to be able to be powered with 3.3v, connect to an sx1262 and one or two environmental sensors. Also with pins to sit on a breadboard.

I have two Arduino ESP32 and two Nano Mattee on the way, thought to use the matter boards for Lora but I wonder if I made a bad decision.

Which board would you have used for this setup?

I don't know the other board, but the ESP32 is not a bad choice.

had no problems driving a SX1262 module from ESP32 and ESP32S3 microcontrollers
what specific SX1262 nodule do you have?
what sensors are you planning to use?
are you planning to use LoRa P2P or LoRaWAN?
which libraries are you considering?
e.g. for LoRa P2P I would use RadioLib

I found small ESP32-C6 that will fit well. I’m going to start with P2P, don’t know if I’ll need more, and use DHT22 as a start.

which specific ESP32C6 module are you using? give a link?
you need to know the SPI pins for your ESP32C6 module
you can run Finding your ESP32 Board’s Default SPI Pins but it depends on which Tools>Board you have selected - I tend to use ESP32C6 Dev Module
otherwise check you boards pinout diagram

It’s a ESP32-C6-Zero, it seems to have lots of options.

And a Core1262-868M Waveshare.

try running the Finding your ESP32 Board’s Default SPI Pins program referenced in post 5
running it on my ESP32C6_Dev_Board with Tools>Board selecting ESP32C6 Dev Board it prints

MOSI: 19
MISO: 20
SCK: 21
SS: 18
SDA: 23
SCL: 22

the Waveshare ESP32-C6-Zero has GPIOs 18 thru 21 for connecting the SX1262 SPI
you will also need to connect SX1262 DIO1, NRST and BUSY pins - I would suggest trying GPIO 14, 15 and 22

I assume you have two LoRa modules for testing the P2P communications? what is the other LoRa module?

never used a DHT22 - I tend to use a bme280-pressure-temperature-humidity sensor

Connected a SX1262 to a ESP32C6_Dev_Board
using RadioLib library SX126x_Transmit_Interrupt example

// ESP32C6_Dev_Board SX1262 LoRa P2P Transmit_Interrupt

// File>Examples>RadioLib>SX126x>SX126x_Transmit_Interrupt

// EDITs:
//  radio.begin frequency set to 868.0
//  transmitting byte array and printing it

/*
  RadioLib SX126x Transmit with Interrupts Example

  This example transmits LoRa packets with one second delays
  between them. Each packet contains up to 256 bytes
  of data, in the form of:
  - Arduino String
  - null-terminated char array (C-string)
  - arbitrary binary data (byte array)

  Other modules from SX126x family can also be used.

  For default module settings, see the wiki page
  https://github.com/jgromes/RadioLib/wiki/Default-configuration#sx126x---lora-modem

  For full API reference, see the GitHub Pages
  https://jgromes.github.io/RadioLib/
*/

// include the library
#include <RadioLib.h>

// ESP32C6 GPIOs to SX1262 has the following connections:
// MOSI: 19
// MISO: 20
// SCK:  21
#define NSS  18
#define DIO1 10
#define NRST 11
#define BUSY 15
SX1262 radio = new Module(NSS, DIO1, NRST, BUSY);   // SS DIO1 NRST BUSY

// or detect the pinout automatically using RadioBoards
// https://github.com/radiolib-org/RadioBoards
/*
#define RADIO_BOARD_AUTO
#include <RadioBoards.h>
Radio radio = new RadioModule();
*/

// save transmission state between loops
int transmissionState = RADIOLIB_ERR_NONE;

// flag to indicate that a packet was sent
volatile bool transmittedFlag = false;

// this function is called when a complete packet
// is transmitted by the module
// IMPORTANT: this function MUST be 'void' type
//            and MUST NOT have any arguments!
#if defined(ESP8266) || defined(ESP32)
ICACHE_RAM_ATTR
#endif
void setFlag(void) {
  // we sent a packet, set the flag
  transmittedFlag = true;
}

void setup() {
  Serial.begin(115200);
  delay(2000);
  // initialize SX1262 with default settings
  Serial.print(F("\n\nESP32C6 [SX1262] Initializing ... "));
  int state = radio.begin(868.0);
  if (state == RADIOLIB_ERR_NONE) {
    Serial.println(F("success!"));
  } else {
    Serial.print(F("failed, code "));
    Serial.println(state);
    while (true) { delay(10); }
  }

  // set the function that will be called
  // when packet transmission is finished
  radio.setPacketSentAction(setFlag);

  // start transmitting the first packet
  Serial.print(F("[SX1262] Sending first packet ... "));

  // you can transmit C-string or Arduino string up to
  // 256 characters long
  transmissionState = radio.startTransmit("Hello World!");

  // you can also transmit byte array up to 256 bytes long
  /*
    byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
                      0x89, 0xAB, 0xCD, 0xEF};
    state = radio.startTransmit(byteArr, 8);
  */
}

// counter to keep track of transmitted packets
int count = 0;

void loop() {
  // check if the previous transmission finished
  if (transmittedFlag) {
    // reset flag
    transmittedFlag = false;

    if (transmissionState == RADIOLIB_ERR_NONE) {
      // packet was successfully sent
      Serial.println(F("transmission finished!"));

      // NOTE: when using interrupt-driven transmit method,
      //       it is not possible to automatically measure
      //       transmission data rate using getDataRate()

    } else {
      Serial.print(F("failed, code "));
      Serial.println(transmissionState);
    }

    // clean up after transmission is finished
    // this will ensure transmitter is disabled,
    // RF switch is powered down etc.
    radio.finishTransmit();

    // wait a second before transmitting again
    delay(1000);

    // send another one
    Serial.print(F("[SX1262] Sending another packet ... "));

    // you can transmit C-string or Arduino string up to
    // 256 characters long
    //String str = "Hello World! #" + String(count++);
    //transmissionState = radio.startTransmit(str);

    // you can also transmit byte array up to 256 bytes long
    static byte byteArr[] = { 0x01, 0x23, 0x45, 0x67,
                              0x89, 0xAB, 0xCD, 0xEF };
    for (int i = 0; i < sizeof(byteArr); i++)
      Serial.printf("%d ", byteArr[i]);
    transmissionState = radio.startTransmit(byteArr, 8);
    byteArr[0]++;
  }
}

ESP32C6 transmitter output

ESP32C6 [SX1262] Initializing ... success!
[SX1262] Sending first packet ... transmission finished!
[SX1262] Sending another packet ... 1 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 2 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 3 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 4 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 5 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 6 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 7 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 8 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 9 35 69 103 137 171 205 239 transmission finished!

Heltec LoRa V3 receiver output

Heltec LoRa V3 [SX1262] Initializing ... success!
[SX1262] Starting to listen ... success!
[SX1262] Received packet!
[SX1276] Data:          1 35 69 103 137 171 205 239
[SX1262] RSSI:          -35.00 dBm
[SX1262] SNR:           10.75 dB
[SX1262] Frequency error:       -664.56 Hz
[SX1262] Received packet!
[SX1276] Data:          2 35 69 103 137 171 205 239
[SX1262] RSSI:          -34.00 dBm
[SX1262] SNR:           11.25 dB
[SX1262] Frequency error:       -668.44 Hz
[SX1262] Received packet!
[SX1276] Data:          3 35 69 103 137 171 205 239
[SX1262] RSSI:          -33.00 dBm
[SX1262] SNR:           10.75 dB
[SX1262] Frequency error:       -664.56 Hz
[SX1262] Received packet!
[SX1276] Data:          4 35 69 103 137 171 205 239
[SX1262] RSSI:          -34.00 dBm
[SX1262] SNR:           10.50 dB
[SX1262] Frequency error:       -664.56 Hz
[SX1262] Received packet!
[SX1276] Data:          5 35 69 103 137 171 205 239
[SX1262] RSSI:          -33.00 dBm
[SX1262] SNR:           11.00 dB
[SX1262] Frequency error:       -664.56 Hz
[SX1262] Received packet!
[SX1276] Data:          6 35 69 103 137 171 205 239
[SX1262] RSSI:          -33.00 dBm
[SX1262] SNR:           10.75 dB
[SX1262] Frequency error:       -664.56 Hz
[SX1262] Received packet!
[SX1276] Data:          7 35 69 103 137 171 205 239
[SX1262] RSSI:          -33.00 dBm
[SX1262] SNR:           10.50 dB
[SX1262] Frequency error:       -664.56 Hz
[SX1262] Received packet!
[SX1276] Data:          8 35 69 103 137 171 205 239
[SX1262] RSSI:          -33.00 dBm
[SX1262] SNR:           10.75 dB
[SX1262] Frequency error:       -664.56 Hz
[SX1262] Received packet!
[SX1276] Data:          9 35 69 103 137 171 205 239
[SX1262] RSSI:          -35.00 dBm
[SX1262] SNR:           10.75 dB
[SX1262] Frequency error:       -664.56 Hz

photo of ESP32C6