fix esp now

This commit is contained in:
2023-09-23 16:37:40 +02:00
parent baf1936824
commit cebd44d793
2 changed files with 4 additions and 4 deletions
+4 -3
View File
@@ -46,9 +46,10 @@ bool Network::activateEspNow(recieveCallbackPtr reci, sendCallbackPtr send) {
esp_now_register_send_cb(send);
memcpy(this->peerInfo.peer_addr, this->broadcastAddress, 6);
this->peerInfo.channel = 0;
this->peerInfo.encrypt = false;
esp_now_peer_info_t peerInfo = {};
memcpy(peerInfo.peer_addr, this->broadcastAddress, 6);
peerInfo.channel = 0;
peerInfo.encrypt = false;
if (esp_now_add_peer(&peerInfo) != ESP_OK) {
std::cout << "Network::connectEspNow - Failed to add peer" << std::endl;
-1
View File
@@ -62,7 +62,6 @@ class Network : public Component {
NetworkAdresses adresses;
WiFiClient wifiClient;
PubSubClient* mqttClient = nullptr;
esp_now_peer_info_t peerInfo;
bool initSucessful = false;
bool wifiConnected = false;