Skip to content

Commit 8ddabfc

Browse files
authored
Merge pull request #783 from sschueller/eora-s3
feat: Added EByte EoRa-S3-XXXTB Support #740
2 parents 9ba8d6f + ded8178 commit 8ddabfc

File tree

4 files changed

+295
-0
lines changed

4 files changed

+295
-0
lines changed

boards/ebyte_eora-s3.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "esp32s3_out.ld",
5+
"partitions": "default.csv",
6+
"memory_type": "qio_qspi"
7+
},
8+
"core": "esp32",
9+
"extra_flags": [
10+
"-DARDUINO_LILYGO_T3_S3_V1_X",
11+
"-DBOARD_HAS_PSRAM",
12+
"-DARDUINO_USB_CDC_ON_BOOT=1",
13+
"-DARDUINO_RUNNING_CORE=1",
14+
"-DARDUINO_EVENT_RUNNING_CORE=1",
15+
"-DARDUINO_USB_MODE=1"
16+
],
17+
"f_cpu": "240000000L",
18+
"f_flash": "80000000L",
19+
"flash_mode": "qio",
20+
"mcu": "esp32s3",
21+
"variant": "esp32s3"
22+
},
23+
"connectivity": [
24+
"wifi"
25+
],
26+
"debug": {
27+
"openocd_target": "esp32s3.cfg"
28+
},
29+
"frameworks": [
30+
"arduino",
31+
"espidf"
32+
],
33+
"name": "Ebyte EoRa-S3-XXXTB Radio",
34+
"upload": {
35+
"flash_size": "4MB",
36+
"maximum_ram_size": 327680,
37+
"maximum_size": 4194304,
38+
"use_1200bps_touch": true,
39+
"wait_for_upload_port": true,
40+
"require_upload_port": true,
41+
"speed": 460800
42+
},
43+
"url": "https://www.cdebyte.com/products/EoRa-S3-900TB",
44+
"vendor": "Chengdu Ebyte Electronic Technology Co., Ltd"
45+
}
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
[Ebyte_EoRa-S3]
2+
extends = esp32_base
3+
board = ebyte_eora-s3
4+
build_flags =
5+
${esp32_base.build_flags}
6+
-I variants/ebyte_eora_s3
7+
-D EBYTE_EORA_S3
8+
-D P_LORA_DIO_1=33
9+
-D P_LORA_NSS=7
10+
-D P_LORA_RESET=8 ; RADIOLIB_NC
11+
-D P_LORA_BUSY=34
12+
-D P_LORA_SCLK=5
13+
-D P_LORA_MISO=3
14+
-D P_LORA_MOSI=6
15+
-D P_LORA_TX_LED=37
16+
-D PIN_VBAT_READ=1
17+
-D PIN_USER_BTN=0
18+
-D PIN_BOARD_SDA=18
19+
-D PIN_BOARD_SCL=17
20+
21+
; SD_DAT0/MISO - GPIO2
22+
; SD_DAT1 - GPIO4
23+
; SD_CMD/MOSI - GPIO11
24+
; SD_DAT2 - GPIO112
25+
; SD_DAT3/CS - GPIO113
26+
; SD_CLK - GPIO114
27+
-D PIN_BOARD_SDA=18
28+
-D PIN_BOARD_SCL=17
29+
30+
-D SX126X_DIO2_AS_RF_SWITCH=true
31+
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
32+
-D SX126X_CURRENT_LIMIT=140
33+
-D RADIO_CLASS=CustomSX1262
34+
-D WRAPPER_CLASS=CustomSX1262Wrapper
35+
-D LORA_TX_POWER=22
36+
-D SX126X_RX_BOOSTED_GAIN=1
37+
build_src_filter = ${esp32_base.build_src_filter}
38+
+<../variants/ebyte_eora_s3>
39+
lib_deps =
40+
${esp32_base.lib_deps}
41+
adafruit/Adafruit SSD1306 @ ^2.5.13
42+
43+
; === EByte EORA_S3 with SX1262 environments ===
44+
[env:Ebyte_EoRa-S3_Repeater]
45+
extends = Ebyte_EoRa-S3
46+
build_flags =
47+
${Ebyte_EoRa-S3.build_flags}
48+
-D DISPLAY_CLASS=SSD1306Display
49+
-D ADVERT_NAME='"EORA_S3-1262 Repeater"'
50+
-D ADVERT_LAT=0.0
51+
-D ADVERT_LON=0.0
52+
-D ADMIN_PASSWORD='"password"'
53+
-D MAX_NEIGHBOURS=8
54+
; -D MESH_PACKET_LOGGING=1
55+
; -D MESH_DEBUG=1
56+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
57+
+<helpers/ui/SSD1306Display.cpp>
58+
+<../examples/simple_repeater>
59+
lib_deps =
60+
${Ebyte_EoRa-S3.lib_deps}
61+
${esp32_ota.lib_deps}
62+
63+
[env:Ebyte_EoRa-S3_terminal_chat]
64+
extends = Ebyte_EoRa-S3
65+
build_flags =
66+
${Ebyte_EoRa-S3.build_flags}
67+
-D MAX_CONTACTS=300
68+
-D MAX_GROUP_CHANNELS=1
69+
; -D MESH_PACKET_LOGGING=1
70+
; -D MESH_DEBUG=1
71+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
72+
+<../examples/simple_secure_chat/main.cpp>
73+
lib_deps =
74+
${Ebyte_EoRa-S3.lib_deps}
75+
densaugeo/base64 @ ~1.4.0
76+
77+
[env:Ebyte_EoRa-S3_room_server]
78+
extends = Ebyte_EoRa-S3
79+
build_flags =
80+
${Ebyte_EoRa-S3.build_flags}
81+
-D DISPLAY_CLASS=SSD1306Display
82+
-D ADVERT_NAME='"EORA_S3-1262 Room"'
83+
-D ADVERT_LAT=0.0
84+
-D ADVERT_LON=0.0
85+
-D ADMIN_PASSWORD='"password"'
86+
-D ROOM_PASSWORD='"hello"'
87+
; -D MESH_PACKET_LOGGING=1
88+
; -D MESH_DEBUG=1
89+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
90+
+<helpers/ui/SSD1306Display.cpp>
91+
+<../examples/simple_room_server>
92+
lib_deps =
93+
${Ebyte_EoRa-S3.lib_deps}
94+
${esp32_ota.lib_deps}
95+
96+
[env:Ebyte_EoRa-S3_companion_radio_usb]
97+
extends = Ebyte_EoRa-S3
98+
build_flags =
99+
${Ebyte_EoRa-S3.build_flags}
100+
-I examples/companion_radio/ui-new
101+
-D DISPLAY_CLASS=SSD1306Display
102+
-D MAX_CONTACTS=300
103+
-D MAX_GROUP_CHANNELS=8
104+
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
105+
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
106+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
107+
+<helpers/ui/SSD1306Display.cpp>
108+
+<helpers/ui/MomentaryButton.cpp>
109+
+<../examples/companion_radio/*.cpp>
110+
+<../examples/companion_radio/ui-new/*.cpp>
111+
lib_deps =
112+
${Ebyte_EoRa-S3.lib_deps}
113+
densaugeo/base64 @ ~1.4.0
114+
115+
[env:Ebyte_EoRa-S3_companion_radio_ble]
116+
extends = Ebyte_EoRa-S3
117+
build_flags =
118+
${Ebyte_EoRa-S3.build_flags}
119+
-I examples/companion_radio/ui-new
120+
-D DISPLAY_CLASS=SSD1306Display
121+
-D MAX_CONTACTS=300
122+
-D MAX_GROUP_CHANNELS=8
123+
-D BLE_PIN_CODE=123456
124+
-D BLE_DEBUG_LOGGING=1
125+
-D OFFLINE_QUEUE_SIZE=256
126+
; -D MESH_PACKET_LOGGING=1
127+
; -D MESH_DEBUG=1
128+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
129+
+<helpers/esp32/*.cpp>
130+
+<helpers/ui/SSD1306Display.cpp>
131+
+<helpers/ui/MomentaryButton.cpp>
132+
+<../examples/companion_radio/*.cpp>
133+
+<../examples/companion_radio/ui-new/*.cpp>
134+
lib_deps =
135+
${Ebyte_EoRa-S3.lib_deps}
136+
densaugeo/base64 @ ~1.4.0

variants/ebyte_eora_s3/target.cpp

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#include <Arduino.h>
2+
#include "target.h"
3+
4+
ESP32Board board;
5+
6+
#if defined(P_LORA_SCLK)
7+
static SPIClass spi;
8+
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi);
9+
#else
10+
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY);
11+
#endif
12+
13+
WRAPPER_CLASS radio_driver(radio, board);
14+
15+
ESP32RTCClock fallback_clock;
16+
AutoDiscoverRTCClock rtc_clock(fallback_clock);
17+
SensorManager sensors;
18+
19+
#ifdef DISPLAY_CLASS
20+
DISPLAY_CLASS display;
21+
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
22+
#endif
23+
24+
#ifndef LORA_CR
25+
#define LORA_CR 5
26+
#endif
27+
28+
bool radio_init() {
29+
fallback_clock.begin();
30+
rtc_clock.begin(Wire);
31+
32+
#ifdef SX126X_DIO3_TCXO_VOLTAGE
33+
float tcxo = SX126X_DIO3_TCXO_VOLTAGE;
34+
#else
35+
float tcxo = 1.6f;
36+
#endif
37+
38+
#if defined(P_LORA_SCLK)
39+
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
40+
#endif
41+
int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 8, tcxo);
42+
if (status != RADIOLIB_ERR_NONE) {
43+
Serial.print("ERROR: radio init failed: ");
44+
Serial.println(status);
45+
return false; // fail
46+
}
47+
48+
radio.setCRC(1);
49+
50+
#if defined(SX126X_RXEN) && defined(SX126X_TXEN)
51+
radio.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
52+
#endif
53+
54+
#ifdef SX126X_CURRENT_LIMIT
55+
radio.setCurrentLimit(SX126X_CURRENT_LIMIT);
56+
#endif
57+
#ifdef SX126X_DIO2_AS_RF_SWITCH
58+
radio.setDio2AsRfSwitch(SX126X_DIO2_AS_RF_SWITCH);
59+
#endif
60+
#ifdef SX126X_RX_BOOSTED_GAIN
61+
radio.setRxBoostedGainMode(SX126X_RX_BOOSTED_GAIN);
62+
#endif
63+
64+
return true; // success
65+
}
66+
67+
uint32_t radio_get_rng_seed() {
68+
return radio.random(0x7FFFFFFF);
69+
}
70+
71+
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) {
72+
radio.setFrequency(freq);
73+
radio.setSpreadingFactor(sf);
74+
radio.setBandwidth(bw);
75+
radio.setCodingRate(cr);
76+
}
77+
78+
void radio_set_tx_power(uint8_t dbm) {
79+
radio.setOutputPower(dbm);
80+
}
81+
82+
mesh::LocalIdentity radio_new_identity() {
83+
RadioNoiseListener rng(radio);
84+
return mesh::LocalIdentity(&rng); // create new random identity
85+
}

variants/ebyte_eora_s3/target.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#pragma once
2+
3+
#define RADIOLIB_STATIC_ONLY 1
4+
#include <RadioLib.h>
5+
#include <helpers/radiolib/RadioLibWrappers.h>
6+
#include <helpers/ESP32Board.h>
7+
#include <helpers/radiolib/CustomSX1262Wrapper.h>
8+
#include <helpers/AutoDiscoverRTCClock.h>
9+
#include <helpers/SensorManager.h>
10+
#ifdef DISPLAY_CLASS
11+
#include <helpers/ui/SSD1306Display.h>
12+
#include <helpers/ui/MomentaryButton.h>
13+
#endif
14+
15+
extern ESP32Board board;
16+
extern WRAPPER_CLASS radio_driver;
17+
extern AutoDiscoverRTCClock rtc_clock;
18+
extern SensorManager sensors;
19+
20+
#ifdef DISPLAY_CLASS
21+
extern DISPLAY_CLASS display;
22+
extern MomentaryButton user_btn;
23+
#endif
24+
25+
bool radio_init();
26+
uint32_t radio_get_rng_seed();
27+
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
28+
void radio_set_tx_power(uint8_t dbm);
29+
mesh::LocalIdentity radio_new_identity();

0 commit comments

Comments
 (0)