martin-ger / esp_wifi_repeater

A full functional WiFi Repeater (correctly: a WiFi NAT Router)
MIT License
4.78k stars 901 forks source link

how to expose IOT devices control to main network over WIFI Nat #327

Open Muplex opened 5 years ago

Muplex commented 5 years ago

Ciao, thank you for your work. I find it very usefull and I saved some money making myself a range extender with an Esp8266 - 01 that work very well.

My question is simple but I did't find any reference in other posts and face off for me (not a nerd on networking) is very hard.

My objective is to monitor (ping) if the domotic sensor is connected to the net or not with a domotic hub like Openhab and send ON/OFF command to a Sonoff flashed with tasmota firmware also connected to the AP

Here my datas: Router IP = 192.168.178.1 AP subnet set as default = 192.168.4.0 Esp given IP inside the main net = 192.168.178.106

sending telnet command "show dhcp" output is

cc:50:e3:5d:1b:f4 - 192.168.4.2 - 68
48:db:50:2f:c4:48 - 192.168.4.3 - 68

(I think is the two sensors connected to the nat router right?)

sending telnet command "show route" output is

Network              Dest
192.168.4.0/24       ew1
192.168.178.0/24     ew0
127.0.0.0/8          lo0
default              192.168.178.1

main router is a frizbox 4020 and I can manage port forwarding if i can understand needed parameters to set

what i have to set to be able to ping domotic sensors connected on the range extender ???

Thanks in advance for your help.

Muplex commented 5 years ago

Hello, I discover that the two sensors can send message to my domotic hub with the mqtt protocol without problems over the repeater to my home network. Thats Great. All works very well

The only thing I ask you to understand is if it's possible to ping the two devices 'cause in these casa I could know if they still connected to the net or they disconnect.

martin-ger commented 5 years ago

Pinging them is not possible because of NAT. What you can do is using the MQTT LWT mechanism to check, whether they are online:

hafened commented 5 years ago

hello,how esp 8266 can be a wifi repeater and also burn a code in it.(in a sane esp).i have issue the program overwrite or crash,actually i update firmware for repeater and write source code in arduino IDE..thanks

martin-ger commented 5 years ago

This is not an Arduino project. You cannot use this code in Arduino.

hafened commented 5 years ago

This is not an Arduino project. You cannot use this code in Arduino.

thanks,is it possible wifi repeater and a program e.g blinking led can burn in same esp?or any other alternate way?..thankyou