File tree Expand file tree Collapse file tree 2 files changed +72
-0
lines changed
examples/examples-communication/esp-now/speed-test
communication-espnow-receive_measure
communication-espnow-send Expand file tree Collapse file tree 2 files changed +72
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* *
2
+ * @file example-serial-receive_measure.ino
3
+ * @author Phil Schatzmann
4
+ * @brief Receiving audio via ESPNow with max speed to measure thruput
5
+ * @version 0.1
6
+ * @date 2022-03-09
7
+ *
8
+ * @copyright Copyright (c) 2022
9
+ *
10
+ */
11
+
12
+ #include " AudioTools.h"
13
+ #include " AudioLibs/Communication.h"
14
+
15
+ ESPNowStream now;
16
+ MeasuringStream out;
17
+ StreamCopy copier (out, now);
18
+ const char *peers[] = {" A8:48:FA:0B:93:02" };
19
+
20
+ void setup () {
21
+ Serial.begin (115200 );
22
+ AudioLogger::instance ().begin (Serial, AudioLogger::Info);
23
+
24
+ auto cfg = now.defaultConfig ();
25
+ cfg.mac_address = " A8:48:FA:0B:93:01" ;
26
+ cfg.rate = WIFI_PHY_RATE_24M;
27
+ now.begin (cfg);
28
+ now.addPeers (peers);
29
+
30
+ // start I2S
31
+ Serial.println (" starting Out..." );
32
+ out.begin ();
33
+
34
+ Serial.println (" Receiver started..." );
35
+ }
36
+
37
+ void loop () {
38
+ copier.copy ();
39
+ }
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * @file example-serial-send.ino
3
+ * @author Phil Schatzmann
4
+ * @brief Sending audio over ESPNow
5
+ * @version 0.1
6
+ * @date 2022-03-09
7
+ *
8
+ * @copyright Copyright (c) 2022
9
+ */
10
+
11
+ #include " AudioTools.h"
12
+ #include " AudioLibs/Communication.h"
13
+
14
+ ESPNowStream now;
15
+ const char *peers[] = {" A8:48:FA:0B:93:01" };
16
+ uint8_t buffer[1024 ] = {0 };
17
+
18
+ void setup () {
19
+ Serial.begin (115200 );
20
+ AudioLogger::instance ().begin (Serial, AudioLogger::Warning);
21
+
22
+ auto cfg = now.defaultConfig ();
23
+ cfg.mac_address = " A8:48:FA:0B:93:02" ;
24
+ cfg.rate = WIFI_PHY_RATE_24M;
25
+ now.begin (cfg);
26
+ now.addPeers (peers);
27
+
28
+ Serial.println (" Sender started..." );
29
+ }
30
+
31
+ void loop () {
32
+ now.write (buffer, 1024 );
33
+ }
You can’t perform that action at this time.
0 commit comments