I took a quick look and couldn't see any obvious issue with your code. You may be uncovering some espnow bug - or some other micropython issue. The latest images are built from the master branch and may have some instabilities. It's been a bit of extra effort to support the newer espnow fixes/features on master and also on the v1.17 release because there have been some significant changes to micropython since v1.17. I am guessing there will be a v1.18 some time soon.davef wrote: ↑Sun Dec 05, 2021 3:10 amAnybody using lightsleep() on a ESP32 and the latest ESP-Now image?
Occasionally the unit locks-up and doesn't recover with the ESP watchdog timer. The code is here:
https://github.com/davefes/ESP-Now-repe ... /remote.py with all the watchdog stuff enabled, in case that might supply a clue.
ESP-Now support for ESP32 (and ESP8266)
Re: ESP-Now support for ESP32 (and ESP8266)
Re: ESP-Now support for ESP32 (and ESP8266)
Hi Glenn,
Thanks for the response.
I am testing the remote in the lounge for a few days as well as blinking an LED (once a minute) to tell me if the loop stops running.
It could be a path issue as there is a tree in the way and the leaves are growing well with all our Spring rain.
As I have some new 18650 cells in the unit I could do a utime.sleep(60) instead of the lightsleep(60000) if I continue to have problems.
Also, one can't rule-out the actual ESP32 dev board I am using.
Thanks for the response.
I am testing the remote in the lounge for a few days as well as blinking an LED (once a minute) to tell me if the loop stops running.
It could be a path issue as there is a tree in the way and the leaves are growing well with all our Spring rain.
As I have some new 18650 cells in the unit I could do a utime.sleep(60) instead of the lightsleep(60000) if I continue to have problems.
Also, one can't rule-out the actual ESP32 dev board I am using.
Re: ESP-Now support for ESP32 (and ESP8266)
I will publish it in the coming days after the technical cleaning of the code
Glenn, I have a need to check for the presence of a peer, now I do it through 'try:', but I would just like to make a request like 'my_peer in en.peers_list'. Is it possible?
Re: ESP-Now support for ESP32 (and ESP8266)
IN DOCs
1. Which values return ESPNow.write(b) ?
2. Where I can set sync parameter in ESPNow.send(mac, msg[, sync]) if I not want waiting for response?
1. Which values return ESPNow.write(b) ?
2. Where I can set sync parameter in ESPNow.send(mac, msg[, sync]) if I not want waiting for response?
True: (default) send msg to the peer(s) and wait for a response (or not).
Re: ESP-Now support for ESP32 (and ESP8266)
Zoland,
A snippet of code that Glenn wrote that is in my ESPNow project.
So, not waiting should be:
which I should change in my code as I don't do anything with retval.
A snippet of code that Glenn wrote that is in my ESPNow project.
Code: Select all
w0.active(True) # turn on radio only when needed
# if you want to save more battery, set sync=False
# at cost of not knowing if message was received.
retval = e0.send(repeater_mac, status, True)
w0.active(False)
Code: Select all
retval = e0.send(repeater_mac, status, False)
-
- Posts: 8
- Joined: Tue Dec 21, 2021 1:30 pm
Re: ESP-Now support for ESP32 (and ESP8266)
Hi Glenn thank you for your work, I wish to develop a project via webrepl and esp now on an esp8266. I have installed your latest .bin and everything works until I try webrepl setup which after completion makes the 8266 go into a constant reboot loop. Can the two functions coexist or is it a bug. I apologize if it has been asked before, but could not get any search hits on the matter.
All the best
All the best
Re: ESP-Now support for ESP32 (and ESP8266)
Hi Glenn,
I've been discussing an issue with davef; that being setting a fixed channel in station-mode for an ESP8266. Dave suggested that I try your build the includes ESPNow, as there was an example posted demonstrating that it was indeed possible:
https://micropython-glenn20.readthedocs ... -operation
EXCERPT:
20210903_espnow-g20-v1.17
Actual file name: firmware-esp8266-GENERIC_1M (581KB)
However, I tried this using an ESP-01s, when it hits the channel set results in this error:
dave tried this with an ESP32 and had success; is there some limitation with the build for the ESP8266?
I've been discussing an issue with davef; that being setting a fixed channel in station-mode for an ESP8266. Dave suggested that I try your build the includes ESPNow, as there was an example posted demonstrating that it was indeed possible:
https://micropython-glenn20.readthedocs ... -operation
EXCERPT:
Flashed your build:w0 = network.WLAN(network.STA_IF)
w0.active(True) # Set channel will fail unless Active
w0.config(channel=6)
20210903_espnow-g20-v1.17
Actual file name: firmware-esp8266-GENERIC_1M (581KB)
However, I tried this using an ESP-01s, when it hits the channel set results in this error:
The error indicating that the set-channel requires Access-Point-mode, not Station-mode.File "main.py", line 18, in
OSError: AP required
MicroPython v1.17-12-g26e539a1b on 2021-09-03; ESP module (1M) with ESP8266
Type "help()" for more information.
dave tried this with an ESP32 and had success; is there some limitation with the build for the ESP8266?
Re: ESP-Now support for ESP32 (and ESP8266)
Barneybear and MMliam,
I haven't tried myself but maybe looking through the port for the ESP32 and the ESP8266 here:
https://github.com/glenn20/micropython/ ... -g20/ports
might turn-up the differences between the two.
Reading back through the old postings, about pages 13, 14 I see another comment, "keyword arguments are left out of some ESP8266 stuff to save space".
Barneybear ... README.md for the ESP8266 says webrepl should be functional.
I haven't tried myself but maybe looking through the port for the ESP32 and the ESP8266 here:
https://github.com/glenn20/micropython/ ... -g20/ports
might turn-up the differences between the two.
Reading back through the old postings, about pages 13, 14 I see another comment, "keyword arguments are left out of some ESP8266 stuff to save space".
Barneybear ... README.md for the ESP8266 says webrepl should be functional.
Re: ESP-Now support for ESP32 (and ESP8266)
Thanks dave, but drawing a blank on differences.
Who do you make feature requests to? I haven't seen any formal link. Quite frankly allowing a station to fix it's channel will make re-connection from deep-sleep much quicker, and remove the significant re-connection time variability.
Who do you make feature requests to? I haven't seen any formal link. Quite frankly allowing a station to fix it's channel will make re-connection from deep-sleep much quicker, and remove the significant re-connection time variability.
Re: ESP-Now support for ESP32 (and ESP8266)
Feature requests ... well the one I asked for is on the GitHub issues page. I know he has done something as RSSI is now in the docs. I believe he is doing some tests before adding it to his image(s).
I suspect that something would have to be removed to add your feature, which might make someone else unhappy.
Unfortunately, you just have to wait and hope that something can be done.
I suspect that something would have to be removed to add your feature, which might make someone else unhappy.
Unfortunately, you just have to wait and hope that something can be done.