mongoose-os-libs / wifi

Other
13 stars 29 forks source link

WiFi Event when station is connected to AP #5

Closed mglettig closed 6 years ago

mglettig commented 6 years ago

The Espressif SDK triggers an event when a station is connected to the Access-Point and when the station is disconnected. On the following picture those events are highlighted (source: https://github.com/espressif/ESP8266_NONOS_SDK): image

Please dispatch those events to the "mgos_wifi_changed_t" callback:

Or is there another way to figure out if a station is connected when the ESP is in AP-mode?

mglettig commented 6 years ago

@rojer The PR that I created some time ago contains those new events. Could you incorporate this changes? Thank you for the feedback.

rojer commented 6 years ago

yeah, i've had a quick glance at it before but it's not quite there yet. i support the ide in principle, but we need to apply it to all our platforms. this will need more work.

tripflex commented 6 years ago

👍

izaiasemjr commented 6 years ago

Hi @mglettig, could you point me where is this implementation and how I can use it?

MopeZe commented 6 years ago

Hi @junym You can find it here: https://github.com/mongoose-os-libs/wifi/pull/7/commits/9a1217a7c51a36b9c4d1fc980b1cfe1006c8b4e0

izaiasemjr commented 6 years ago

Thanks @MopeZe! Sorry my foolishness, but what I should to make for use this changes? In my mean mos.yml I should to add this path < https://github.com/mongoose-os-libs/wifi/tree/9a1217a7c51a36b9c4d1fc980b1cfe1006c8b4e0 > ?

A another thing that I can't understanding is if I can point a origin libs to my own libs in github, cause when I make this I get compilation errors like this :

Error 1 /mongoose-os/fw/src/mgos_config.mk:14: recipe for target '/fwbuild-volumes/2.2/apps/wifi-setup-web/esp8266/build_contexts/build_ctx_827088842/build/gen/mgos_config.c' failed

tripflex commented 6 years ago

Yeah this is pretty important to be able to know when someone connects to the AP .. unless there's another way you guys can point out? @rojer even if it can't be added for the other platforms outside of the Espressif SDK, could you not just add the event (or some kind of generic way) using the Espressif c files (or even just check if platform is espressif before triggering event, and do nothing for other platforms if no way exist with them) .... feels like other platforms would be holding this back on ones that support it??

@MopeZe thank you, i'll add this to my local copy, but still feel like this should be included in core library, even if other platforms don't support it ... or if they do, but nobody has written the code yet ... when it's needed someone will write the code, shouldn't hold every other platform back

andyjjones1 commented 6 years ago

Are we able to know if someone connects to the AP? Is there some kind of event I can hook into?

rojer commented 6 years ago

@andyjjones1 not at the moment. but watch this space.