-->
Page 1 of 4

How to send a byte from the AP to multiple stations

PostPosted: Thu Apr 19, 2018 10:59 pm
by FranckM
I have 4 ESP8266 running the same code controlling APA102 leds using FastLED. The program has multiple "modes" showing different animations. The current mode is simply controlled by an uint8_t variable.

I'm trying to set one ESP as AP and the other 3 as Station, so when I change the mode on the AP I can send the variable to the 3 stations.

I succeeded by using UDP, but the lag is considerable and my stations end up de-synced by half a second of what the AP is showing.

Is there a way to do this with static IPs using write() and read()? The examples I found were stations sending data to the AP. I want the AP to send data to the 3 stations.

Thank you

Re: How to send a byte from the AP to multiple stations

PostPosted: Fri Apr 20, 2018 1:20 am
by schufti
a) maybe:
send new pattern via udp broadcast to stations first, then switch on AP
or
use 5 modules and let the 5th be controller only, the other 4 should receive and react to udp broadcast (almost) synchronously

b) exact solution:
have all modules sync to ntp time and send exact timestamps when to change pattern ...

Re: How to send a byte from the AP to multiple stations

PostPosted: Fri Apr 20, 2018 1:21 am
by schufti
a) maybe:
send new pattern via udp broadcast to stations first, then switch on AP
or
use 5 modules and let the 5th be controller only, the other 4 should receive and react to udp broadcast (almost) synchronously

b) exact solution:
have all modules sync to ntp time and send exact timestamps when to change pattern ...

n.b.: you'd probably have to do your own full implementation of ntp to get sub-second sync.

Re: How to send a byte from the AP to multiple stations

PostPosted: Fri Apr 20, 2018 4:13 am
by McChubby007
There's an esp8266 "mesh" architecture with related APIs from what I recall reading in the early days. I have no idea if it is usable, still active/relevant or whether its performance would be better (I'd hope it would).