ESPNOW Unstable in AP+STA mixed mode

Recurrent H/W and software problems
Tony_A
Posts: 16
Joined: Sun Dec 31, 2023 8:08 am
Has thanked: 7 times
Been thanked: 5 times

Re: ESPNOW Unstable in AP+STA mixed mode

Post by Tony_A »

OK making little progress.

Receiver can receive espnow messages in AP mode.

But I can't get sender module to send/transmit messages in AP mode. It needs to be in AP mode + STA and STA must be connected to active working AP (like home wifi router). It works with problems as described before if connected to Fake AP.

can you please try communicating between 2 modules without connecting to home central wifi router. Both modules in AP mode.

I need to be able to use modules to communicate using espnow in a stand alone mode. NO connections to other active Access Points (AP).
I think it can work in AP+STA mode but only if STA is active and NOT connected and not trying to connect to real or fake AP?
Tony_A
Posts: 16
Joined: Sun Dec 31, 2023 8:08 am
Has thanked: 7 times
Been thanked: 5 times

Re: ESPNOW Unstable in AP+STA mixed mode

Post by Tony_A »

Please make sure to do hard reset of modules after changing AP and STA modes.
User avatar
cicciocb
Site Admin
Posts: 2195
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 470 times
Been thanked: 1461 times
Contact:

Re: ESPNOW Unstable in AP+STA mixed mode

Post by cicciocb »

Ok I'll test later today
User avatar
cicciocb
Site Admin
Posts: 2195
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 470 times
Been thanked: 1461 times
Contact:

Re: ESPNOW Unstable in AP+STA mixed mode

Post by cicciocb »

Ok, I think I found something.

A fix will arrive soon ....
User avatar
cicciocb
Site Admin
Posts: 2195
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 470 times
Been thanked: 1461 times
Contact:

Re: ESPNOW Unstable in AP+STA mixed mode

Post by cicciocb »

OK, I fixed the ESPNOW, it is now working properly.
I just re-uploaded the 1.52.8 with the fix inside, I also updated the change log to track the modification.

In fact the messages were always sent to the (internal) STA interface so, when the module was in AP mode, the messages were sent to the wrong interface.
Now the selection is automatic or can be forced manually using 2 extra parameters (see below):

Code: [Local Link Removed for Guests]

Annex32 Change Log
Version 1.52.8
- Fixed the IP address in the config page not working for the AP mode
- Updated the AsyncTCP library to the mathieucarbou v3.0.2
- Fixed the ESPNOW not working properly in AP MODE
- Implemented 2 extra optional parameters on the function ESPNOW.ADD_PEER
    - ESPNOW.ADD_PEER(MAX_addr$ [,interface] [,channel]) 
        where interface is 0 = AUTO (default), 1=STA, 2=AP
        and channel is any valid channel numbers or 0 = current channel (default)
Tony_A
Posts: 16
Joined: Sun Dec 31, 2023 8:08 am
Has thanked: 7 times
Been thanked: 5 times

Re: ESPNOW Unstable in AP+STA mixed mode

Post by Tony_A »

Thank You Francesco.
You are a Legend.

Much appreciated.

Enjoy more beer money.
Tony_A
Posts: 16
Joined: Sun Dec 31, 2023 8:08 am
Has thanked: 7 times
Been thanked: 5 times

Re: ESPNOW Unstable in AP+STA mixed mode

Post by Tony_A »

Have started testing with new firmware containing fix for EspNow as per Cicciocb post above.

Two standard Esp32 modules, both set in AP mode in Config settings.
One using sender Basic example code and another as receiver.
Everything looks and is performing as expected.
Once again Thank You Francesco.
User avatar
cicciocb
Site Admin
Posts: 2195
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 470 times
Been thanked: 1461 times
Contact:

Re: ESPNOW Unstable in AP+STA mixed mode

Post by cicciocb »

Hi Tony_A, thanks for your feedback and your support.

I'm happy that this works for you and I think is a big benefit for the whole community.
Post Reply