Skip to content

Commit 68b762c

Browse files
committed
Version 2.9.0-beta11
1 parent 0afdd70 commit 68b762c

File tree

127 files changed

+16754
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+16754
-14
lines changed

compiled_firmware_files/firmware.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
"2": {
1010
"latest_fw": "2.8.0",
1111
"link": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.8.0.bin",
12-
"latest_beta_fw": "2.9.0-beta10",
13-
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.9.0-beta10.bin",
14-
"beta_release_notes": "https://github.com/arjenhiemstra/ithowifi/releases/tag/Version-2.9.0-beta10",
12+
"latest_beta_fw": "2.9.0-beta11",
13+
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.9.0-beta11.bin",
14+
"beta_release_notes": "https://github.com/arjenhiemstra/ithowifi/releases/tag/Version-2.9.0-beta11",
1515
"release_notes": "https://github.com/arjenhiemstra/ithowifi/releases/tag/Version-2.8.0"
1616
},
1717
"NON-CVE 1": {
1818
"latest_fw": "2.8.0",
1919
"link": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.8.0.bin",
20-
"latest_beta_fw": "2.9.0-beta10",
21-
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.9.0-beta10.bin",
22-
"beta_release_notes": "https://github.com/arjenhiemstra/ithowifi/releases/tag/Version-2.9.0-beta10",
20+
"latest_beta_fw": "2.9.0-beta11",
21+
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.9.0-beta11.bin",
22+
"beta_release_notes": "https://github.com/arjenhiemstra/ithowifi/releases/tag/Version-2.9.0-beta11",
2323
"release_notes": "https://github.com/arjenhiemstra/ithowifi/releases/tag/Version-2.8.0"
2424
}
2525
}
Binary file not shown.
Binary file not shown.

software/NRG_itho_wifi/dependencies.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ dependencies:
44
source:
55
type: idf
66
version: 4.4.7
7-
manifest_hash: e70ff19af7538c977dc9cd554f833f2d8783fe23418b97944d4714cd0f5d4039
7+
manifest_hash: 22fd7a5abc2cf92591f6ecc9e649f4d0f0f79afd775d7c4813993d231381ec1c
88
target: esp32
99
version: 1.0.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#pragma once
22

3-
inline const char * fw_version = "2.9.0-beta10";
3+
inline const char * fw_version = "2.9.0-beta11";

software/NRG_itho_wifi/platformio.ini

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,37 @@ default_envs =
1212
[env]
1313
; Global data for all [env:***]
1414
build_flags =
15-
-D VERSION=2.9.0-beta10
15+
-D VERSION=2.9.0-beta11
1616
;upload_port = /dev/cu.usbserial-1410 #optional, only needed if PlatformIO autodetect is not working
1717
;monitor_port = /dev/cu.usbserial-1410 #optional, only needed if PlatformIO autodetect is not working
18-
platform = platformio/espressif32 @ ~6.9.0
18+
platform = platformio/espressif32 @ ~6.10.0
1919
;platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.10/platform-espressif32.zip
2020
framework = arduino, espidf
2121
; board_build.embed_txtfiles =
2222
; managed_components/espressif__esp_insights/server_certs/https_server.crt
2323
; managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt
2424
; managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt
2525
; managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt
26+
2627
lib_ldf_mode = chain+
2728
monitor_speed = 115200
2829
lib_deps =
2930
https://github.com/bblanchon/ArduinoStreamUtils.git#v1.9.0
30-
https://github.com/bblanchon/ArduinoJson.git#v7.2.1
31+
https://github.com/bblanchon/ArduinoJson.git#v7.4.1
3132
https://github.com/thijse/Arduino-Log.git#1.1.1
32-
https://github.com/mathieucarbou/AsyncTCP.git#v3.3.1
33-
https://github.com/mathieucarbou/ESPAsyncWebServer.git#v3.4.5
33+
https://github.com/ESP32Async/AsyncTCP.git#v3.3.8
34+
https://github.com/ESP32Async/ESPAsyncWebServer.git#v3.7.6
35+
https://github.com/mathieucarbou/MycilaWebSerial#v8.1.1
3436
https://github.com/jclds139/FS_FilePrint.git#a8b3bae397ce918c49be112c034a0fcbbc5c24fd
3537
https://github.com/arjenhiemstra/pubsubclient.git#3c7c4a89df6536cc52a3962cd0b76b0bfc8f5818
3638
https://github.com/arcao/Syslog#e9c2eea7a91fdda3a55f9df2ebc122f3152da02d
3739
https://github.com/arjenhiemstra/ArduinoNvs.git
38-
https://github.com/joltwallet/esp_littlefs.git#v1.14.8
40+
https://github.com/joltwallet/esp_littlefs.git#v1.16.1
3941
;https://github.com/jgromes/RadioLib.git#6.4.2
4042

