Search found 36 matches

by glenn20
Sun Jul 25, 2021 4:36 am
Forum: ESP32 boards
Topic: ESP-Now support for ESP32 (and ESP8266)
Replies: 84
Views: 15796

Re: ESP-Now support for ESP32 (and ESP8266)

If I put two devices into deep sleep, would I be able to have one wake up and send a signal to the other one to wake it up only using esp-now? It seems the only way to get a device in deep sleep to be able to talk to another device is to have at least one device always on and not sleeping. Is that ...
by glenn20
Mon Jul 12, 2021 4:17 am
Forum: ESP32 boards
Topic: ESP-Now support for ESP32 (and ESP8266)
Replies: 84
Views: 15796

Re: ESP-Now support for ESP32 (and ESP8266)

dhust wrote:
Sun Jul 11, 2021 11:01 pm
davef wrote:
Sun Jul 11, 2021 9:39 pm
Have you tried just sending to one slave and do you get a message back?
How do you get a message back? Is there a specific callback for ESP-Now using MicroPython?
You get a message back with:

Code: Select all

e.send(peer, 'Hello')
host, msg = e.recv()  # or e.irecv()
by glenn20
Mon Jul 12, 2021 3:32 am
Forum: ESP32 boards
Topic: ESP-Now support for ESP32 (and ESP8266)
Replies: 84
Views: 15796

Re: ESP-Now support for ESP32 (and ESP8266)

Or is there another way to wait for received messages in a non-blocking way? Thanks! Yes, you have several options. The more modern way would be to use micropython asyncio via the StreamReader class (assuming you are using ESP32 modules - see the docs). If you are not ready for asyncio, you can set...
by glenn20
Wed May 19, 2021 3:34 am
Forum: ESP32 boards
Topic: ESP-Now support for ESP32 (and ESP8266)
Replies: 84
Views: 15796

Re: ESP-Now support for ESP32 (and ESP8266)

Hi @davef, Thanks for the successful application report. That's good news. Long range hasn't been my principal motivation, but I have seen it suggested that you could try enabling 802.11LR (long range) and that may help with range (network.wlan(if).config(protocol=network.MODE_LR)). Also - don't use...
by glenn20
Tue May 11, 2021 1:15 am
Forum: Development of MicroPython
Topic: Qn: Use of mp_sched_schedule for io streams (eg. ubluetooth).
Replies: 0
Views: 1417

Qn: Use of mp_sched_schedule for io streams (eg. ubluetooth).

I want to clarify what might be a misunderstanding on my part about using mp_sched_schedule for IO streams. This arises from my experiences developing the ESPNow support (ESP32/8266) and inspection of other code (esp. modbluetooth.c). TL,DR: Why does ubluetooth use user callbacks (running in a "sche...
by glenn20
Thu Apr 29, 2021 2:33 am
Forum: ESP32 boards
Topic: ESP-Now support for ESP32 (and ESP8266)
Replies: 84
Views: 15796

Re: ESP-Now support for ESP32 (and ESP8266)

Thanks for posting this @mhepp63 - I have found some very "interesting" quirks when investigating this issue :roll: And second... I have a problem with ESPNow and WiFi working together. I need receive messages, handle them and send via wifi, but I am not able to get working code with wifi and espnow...
by glenn20
Sat Apr 17, 2021 2:05 am
Forum: ESP32 boards
Topic: mqtt subscription doesn't work on ESP32
Replies: 2
Views: 371

Re: mqtt subscription doesn't work on ESP32

It seems that your mqtt.py is the same as umqtt.simple, in which case, you need to explicitly check for messages from the broker before subscribe_callback will be invoked. Just add client.check_msg() in your processing loop. Depending on how responsive you want your app to be, you might want to chan...
by glenn20
Thu Apr 15, 2021 12:55 pm
Forum: ESP32 boards
Topic: ESP-Now support for ESP32 (and ESP8266)
Replies: 84
Views: 15796

Re: ESP-Now support for ESP32 (and ESP8266)

@peterhinch Thanks - I've got a lot out of your copious docs, tutorials and code on asyncio :-). No - it's not currently possible to instantiate a StreamWriter (or Reader) associated with a particular peer. I have been giving that thought myself and have on my TODO list a project to implement someth...
by glenn20
Thu Apr 15, 2021 4:41 am
Forum: ESP32 boards
Topic: ESP-Now support for ESP32 (and ESP8266)
Replies: 84
Views: 15796

Re: ESP-Now support for ESP32 (and ESP8266)

Update to Handle ESP-Now Broadcasts correctly. I have posted a new commit to the espnow branch to fix a bug in handling messages sent to the broadcast address. The espnow module now correctly (hopefully) deals with the idiosyncratic way the Espressif ESP-Now stack deals with broadcast addresses. Fo...
by glenn20
Thu Apr 15, 2021 4:36 am
Forum: ESP32 boards
Topic: ESP-Now support for ESP32 (and ESP8266)
Replies: 84
Views: 15796

Re: ESP-Now support for ESP32 (and ESP8266)

Just a heads-up. I have posted a proposal for a small breaking change to the espnow API on the github page for the PR (https://github.com/micropython/micropython/pull/6515#issuecomment-819954276). I understand the disruption an API change can be for users, so let me know if you have any objections o...