Hallo Gemeinde,
ich versuche, einen ESPnow-Receiver-Sketch (weiter unten) mit der
Arduino-Ide für meinen ESP32 zu compilieren. Leider kommt jedesmal die
Fehlermeldung:
Der Befehl "/esptool.exe" ist entweder falsch geschrieben oder
konnte nicht gefunden werden. Die ganze Fehlermeldung ist im Anhang
aufgeführt. Die Datei finde ich nicht auf meinem Rechner.
Ich habe jetzt schon mehrere Stunden gegoogelt, wie ich das Problem
lösen kann, leider habe ich nichts gefunden. Vielleicht kann mir jemand
helfen?
1 | /*
|
2 | Rui Santos
|
3 | Complete project details at https://RandomNerdTutorials.com/esp-now-esp32-arduino-ide/
|
4 |
|
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 | of this software and associated documentation files.
|
7 |
|
8 | The above copyright notice and this permission notice shall be included in all
|
9 | copies or substantial portions of the Software.
|
10 | */
|
11 |
|
12 | #include <esp_now.h>
|
13 | #include <WiFi.h>
|
14 |
|
15 | // Structure example to receive data
|
16 | // Must match the sender structure
|
17 | typedef struct struct_message {
|
18 | char a[32];
|
19 | int b;
|
20 | float c;
|
21 | bool d;
|
22 | } struct_message;
|
23 |
|
24 | // Create a struct_message called myData
|
25 | struct_message myData;
|
26 |
|
27 | // callback function that will be executed when data is received
|
28 | void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
|
29 | memcpy(&myData, incomingData, sizeof(myData));
|
30 | Serial.print("Bytes received: ");
|
31 | Serial.println(len);
|
32 | Serial.print("Char: ");
|
33 | Serial.println(myData.a);
|
34 | Serial.print("Int: ");
|
35 | Serial.println(myData.b);
|
36 | Serial.print("Float: ");
|
37 | Serial.println(myData.c);
|
38 | Serial.print("Bool: ");
|
39 | Serial.println(myData.d);
|
40 | Serial.println();
|
41 | }
|
42 |
|
43 | void setup() {
|
44 | // Initialize Serial Monitor
|
45 | Serial.begin(115200);
|
46 |
|
47 | // Set device as a Wi-Fi Station
|
48 | WiFi.mode(WIFI_STA);
|
49 |
|
50 | // Init ESP-NOW
|
51 | if (esp_now_init() != ESP_OK) {
|
52 | Serial.println("Error initializing ESP-NOW");
|
53 | return;
|
54 | }
|
55 |
|
56 | // Once ESPNow is successfully Init, we will register for recv CB to
|
57 | // get recv packer info
|
58 | esp_now_register_recv_cb(OnDataRecv);
|
59 | }
|
60 |
|
61 | void loop() {
|
62 |
|
63 | }
|