-->
Page 4 of 14

Re: WiFi Repeater (aka. WiFI NAT Router) with Monitoring Por

PostPosted: Mon Jan 30, 2017 9:56 am
by martin_g
Yes, can be done. In esp-open-lwip/include/lwip/lwip_napt.h there is the API in the modified lwip to register a port forwarding:

Code: Select all/**
 * Register port mapping on the external interface to internal interface.
 *
 * @param proto target protocol
 * @param maddr ip address of the external interface
 * @param mport mapped port on the external interface, in host byte order.
 * @param daddr destination ip address
 * @param dport destination port, in host byte order.
 */
u8_t ICACHE_FLASH_ATTR
ip_portmap_add(u8_t proto, u32_t maddr, u16_t mport, u32_t daddr, u16_t dport);


However, this is not yet availabe on the console interface. Up to now this has to be added directly in the code.

Perhaps I will try to add this next weekend as my new project requires it anyway...

Re: WiFi Repeater (aka. WiFI NAT Router) with Monitoring Por

PostPosted: Thu Feb 02, 2017 5:54 pm
by martin_g
Port forwarding has been added now. Use e.g.:
Code: Select allCMD>portmap add TCP 80 192.168.4.2 80

for forwarding to a HTTP server.

Port mappings as well as optionally DHCP leases (this allows for fixed addresses in the internal network) can be saved to flash memory.

Re: WiFi Repeater (aka. WiFI NAT Router) with Monitoring Por

PostPosted: Fri Feb 10, 2017 7:08 am
by MSc
Hi,

now I have tested an it works like a charm.
many thanks

Re: WiFi Repeater (aka. WiFI NAT Router) with Monitoring Por

PostPosted: Mon Mar 13, 2017 4:03 pm
by martin_g
Uploaded a new version of the WiFi Repeater (WiFI NAT Router) to https://github.com/martin-ger/esp_wifi_repeater .

Now it is even more an IoT device as it now supports configuration as well as status and event reports via MQTT. Status reports and events (e.g. when a STA has joined) are published. Commands can be sent as the WiFi Repeater is able to subscribe to a special command topic. (For details see the Readme.md file)

Does this make sense? I think so: consider the following application scenarios:
- A home automation system can switch on and off the soft AP or change ssid/password as result of another event.
- Special actions can be triggered, when a WiFi Repeater signals the join of a well-known MAC.
- More than one WiFi Repeater can listen to the same command topic. This allows for easy management even of a number of devices.
- Status reports can even be sent to an MQTT broker in the cloud, like e.g. the "EasyIoT Cloud". This allows for visualization, remote observation, and possibly even remote management.

If one doesn't like this feature - no problem: it is disabled in the default config and can be completely removed as compile time option.