Presence alert in OpenHAB by DHCP server in ASUS router

The home automation system OpenHAB has the ability to coordinate difference networked devices to perform automatic control under different conditions. One of the important conditions is the presence of different residents in the house. Using "Network Health" module of OpenHAB allows the presence test through the detection of devices carried by the residents. One simply create item such as

telnet and http server on NodeMCU v2

The NodeMCU v2 firmware for esp8266 only allows one TCP server. Usually, one will use this to serve a status page for the wireless unit. But, sometimes, maybe during development, it is desirable to also have a telnet access to the unit over WIFI to do some tweaking. Here, we achieve this by leaving a backdoor on the http port. By connecting to port 80 with telnet and enter "telnet" as the first input line, the connection is switch to a telnet service allows direct interaction with the Lua interpreter. The actual code is listed below:

Subscribe to Creative Constant Development Workgroup RSS