MeshCoreTel-firmware icon indicating copy to clipboard operation
MeshCoreTel-firmware copied to clipboard

[Feature/Support]: Add support DIY ESP32-S3 N16R8 + E22P-868M30S

Open PavelSpLAsH opened this issue 6 months ago • 7 comments

Summary

Hello. I want to build a MeshCore node based on ESP32-S3 N16R8 and module E22P-868M30S

Please add the official firmware version for the E22P-868M30S (there is already one for the E22)

Thank you!

PavelSpLAsH avatar May 06 '26 23:05 PavelSpLAsH

It is impossible to add a board without knowing its exact wiring schema and hardware configuration, specifically which pins are responsible for what. Furthermore, without having the physical hardware on hand, it is impossible to test whether the build actually works. I can only add a new board if you provide a full configuration that works fine for you. For example, see Issue #1 (and I have no idea how is your board different from that one). Additionally, I would like to add only DIY boards that are built using popular, publicly available schemas, rather than entirely custom setups.

VBart avatar May 15 '26 14:05 VBart

I managed to run it with these parameters. mqtt has not worked yet. In remote access to the node, on the command line, for requests related to mqtt, it was given - ?? or an unknown command. With these changes, everything worked. I may have added something unnecessary, sorry. I'm quite new to this.

variants/diy_esp32s3_n16r8_e22_back2back/platformio.ini

board = diy_esp32s3_n16r8_e22_back2back
build_flags =
  ${esp32_base.build_flags}
  ${sensor_base.build_flags}
  -I variants/diy_esp32s3_n16r8_e22_back2back
  -D DIY_ESP32S3_N16R8_E22_Back2back
  -D USE_SX1262
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D P_LORA_DIO_1=14
  -D P_LORA_NSS=46
  -D P_LORA_RESET=12
  -D P_LORA_BUSY=13
  -D P_LORA_SCLK=9
  -D P_LORA_MISO=11
  -D P_LORA_MOSI=10
+  -D SX126X_TXEN=47
+  -D P_LORA_EN=48
+  -D SX126X_RXEN=RADIOLIB_NC
+  -D LORA_TX_POWER=22 ; 
+  -D MAX_LORA_TX_POWER=30 ; 
  -D P_LORA_TX_LED=2 ; free pin (led TX)
  -D PIN_BOARD_SDA=5
  -D PIN_BOARD_SCL=4
  -D PIN_USER_BTN=1 ;  free pin (none Button key)
  -D PIN_GPS_RX=3 ; free pin (none GPS)
  -D PIN_GPS_TX=8 ; free pin (none GPS)
  -D SX126X_DIO2_AS_RF_SWITCH=true
  -D SX126X_DIO3_TCXO_VOLTAGE=1.8
  -D SX126X_CURRENT_LIMIT=140
  -D SX126X_RX_BOOSTED_GAIN=1
build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/diy_esp32s3_n16r8_e22_back2back>
  +<helpers/sensors>
  +<helpers/mqtt/*.cpp>
lib_deps =
  ${esp32_base.lib_deps}
  ${sensor_base.lib_deps}

[env:DIY_ESP32S3_N16R8_E22_Back2back_repeater]
extends = DIY_ESP32S3_N16R8_E22_Back2back
build_flags =
  ${DIY_ESP32S3_N16R8_E22_Back2back.build_flags}
  -D ADVERT_NAME='"DIY ESP32S3 N16R8 E22 Back2back Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
  -D WITH_MQTT_UPLINK=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${DIY_ESP32S3_N16R8_E22_Back2back.build_src_filter}
  +<helpers/web/*.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${DIY_ESP32S3_N16R8_E22_Back2back.lib_deps}
  ${esp32_ota.lib_deps}

MeshCoreTel-firmware-main/src/helpers/ESP32Board.h

#ifdef P_LORA_TX_LED
    pinMode(P_LORA_TX_LED, OUTPUT);
    digitalWrite(P_LORA_TX_LED, LOW);
#endif

+ #ifdef P_LORA_EN
+    pinMode(P_LORA_EN, OUTPUT);
+    digitalWrite(P_LORA_EN, HIGH); 
+ #endif

#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
   #if PIN_BOARD_SDA >= 0 && PIN_BOARD_SCL >= 0
    Wire.begin(PIN_BOARD_SDA, PIN_BOARD_SCL);
   #endif
#else
    Wire.begin();
#endif
  }

PavelSpLAsH avatar May 18 '26 08:05 PavelSpLAsH

I am ready to help with testing.

PavelSpLAsH avatar May 18 '26 08:05 PavelSpLAsH

I don't like the idea of building multiple variants of N16R8+E22P-868M30S.

Btw:

build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/diy_esp32s3_n16r8_e22_back2back>
  +<helpers/sensors>
+  +<helpers/mqtt/*.cpp>
lib_deps =
  ${esp32_base.lib_deps}
  ${sensor_base.lib_deps}

[env:DIY_ESP32S3_N16R8_E22_Back2back_repeater]
extends = DIY_ESP32S3_N16R8_E22_Back2back
build_flags =
  ${DIY_ESP32S3_N16R8_E22_Back2back.build_flags}
  -D ADVERT_NAME='"DIY ESP32S3 N16R8 E22 Back2back Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
+  -D WITH_MQTT_UPLINK=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${DIY_ESP32S3_N16R8_E22_Back2back.build_src_filter}
+  +<helpers/web/*.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${DIY_ESP32S3_N16R8_E22_Back2back.lib_deps}
  ${esp32_ota.lib_deps}

These changes are just wrong. You've edited the wrong file. The firmware is build using configuration from variants/eastmesh_mqtt/platformio.ini and you just duplicated them here.

VBart avatar May 18 '26 14:05 VBart

Without these lines, MQTT wouldn't work for me.

Currently, no one has an official firmware version that supports the E22P-868M30S module, so I had to experiment on my own. I'm no expert, and the fact that I managed to get it working is already a great achievement for me.

If you think adding a separate firmware version for the E22P is impractical, I completely understand and won't insist.

PavelSpLAsH avatar May 18 '26 15:05 PavelSpLAsH

Without these lines, MQTT wouldn't work for me.

What command have you used to build it? Have you followed the instructions?

VBart avatar May 18 '26 15:05 VBart

I was building the firmware through "project tasks" and did not see that the repeater_mqtt task is below. Flashed DIY_ESP32S3_N16R8_E22_Back2back_repeater_mqtt, mqtt works without adding to variants/diy_esp32s3_n16r8_e22_back2back/platformio.ini

+<helpers/mqtt/.cpp> -D WITH_MQTT_UPLINK=1 +<helpers/web/.cpp>

I'm sorry, my mistake, I was inattentive.

Cause Image

PavelSpLAsH avatar May 18 '26 18:05 PavelSpLAsH