Skip to content
Snippets Groups Projects
Commit c8cf9fa5 authored by Moritz Perschke's avatar Moritz Perschke
Browse files

added broadcast of own mac to setup method in esp32-espnow-recv

parent d88b8630
No related branches found
No related tags found
4 merge requests!39Merge Develop into Main,!19development into master,!17Inital Host, initial Client,!6Espnow
......@@ -13,8 +13,8 @@ platform = espressif32
board = esp32-c3-devkitm-1
monitor_speed = 115200
framework = arduino
monitor_port = /dev/ttyUSB1
upload_port = /dev/ttyUSB1
; monitor_port = /dev/ttyUSB1
; upload_port = /dev/ttyUSB1
build_flags =
-I include
-DCORE_DEBUG_LEVEL=5
......
......@@ -11,6 +11,8 @@
long time1 = 0;
uint8_t hostMac[] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
//SoftwareSerial mySerial(RXD2, TXD2);
enum MessageType{
......@@ -95,6 +97,14 @@ void setup()
}
Serial.println("ESPNow init success");
// tell all clients that this is now the host
// can probably be removed after testing
response hello;
hello.type = hostChange;
esp_read_mac(hello.mac, ESP_MAC_WIFI_STA);
hello.time = 0;
esp_now_send(hostMac, (uint8_t*) &hello, sizeof(hello));
esp_now_register_recv_cb(on_data_recv);
// write your initialization code here
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment