callback on connect

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
pintman
Posts: 4
Joined: Fri Sep 02, 2016 12:56 pm

callback on connect

Post by pintman » Fri Sep 02, 2016 3:50 pm

Hi!

Is it possible to get an information when a client connects to the ESP in AP-mode. There is some debug output on the tty-Terminal.

> add 1
> aid 1
> station: 40:78:XX:XX:XX:XX join, AID = 1

Is it possible to call some kind of callback handler such that I can react upon a new or a leaving client?

zvyk
Posts: 1
Joined: Thu Nov 09, 2017 8:29 pm

Re: callback on connect

Post by zvyk » Thu Nov 09, 2017 9:11 pm

I went also on this crazy trip and i am falling into deep swamp. I was looking for dhcp address leases or get some more information about currently connected clients (timestamp [RTC/localtime()], mac address, assign ip).

Reading osdebug message are the workaround to this.
until the "network.AP_if.status()/config()" will have accesible these information about currntly connected clients. - <best way>

Please, can somebody give us advice how to read debug messages by micropython?

Debug messages are printed directly to UART0 by esp.osdebug(0).
It would be nice have posibility to redirect them into short history list (<tube>)
<callback on each "new" appended message to this tube should solve it>

Or does micropython have posibility to read something similar to dmesg?

Many thanks for any advice.

Post Reply