43+
lib_ignore =
44+
LittleFS
45+
4146
[project_base]
4247
board_build.filesystem = littlefs
4348
board_build.partitions = ithowifi_parttable_coredump.csv
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
// SPDX-License-Identifier: LGPL-3.0-or-later
2+
// Copyright 2016-2025 Hristo Gochkov, Mathieu Carbou, Emil Muratov
3+
4+
/*
5+
This example demonstrates how to send data to a remote server asynchronously.
6+
Run on the remote computer: nc -l -p 1234
7+
8+
You should see in the logs:
9+
10+
Connected!
11+
Will send 5760 bytes...
12+
Acked 1436 bytes in 19 ms
13+
Will send 1436 bytes...
14+
Acked 1436 bytes in 2 ms
15+
Will send 996 bytes...
16+
Waiting for acks...
17+
Acked 1436 bytes in 1 ms
18+
Acked 1436 bytes in 5 ms
19+
Acked 1452 bytes in 17 ms
20+
Acked 996 bytes in 28 ms
21+
Buffer received - next send in 2 sec
22+
Will send 5760 bytes...
23+
Acked 1436 bytes in 14 ms
24+
Will send 1436 bytes...
25+
Acked 1436 bytes in 2 ms
26+
Acked 1436 bytes in 0 ms
27+
Acked 1452 bytes in 1 ms
28+
Will send 996 bytes...
29+
Waiting for acks...
30+
Acked 1436 bytes in 3 ms
31+
Acked 996 bytes in 18 ms
32+
Buffer received - next send in 2 sec
33+
34+
And in the remote terminal 3072 characters sent [......... ...........] and so on.
35+
*/
36+
37+
#include <Arduino.h>
38+
#include <AsyncTCP.h>
39+
#include <StreamString.h>
40+
#include <WiFi.h>
41+
42+
#include <functional>
43+
#include <string>
44+
45+
#define WIFI_SSID "IoT"
46+
#define WIFI_PASSWORD ""
47+
48+
#define REMOTE_IP "192.168.125.116"
49+
#define REMOTE_PORT 1234
50+
51+
#define BUFFER_SIZE 8 * 1024
52+
53+
static char buffer[BUFFER_SIZE] = {0};
54+
static size_t bufferPos = 0;
55+
56+
// 0 == disconnected
57+
// 1 == connecting
58+
// 2 == connected
59+
static uint8_t state = 0;
60+
61+
// number of bytes waiting for a ack
62+
static size_t waitingAck = 0;
63+
64+
static AsyncClient client;
65+
66+
void setup() {
67+
Serial.begin(115200);
68+
while (!Serial) {
69+
continue;
70+
}
71+
72+
// connect to WiFi
73+
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
74+
while (WiFi.status() != WL_CONNECTED) {
75+
delay(500);
76+
}
77+
Serial.println("Connected to WiFi!");
78+
Serial.println(WiFi.localIP());
79+
80+
// fill buffer
81+
buffer[0] = '[';
82+
for (size_t i = 1; i < BUFFER_SIZE - 1; i++) {
83+
buffer[i] = '.';
84+
}
85+
buffer[BUFFER_SIZE - 1] = ']';
86+
87+
// register a callback when the client disconnects
88+
client.onDisconnect([](void *arg, AsyncClient *client) {
89+
Serial.printf("Disconnected.\n");
90+
state = 0;
91+
});
92+
93+
// register a callback when an error occurs
94+
client.onError([](void *arg, AsyncClient *client, int8_t error) {
95+
Serial.printf("Error: %s\n", client->errorToString(error));
96+
});
97+
98+
// register a callback when data arrives, to accumulate it
99+
client.onData([](void *arg, AsyncClient *client, void *data, size_t len) {
100+
Serial.printf("Received %u bytes...\n", len);
101+
Serial.write((uint8_t *)data, len);
102+
});
103+
104+
// register a callback when we are connected
105+
client.onConnect([](void *arg, AsyncClient *client) {
106+
Serial.printf("Connected!\n");
107+
state = 2;
108+
});
109+
110+
client.onAck([](void *arg, AsyncClient *client, size_t len, uint32_t time) {
111+
Serial.printf("Acked %u bytes in %" PRIu32 " ms\n", len, time);
112+
assert(waitingAck >= len);
113+
waitingAck -= len;
114+
});
115+
116+
client.setRxTimeout(20000);
117+
client.setNoDelay(true);
118+
}
119+
120+
void loop() {
121+
switch (state) {
122+
case 0:
123+
{
124+
Serial.printf("Connecting...\n");
125+
if (!client.connect(REMOTE_IP, REMOTE_PORT)) {
126+
Serial.printf("Failed to connect!\n");
127+
delay(1000); // to not flood logs
128+
} else {
129+
state = 1;
130+
}
131+
break;
132+
}
133+
134+
case 1:
135+
{
136+
Serial.printf("Still connecting...\n");
137+
delay(500); // to not flood logs
138+
break;
139+
}
140+
141+
case 2:
142+
{
143+
// fill PCB space until we can
144+
size_t willSend;
145+
while (bufferPos < BUFFER_SIZE && (willSend = client.write(buffer + bufferPos, BUFFER_SIZE - bufferPos))) {
146+
Serial.printf("Will send %u bytes...\n", willSend);
147+
bufferPos += willSend;
148+
waitingAck += willSend;
149+
}
150+
151+
// we have sent the whole buffer ?
152+
if (bufferPos >= BUFFER_SIZE) {
153+
// wait for acks, or send again after 2 sec
154+
if (waitingAck) {
155+
Serial.printf("Waiting for acks...\n");
156+
delay(100);
157+
} else {
158+
Serial.printf("Buffer received - next send in 2 sec\n");
159+
delay(2000);
160+
bufferPos = 0;
161+
}
162+
}
163+
break;
164+
}
165+
166+
default: break;
167+
}
168+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// SPDX-License-Identifier: LGPL-3.0-or-later
2+
// Copyright 2016-2025 Hristo Gochkov, Mathieu Carbou, Emil Muratov
3+
4+
#include <Arduino.h>
5+
#include <AsyncTCP.h>
6+
#include <StreamString.h>
7+
#include <WiFi.h>
8+
9+
#include <functional>
10+
#include <string>
11+
12+
#define WIFI_SSID "IoT"
13+
#define WIFI_PASSWORD ""
14+
15+
void fetchAsync(const char *host, std::function<void(const StreamString *)> onDone) {
16+
Serial.printf("[%s] Fetching: http://%s...\n", host, host);
17+
18+
// buffer where we will accumulate the received data
19+
StreamString *content = new StreamString();
20+
21+
// reserve enough space to avoid reallocations
22+
content->reserve(32 * 1024);
23+
24+
// create a new client
25+
AsyncClient *client = new AsyncClient();
26+
27+
// register a callback when the client disconnects
28+
client->onDisconnect([content, host, onDone](void *arg, AsyncClient *client) {
29+
Serial.printf("[%s] Disconnected.\n", host);
30+
onDone(content);
31+
delete client;
32+
delete content;
33+
});
34+
35+
// register a callback when an error occurs
36+
client->onError([host, onDone](void *arg, AsyncClient *client, int8_t error) {
37+
Serial.printf("[%s] Error: %s\n", host, client->errorToString(error));
38+
});
39+
40+
// register a callback when data arrives, to accumulate it
41+
client->onData([host, content](void *arg, AsyncClient *client, void *data, size_t len) {
42+
Serial.printf("[%s] Received %u bytes...\n", host, len);
43+
content->write((const uint8_t *)data, len);
44+
});
45+
46+
// register a callback when we are connected
47+
client->onConnect([host](void *arg, AsyncClient *client) {
48+
Serial.printf("[%s] Connected!\n", host);
49+
50+
// send request
51+
client->write("GET / HTTP/1.1\r\n");
52+
client->write("Host: ");
53+
client->write(host);
54+
client->write("\r\n");
55+
client->write("User-Agent: ESP32\r\n");
56+
client->write("Connection: close\r\n");
57+
client->write("\r\n");
58+
});
59+
60+
Serial.printf("[%s] Connecting...\n", host);
61+
62+
client->setRxTimeout(20000);
63+
// client->setAckTimeout(10000);
64+
client->setNoDelay(true);
65+
66+
if (!client->connect(host, 80)) {
67+
Serial.printf("[%s] Failed to connect!\n", host);
68+
delete client;
69+
delete content;
70+
onDone(nullptr);
71+
}
72+
}
73+
74+
void setup() {
75+
Serial.begin(115200);
76+
while (!Serial) {
77+
continue;
78+
}
79+
80+
// connect to WiFi
81+
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
82+
while (WiFi.status() != WL_CONNECTED) {
83+
delay(500);
84+
}
85+
Serial.println("Connected to WiFi!");
86+
Serial.println(WiFi.localIP());
87+
88+
// fetch asynchronously 2 websites:
89+
90+
// equivalent to curl -v --raw http://www.google.com/
91+
fetchAsync("www.google.com", [](const StreamString *content) {
92+
if (content) {
93+
Serial.printf("[www.google.com] Fetched website:\n%s\n", content->c_str());
94+
} else {
95+
Serial.println("[www.google.com] Failed to fetch website!");
96+
}
97+
});
98+
99+
// equivalent to curl -v --raw http://www.time.org/
100+
fetchAsync("www.time.org", [](const StreamString *content) {
101+
if (content) {
102+
Serial.printf("[www.time.org] Fetched website:\n%s\n", content->c_str());
103+
} else {
104+
Serial.println("[www.time.org] Failed to fetch website!");
105+
}
106+
});
107+
}
108+
109+
void loop() {
110+
delay(500);
111+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(COMPONENT_SRCDIRS
2+
"src"
3+
)
4+
5+
set(COMPONENT_ADD_INCLUDEDIRS
6+
"src"
7+
)
8+
9+
set(COMPONENT_REQUIRES
10+
"arduino-esp32"
11+
)
12+
13+
register_component()
14+
15+
target_compile_options(${COMPONENT_TARGET} PRIVATE -fno-rtti)

0 commit comments

Comments
 (0)