Chip-cn-dat/Espressif-dat/ESP8266-DAT/ESP8266-HDK-dat/ESP8266-HDK-dat.md
... ...
@@ -21,6 +21,13 @@ module HDK == [[ESP-12F-DAT]]
21 21
| 8 | XPD_DCDC | IO16 | | | Deep-sleep wakeup (need to be connected to EXT_RSTB); GPIO16 |
22 22
23 23
24
+Hardware SPI Pins (Default)
25
+- MOSI (Master Out Slave In): GPIO13 (NodeMCU D7)
26
+- MISO (Master In Slave Out): GPIO12 (NodeMCU D6)
27
+- SCK (Serial Clock): GPIO14 (NodeMCU D5)
28
+- CS/SS (Chip Select): GPIO15 (NodeMCU D8) - but you can use any GPIO pin for CS
29
+
30
+
24 31
## bootstrap
25 32
26 33
- [[ESP8266-boot-log-dat]]
SDK-dat/arduino-dat/arduino-cli-dat/arduino-cli-dat.md
... ...
@@ -28,6 +28,13 @@ Create a configuration file and a new sketch:
28 28
install boards
29 29
30 30
arduino-cli board list
31
+
32
+
33
+Port Protocol Type Board Name FQBN Core
34
+COM1 serial Serial Port Unknown
35
+COM8 serial Serial Port (USB) LilyGo T-Display esp32:esp32:lilygo_t_display esp32:esp32
36
+
37
+
31 38
arduino-cli core list
32 39
arduino-cli core install arduino:samd
33 40
arduino-cli board listall mkr
... ...
@@ -40,6 +47,8 @@ install boards
40 47
esp8266:esp8266 3.1.2 3.1.2 ESP8266 Boards (3.1.2)
41 48
megaTinyCore:megaavr 2.6.10 2.6.10 megaTinyCore
42 49
50
+
51
+
43 52
board manager
44 53
45 54
board_manager:
... ...
@@ -60,7 +69,18 @@ search and udpate
60 69
ID Version Name
61 70
esp8266:esp8266 2.5.2 esp8266
62 71
63
-compile and upload
72
+
73
+
74
+
75
+## compile and upload
76
+
77
+
78
+ # Generic ESP8266 Module
79
+ arduino-cli compile --fqbn esp8266:esp8266:generic esp8266-SX126x_Transmit
80
+
81
+ arduino-cli compile --fqbn esp32:esp32:lilygo_t_display esp8266-PingPong
82
+
83
+ arduino-cli compile --fqbn esp8266:esp8266 esp8266-PingPong
64 84
65 85
arduino-cli compile --fqbn arduino:samd:mkr1000 MyFirstSketch
66 86
... ...
@@ -86,6 +106,7 @@ upload
86 106
87 107
arduino-cli lib search debouncer
88 108
arduino-cli lib search SSD1306Wire
109
+arduino-cli lib search RadioLib
89 110
90 111
E:\Git-category\Git-Arduino\Arduino-ESP32\BSP\ESP\ESP1000-ESP32-tori>arduino-cli lib search SSD1306Wire
91 112
Name: "SSD1306wire"
... ...
@@ -99,6 +120,9 @@ arduino-cli lib search SSD1306Wire
99 120
Types: Contributed
100 121
Versions: [2.0.1]
101 122
123
+
124
+arduino-cli lib install "RadioLib"
125
+
102 126
arduino-cli lib install FTDebouncer
103 127
104 128
arduino-cli lib install SSD1306Wire
SDK-dat/freertos-dat/freertos-dat.md
... ...
@@ -1,6 +1,24 @@
1 1
2 2
# freertos-dat
3 3
4
+
5
+## freeRTOS debug
6
+
7
+Your sketch is written for ESP32 but you’re compiling it for ESP8266, and that’s why it’s failing.
8
+
9
+Why
10
+
11
+SemaphoreHandle_t, xSemaphoreCreateBinary(), xSemaphoreGive(), xSemaphoreTake(), and portMAX_DELAY are FreeRTOS API calls.
12
+
13
+ESP32 Arduino comes with FreeRTOS by default.
14
+
15
+ESP8266 Arduino does not use FreeRTOS — so those types and functions don’t exist unless you add a separate RTOS layer.
16
+
17
+
18
+
19
+
20
+
21
+
4 22
## ✅ When is it a Good Time to Use FreeRTOS?
5 23
6 24
**FreeRTOS** is a real-time operating system designed for microcontrollers. It lets you split your application into multiple tasks that run seemingly in parallel.
Tech-dat/BTB-dat/12P-BTB-dat/12P-BTB-dat.md
... ...
@@ -23,44 +23,53 @@ https://www.electrodragon.com/w/ED-BTB
23 23
24 24
general wiring
25 25
26
-| ESP8266 | func | conn.L | conn.R | func | ESP8266 |
27
-| ------- | -------- | ------ | ------ | ------------ | ------- |
28
-| io16 | IO0 | L-1 | R-1 | serial / IO5 | TXD |
29
-| io14 | SPI_SCK | L-2 | R-2 | serial / IO4 | RXD |
30
-| io12 | SPI_MISO | L-3 | R-3 | SCL / IO3 | io5 |
31
-| io13 | SPI_MOSI | L-4 | R-4 | SDA / IO2 | io4 |
32
-| +5V | power | L-5 | R-5 | SPI_CS | io15_d |
33
-| 3V3 | power | L-6 | R-6 | power | GND |
26
+
27
+| - | - | - | - | - | - | - |
28
+| ------- | --- | ------------ | ------- | ------- | ---- | ---- |
29
+| func | 3V3 | - | - | - | - | - |
30
+| ESP8266 | 3V3 | 5V / IO0 (u) | io13 | io12 | io14 | io16 |
31
+| conn.T | 1 | 3 | 5 | 7 | 9 | 11 |
32
+| conn.B | 2 | 4 | 6 | 8 | 10 | 12 |
33
+| ESP8266 | GND | io15(d) | io4 (u) | io5 (u) | RXD | TXD |
34
+| func | GND | - | - | - | - | - |
35
+
36
+
34 37
35 38
- 1x 4-line [[SPI-dat]] + 5x [[GPIO-dat]]
36 39
- 1x 4-line [[SPI-dat]] + 1x [[Serial-dat]] + 1x [[I2C-dat]] + 1x [[GPIO-dat]]
37 40
- 1x 4-line [[SPI-dat]] + 1x [[Serial-dat]] + 3x [[GPIO-dat]]
38 41
39
-- [[ESP8266-HDK-dat]]
42
+- [[ESP8266-HDK-dat]] - [[ESP-12F-dat]] - [[SPI-dat]]
40 43
41 44
- [[LORA-HDK-dat]] - [[SX1262-MD1-dat]] - [[SX1262-HDK-dat]] - [[Lora-SDK-dat]]
42 45
43
-wiring for [[SX1262-dat]]
44
-
45
-| ESP8266 | func | conn.L | conn.R | func | ESP8266 |
46
-| ------- | -------- | ------ | ------ | ------ | ------- |
47
-| io16 | BUSY | 11 | 12 | serial | TXD |
48
-| io14 | SPI_SCK | 9 | 10 | serial | RXD |
49
-| io12 | SPI_MISO | 7 | 8 | TXEN | io5 |
50
-| io13 | SPI_MOSI | 5 | 6 | RXEN | io4 |
51
-| IO0 | DIO1_irq | 3 | 4 | SPI_CS | io15_d |
52
-| 3V3 | power | 1 | 2 | power | GND |
53
-
54
-rotate to fit physically
55
-
56
-| | 1 | 2 | 3 | 4 | 5 | 6 |
57
-|----------------|-----------|-----------|-----------|-----------|-----------|-----------|
58
-| ESP8266 | 3V3 | IO0 | io13 | io12 | io14 | io16 |
59
-| func | power | DIO1_irq | SPI_MOSI | SPI_MISO | SPI_SCK | BUSY |
60
-| conn.L | 1 | 3 | 5 | 7 | 9 | 11 |
61
-| conn.R | 2 | 4 | 6 | 8 | 10 | 12 |
62
-| func | power | SPI_CS | RXEN | TXEN | serial | serial |
63
-| ESP8266 | GND | io15_d | io4 | io5 | RXD | TXD |
46
+## wiring for [[SX1262-dat]]
47
+
48
+V2
49
+
50
+| | 1 | 2 | 3 | 4 | 5 | 6 |
51
+| ------- | --- | ------ | -------- | -------- | ------- | ------ |
52
+| func | 3V3 | RESET | SPI_MOSI | SPI_MISO | SPI_SCK | BUSY |
53
+| ESP8266 | 3V3 | IO0 | io13 | io12 | io14 | io16 |
54
+| conn.L | 1 | 3 | 5 | 7 | 9 | 11 |
55
+| conn.R | 2 | 4 | 6 | 8 | 10 | 12 |
56
+| ESP8266 | GND | io15 | io4 | io5 | RXD | TXD |
57
+| func | GND | D1_IRQ | | | serial | serial |
58
+
59
+
60
+V1
61
+
62
+
63
+| | 1 | 2 | 3 | 4 | 5 | 6 |
64
+| ------- | --- | -------- | -------- | -------- | ------- | ------ |
65
+| func | 3V3 | DIO1_irq | SPI_MOSI | SPI_MISO | SPI_SCK | BUSY |
66
+| ESP8266 | 3V3 | IO0 | io13 | io12 | io14 | io16 |
67
+| conn.L | 1 | 3 | 5 | 7 | 9 | 11 |
68
+| conn.R | 2 | 4 | 6 | 8 | 10 | 12 |
69
+| ESP8266 | GND | io15 | io4 | io5 | RXD | TXD |
70
+| func | GND | SPI_CS | RXEN | TXEN | serial | serial |
71
+
72
+
64 73
65 74
## connectors
66 75
Tech-dat/Interface-dat/SPI-dat/SPI-dat.md
... ...
@@ -11,6 +11,25 @@
11 11
| MOSI | | 3-wire SPI |
12 12
| CS | | 4-wire SPI |
13 13
14
+
15
+
16
+For the SX1262, the NSS pin (chip select) is active low TTL.
17
+
18
+Meaning:
19
+
20
+- Idle (not selected): NSS = HIGH
21
+- Active (selected): NSS = LOW
22
+- Level logic: 3.3 V high, 0 V low (since SX1262 is a 3.3 V device — do not feed it 5 V).
23
+
24
+From Semtech SX1262 datasheet:
25
+
26
+- NSS is internally pulled high by default.
27
+- Every SPI transaction starts when NSS goes low and ends when NSS goes high.
28
+- All SPI data must be clocked while NSS is low.
29
+
30
+
31
+
32
+
14 33
## ref
15 34
16 35
- [[interface-dat]] - [[ref-design-dat]]
... ...
\ No newline at end of file
Tech-dat/Network-dat/RF-dat/LORA-DAT/Lora-SDK-dat/Lora-SDK-dat.md
... ...
@@ -1,5 +1,7 @@
1 1
# Lora-SDK-dat
2 2
3
+- [[Lora-HDK-dat]] - [[12P-BTB-dat]]
4
+
3 5
## network ID and address
4 6
5 7
For LoRa coding, the network ID and address (often called device address or node address) are typically set in the software/firmware of the device, not in the data payload or by hardware switches.
... ...
@@ -34,8 +36,89 @@ Path: The UserConfig.c file in LR_driver is a common file generated when adaptin
34 36
35 37
- https://github.com/sandeepmistry/arduino-LoRa
36 38
39
+ #else
40
+ #define LORA_DEFAULT_SPI SPI
41
+ #define LORA_DEFAULT_SPI_FREQUENCY 8E6
42
+ #define LORA_DEFAULT_SS_PIN 10
43
+ #define LORA_DEFAULT_RESET_PIN 9
44
+ #define LORA_DEFAULT_DIO0_PIN 2
45
+ #endif
46
+
47
+
37 48
- [[radiohead-dat]]
38 49
50
+- https://jgromes.github.io/RadioLib/
51
+
52
+ // ESP8266 -- [[12P-BTB-dat]]
53
+ SX1262 lora = new Module(15, 0, 16);
54
+
55
+
56
+- https://github.com/beegee-tokyo/SX126x-Arduino
57
+
58
+
59
+
60
+ #ifdef ESP8266
61
+ // ESP32 - SX126x pin configuration
62
+ int PIN_LORA_RESET = 0; // LORA RESET
63
+ int PIN_LORA_DIO_1 = 15; // LORA DIO_1
64
+ int PIN_LORA_BUSY = 16; // LORA SPI BUSY
65
+ int PIN_LORA_NSS = 2; // LORA SPI CS
66
+ int PIN_LORA_SCLK = SCK; // LORA SPI CLK
67
+ int PIN_LORA_MISO = MISO; // LORA SPI MISO
68
+ int PIN_LORA_MOSI = MOSI; // LORA SPI MOSI
69
+ int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
70
+ int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
71
+ #endif
72
+
73
+
74
+custom setup
75
+
76
+ #ifdef ESP8266
77
+ // ESP8266 - SX126x pin configuration
78
+ int PIN_LORA_RESET = -1; // LORA RESET (GPIO 4 / D2)
79
+ int PIN_LORA_DIO_1 = 0; // LORA DIO_1 (GPIO 2 / D4)
80
+ int PIN_LORA_BUSY = 16; // LORA SPI BUSY (GPIO 5 / D1)
81
+ int PIN_LORA_NSS = 15; // LORA SPI CS (GPIO 15 / D8)
82
+ int PIN_LORA_SCLK = 14; // LORA SPI CLK (GPIO 14 / D5)
83
+ int PIN_LORA_MISO = 12; // LORA SPI MISO (GPIO 12 / D6)
84
+ int PIN_LORA_MOSI = 13; // LORA SPI MOSI (GPIO 13 / D7)
85
+ int RADIO_TXEN = 5; // LORA ANTENNA TX ENABLE (not used)
86
+ int RADIO_RXEN = 4; // LORA ANTENNA RX ENABLE (not used)
87
+ #endif
88
+
89
+
90
+ // Define LoRa parameters
91
+ #define RF_FREQUENCY 916100000 // Hz
92
+ #define TX_OUTPUT_POWER 22 // dBm
93
+ #define LORA_BANDWIDTH 0 // [0: 125 kHz, 1: 250 kHz, 2: 500 kHz, 3: Reserved]
94
+ #define LORA_SPREADING_FACTOR 7 // [SF7..SF12]
95
+ #define LORA_CODINGRATE 1 // [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
96
+ #define LORA_PREAMBLE_LENGTH 8 // Same for Tx and Rx
97
+ #define LORA_SYMBOL_TIMEOUT 0 // Symbols
98
+ #define LORA_FIX_LENGTH_PAYLOAD_ON false
99
+ #define LORA_IQ_INVERSION_ON false
100
+ #define RX_TIMEOUT_VALUE 3000
101
+ #define TX_TIMEOUT_VALUE 5000
102
+
103
+
104
+ SDK:2.2.2-dev(38a443e)/Core:3.1.2=30102000/lwIP:STABLE-2_1_3_RELEASE/glue:1.2-65-g06164fb/BearSSL:b024386
105
+ =====================================
106
+ SX126x PingPong test
107
+ =====================================
108
+ BoardId: 00-0A-04-4D-00-0A-04-4D
109
+ Starting lora_hardware_init
110
+ LoRa init success
111
+
112
+
113
+
114
+- [[FreeRTOS-dat]]
115
+
116
+
117
+- [Single Channel LoRaWAN Gateway == SX1262-SC-GW](https://github.com/beegee-tokyo/SX1262-SC-GW)
118
+
119
+
120
+
121
+
39 122
40 123
41 124
## code repro
... ...
@@ -127,4 +210,8 @@ Example (Arduino, using AESLib):
127 210
128 211
## ref
129 212
130
-- [[lora-dat]] - [[lora-HDK-dat]] - [[lora-SDK-dat]]
... ...
\ No newline at end of file
0
+- [[arduino-ide-dat]]
1
+
2
+- [[lora-dat]] - [[lora-HDK-dat]] - [[lora-SDK-dat]]
3
+
4
+- [[RAKwireless-dat]]
... ...
\ No newline at end of file
board-3rd-dat/RAKwireless-dat/RAKwireless-dat.md
... ...
@@ -0,0 +1,11 @@
1
+
2
+# RAKwireless-dat
3
+
4
+- RAK4631
5
+- Wisblock
6
+- RAK11310
7
+
8
+
9
+## ref
10
+
11
+- [[board-3rd-dat]]
board-3rd-dat/board-3rd-dat.md
... ...
@@ -5,4 +5,6 @@
5 5
6 6
- [[RPI-dat]]
7 7
8
-- [[nodemcu-dat]]
... ...
\ No newline at end of file
0
+- [[nodemcu-dat]]
1
+
2
+- [[RAKwireless-dat]]
... ...
\ No newline at end of file