Saturday 24 October 2015

Using the ESP8266 as a WiFi range extender

This blog article refers to my YouTube Video you find here.
It shows how an ESP8266 module (like this one) can be used as a (rather unreliable) WiFi range extender.

Overview of the setup

Beside an ESP8266 module, you need to:

  • download the modified firmeware here and flash it to your module 
  • copy the DNS forwarder script from here to your module
  • add a route to the subnet to your default gateway (i.e. usually  your WiFi dsl/cable router)
  • attach the module to your WiFi network and run it in StationAP mode:
 tmr.alarm(0, 500, 1, function()  
     if wifi.sta.getip()==nil then  
      print("Connecting to AP...")  
      print("Connected as: " .. wifi.sta.getip())  

  • connect another device to the "intarwebs" SSID. If you want to really use that, you should encrypt that side as well. Here is how.
The disconnects from the Wifi Router appear to be related to  big packets and/or heavy traffic. It has been suggested that it might be a power issue, but neither with the scope, nor with the Fluke 87V's min/max function I was able to detected a significant voltage drop.
I have captured the traffic with wireshark, but could not make sense of it yet. My best guess at the moment is that with a big TCP windows size, the module runs into a buffer size problem or that it is busy for too long on the "left" side. The module only has one radio to serve both connections, so unlike your typical router, it can't forward a continuous stream of packets.