fix esp now
This commit is contained in:
@@ -46,9 +46,10 @@ bool Network::activateEspNow(recieveCallbackPtr reci, sendCallbackPtr send) {
|
|||||||
|
|
||||||
esp_now_register_send_cb(send);
|
esp_now_register_send_cb(send);
|
||||||
|
|
||||||
memcpy(this->peerInfo.peer_addr, this->broadcastAddress, 6);
|
esp_now_peer_info_t peerInfo = {};
|
||||||
this->peerInfo.channel = 0;
|
memcpy(peerInfo.peer_addr, this->broadcastAddress, 6);
|
||||||
this->peerInfo.encrypt = false;
|
peerInfo.channel = 0;
|
||||||
|
peerInfo.encrypt = false;
|
||||||
|
|
||||||
if (esp_now_add_peer(&peerInfo) != ESP_OK) {
|
if (esp_now_add_peer(&peerInfo) != ESP_OK) {
|
||||||
std::cout << "Network::connectEspNow - Failed to add peer" << std::endl;
|
std::cout << "Network::connectEspNow - Failed to add peer" << std::endl;
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ class Network : public Component {
|
|||||||
NetworkAdresses adresses;
|
NetworkAdresses adresses;
|
||||||
WiFiClient wifiClient;
|
WiFiClient wifiClient;
|
||||||
PubSubClient* mqttClient = nullptr;
|
PubSubClient* mqttClient = nullptr;
|
||||||
esp_now_peer_info_t peerInfo;
|
|
||||||
|
|
||||||
bool initSucessful = false;
|
bool initSucessful = false;
|
||||||
bool wifiConnected = false;
|
bool wifiConnected = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user