Comments (4)
The attached code has lots of unexecuted junk (everything starting from InitESPNow are unnecessary). Please follow [https://stackoverflow.com/help/mcve](MCVE guidelines) next time you report a bug (to this and any other project).
This snippet is problematic:
unsigned long tim = millis() ;
while((!flgMsgRecd) && ((tim-millis())<250)) ;
flgMsgRecd = false ;
int len = snprintf(s, sizeof(s), "%s with Mac Id %s at %lu %d",msg, WiFi.softAPmacAddress().c_str(), millis(),rstcnt++);
WifiEspNow.send(PEER, reinterpret_cast<const uint8_t*>(s), sizeof(s));
esp_sleep_enable_timer_wakeup(300000);
esp_deep_sleep_start();
- Wait 250ms for an incoming message.
- Transmit a message.
- Sleep for 5 minutes.
Observations:
- Nobody would transmit first. Even if two nodes wake up at almost but not exactly the same time, normally only one could receive a message.
- ESP-NOW is best-effort delivery. It has acknowledgement
WifiEspNow.getSendStatus()
but not automated retransmission. The app is not doing retransmission. - Wake period is a lot shorter than sleep period. If sleep timer is a little bit off, the two node would never wake up at the same time, and thus no communication could happen.
The following paper may be related:
Oliver Hahm, Emmanuel Baccelli, Thomas Schmidt, Matthias Waehlisch, Cédric Adjih. A Named Data Network Approach to Energy Efficiency in IoT. IEEE GLOBECOM Workshop on Named Data Networking for Challenged Communication Environments, Dec 2016, Washington DC, United States.
from wifiespnow.
Thank you for your prompt reply.
-
True. A lot of unnecessary junk was sent with the code. I was trying various things to get it to work and the junk was not trimmed off. And yes I have now gone through the MCVE guidelines. Thanks for that. I try to adhere to them in the future
-
I went thru your comments and had in the meanwhile found errors in my code which I will correct. Hopefully I will get it right soon.
-
I have yet to go through the reference paper you sent.
Will report back . Thanks again
from wifiespnow.
One question regarding the code :
Will the line :
ok = WifiEspNow.addPeer(PEER);
try to write the Mac ID and other details about the peer to EEPROM or Flash on every reset ?
That would markedly reduce life of the device as I am resetting every 300 ms
Is it required if the pairing has already been done once ? Should I check to see if pairing exists and only then do this ? If so how ?
Thanks
from wifiespnow.
Will the line
ok = WifiEspNow.addPeer(PEER);
try to write the Mac ID and other details about the peer to EEPROM or Flash on every reset ?
I believe no, because ESP-IDF docs does not mention persistence of the pairing.
from wifiespnow.
Related Issues (20)
- On ESP32 system crashes when esp_now_xxx functions called without successful begin() HOT 2
- basic documentation about how to use the examples HOT 1
- restructering folder-structure to enable the use of add-ZIP-library of the Arduino-IDE HOT 1
- modifying the EspNowBroadcast.ino-example to deliver output you just can copy & paste into your code that is based on the EspNowUniCast-example HOT 1
- EspNowBroadcast do not work reliable HOT 1
- Nothing received from my ESP32-S2 module HOT 1
- PlatformIO compile receiver not work. HOT 1
- ota update HOT 1
- 这个库广播支持自动路由转发吗? HOT 1
- Doesn't seem entirely reliable
- how to send any kind of data HOT 2
- Any chance to include in arduino-esp32? HOT 1
- It does not work when ESP32-S3 connected to wifi ap HOT 3
- Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
- Compiler warning
- Is it possible to enable encryption? HOT 2
- What can I do with this library? HOT 2
- Can i connecting multiple esp8266(slave) to one esp32(master) with this library? HOT 2
- Serial Communication over ESP Now HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifiespnow.