Skip to content

Commit 21ea63b

Browse files
committed
feat: Added EByte EoRa Pi
1 parent 3ef2aa6 commit 21ea63b

File tree

4 files changed

+257
-0
lines changed

4 files changed

+257
-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: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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+
-D PIN_OLED_RESET=21
21+
22+
; SD_DAT0/MISO - GPIO2
23+
; SD_DAT1 - GPIO4
24+
; SD_CMD/MOSI - GPIO11
25+
; SD_DAT2 - GPIO112
26+
; SD_DAT3/CS - GPIO113
27+
; SD_CLK - GPIO114
28+
29+
-D SX126X_DIO2_AS_RF_SWITCH=true
30+
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
31+
-D SX126X_CURRENT_LIMIT=140
32+
-D RADIO_CLASS=CustomSX1262
33+
-D WRAPPER_CLASS=CustomSX1262Wrapper
34+
-D LORA_TX_POWER=22
35+
-D SX126X_RX_BOOSTED_GAIN=1
36+
build_src_filter = ${esp32_base.build_src_filter}
37+
+<../variants/ebyte_eora_s3>
38+
lib_deps =
39+
${esp32_base.lib_deps}
40+
adafruit/Adafruit SSD1306 @ ^2.5.13
41+
42+
; === EByte EORA_S3 with SX1262 environments ===
43+
[env:Ebyte_EoRa-S3_Repeater]
44+
extends = Ebyte_EoRa-S3
45+
build_flags =
46+
${Ebyte_EoRa-S3.build_flags}
47+
-D DISPLAY_CLASS=SSD1306Display
48+
-D ADVERT_NAME='"EORA_S3-1262 Repeater"'
49+
-D ADVERT_LAT=0.0
50+
-D ADVERT_LON=0.0
51+
-D ADMIN_PASSWORD='"password"'
52+
-D MAX_NEIGHBOURS=8
53+
; -D MESH_PACKET_LOGGING=1
54+
; -D MESH_DEBUG=1
55+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
56+
+<helpers/ui/SSD1306Display.cpp>
57+
+<../examples/simple_repeater>
58+
lib_deps =
59+
${Ebyte_EoRa-S3.lib_deps}
60+
${esp32_ota.lib_deps}
61+
62+
[env:Ebyte_EoRa-S3_terminal_chat]
63+
extends = Ebyte_EoRa-S3
64+
build_flags =
65+
${Ebyte_EoRa-S3.build_flags}
66+
-D MAX_CONTACTS=300
67+
-D MAX_GROUP_CHANNELS=1
68+
; -D MESH_PACKET_LOGGING=1
69+
; -D MESH_DEBUG=1
70+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
71+
+<../examples/simple_secure_chat/main.cpp>
72+
lib_deps =
73+
${Ebyte_EoRa-S3.lib_deps}
74+
densaugeo/base64 @ ~1.4.0
75+
76+
[env:Ebyte_EoRa-S3_room_server]
77+
extends = Ebyte_EoRa-S3
78+
build_flags =
79+
${Ebyte_EoRa-S3.build_flags}
80+
-D DISPLAY_CLASS=SSD1306Display
81+
-D ADVERT_NAME='"EORA_S3-1262 Room"'
82+
-D ADVERT_LAT=0.0
83+
-D ADVERT_LON=0.0
84+
-D ADMIN_PASSWORD='"password"'
85+
-D ROOM_PASSWORD='"hello"'
86+
; -D MESH_PACKET_LOGGING=1
87+
; -D MESH_DEBUG=1
88+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
89+
+<helpers/ui/SSD1306Display.cpp>
90+
+<../examples/simple_room_server>
91+
lib_deps =
92+
${Ebyte_EoRa-S3.lib_deps}
93+
${esp32_ota.lib_deps}
94+
95+
[env:Ebyte_EoRa-S3_companion_radio_usb]
96+
extends = Ebyte_EoRa-S3
97+
build_flags =
98+
${Ebyte_EoRa-S3.build_flags}
99+
-I examples/companion_radio/ui-new
100+
-D DISPLAY_CLASS=SSD1306Display
101+
-D MAX_CONTACTS=300
102+
-D MAX_GROUP_CHANNELS=8
103+
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
104+
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
105+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
106+
+<helpers/ui/SSD1306Display.cpp>
107+
+<helpers/ui/MomentaryButton.cpp>
108+
+<../examples/companion_radio/*.cpp>
109+
+<../examples/companion_radio/ui-new/*.cpp>
110+
lib_deps =
111+
${Ebyte_EoRa-S3.lib_deps}
112+
densaugeo/base64 @ ~1.4.0
113+
114+
[env:Ebyte_EoRa-S3_companion_radio_ble]
115+
extends = Ebyte_EoRa-S3
116+
build_flags =
117+
${Ebyte_EoRa-S3.build_flags}
118+
-I examples/companion_radio/ui-new
119+
-D DISPLAY_CLASS=SSD1306Display
120+
-D MAX_CONTACTS=300
121+
-D MAX_GROUP_CHANNELS=8
122+
-D BLE_PIN_CODE=123456
123+
-D BLE_DEBUG_LOGGING=1
124+
-D OFFLINE_QUEUE_SIZE=256
125+
; -D MESH_PACKET_LOGGING=1
126+
; -D MESH_DEBUG=1
127+
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
128+
+<helpers/esp32/*.cpp>
129+
+<helpers/ui/SSD1306Display.cpp>
130+
+<helpers/ui/MomentaryButton.cpp>
131+
+<../examples/companion_radio/*.cpp>
132+
+<../examples/companion_radio/ui-new/*.cpp>
133+
lib_deps =
134+
${Ebyte_EoRa-S3.lib_deps}
135+
densaugeo/base64 @ ~1.4.0

variants/ebyte_eora_s3/target.cpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#include <Arduino.h>
2+
#include "target.h"
3+
4+
ESP32Board board;
5+
6+
static SPIClass spi;
7+
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi);
8+
WRAPPER_CLASS radio_driver(radio, board);
9+
10+
ESP32RTCClock fallback_clock;
11+
AutoDiscoverRTCClock rtc_clock(fallback_clock);
12+
SensorManager sensors;
13+
14+
#ifdef DISPLAY_CLASS
15+
DISPLAY_CLASS display;
16+
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
17+
#endif
18+
19+
#ifndef LORA_CR
20+
#define LORA_CR 5
21+
#endif
22+
23+
bool radio_init() {
24+
fallback_clock.begin();
25+
rtc_clock.begin(Wire);
26+
27+
return radio.std_init(&spi);
28+
}
29+
30+
uint32_t radio_get_rng_seed() {
31+
return radio.random(0x7FFFFFFF);
32+
}
33+
34+
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) {
35+
radio.setFrequency(freq);
36+
radio.setSpreadingFactor(sf);
37+
radio.setBandwidth(bw);
38+
radio.setCodingRate(cr);
39+
}
40+
41+
void radio_set_tx_power(uint8_t dbm) {
42+
radio.setOutputPower(dbm);
43+
}
44+
45+
mesh::LocalIdentity radio_new_identity() {
46+
RadioNoiseListener rng(radio);
47+
return mesh::LocalIdentity(&rng); // create new random identity
48+
}

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)