ESP8266 as WiFi access point

Hello,
I made the first attempts with ESPHome and it actually works quite well.
I would like to set up a small, self-sufficient WiFi network, initially without an LTE router for my mobile home.
What already works is the following configuration:

  • smartphone als Hotspot
  • Raspberry 3
  • ESP8266 with ESPHome
  • Laptop with Browser for HA

Now I would like to replace the cell phone hotspot, but as I said, not yet with a router.
I came up with the idea of ​​configuring the ESP as an access point, which also works.
Have the following WIFI entry in the yaml:

wifi:

ap:
ssid: “Esphome-Lastrada”
password: “myPasswortTestxxxx”

captive_portal:

switch:

If I enter this connection in the network settings of HA, it even works when I use HA
IP 168.192.4.100. However, I cannot access the ESP functions such as switches.

There is probably still an IP etc. missing in the yaml, right?

I hope I was able to get across what I’m planning to do, maybe it’s a bit unusual for one ESP
to be used as a hotspot and for the actual functions. But it would be cool if that worked.

Thank you in advance

Bernd

ESP devices cannot do routing for you. The AP you see there is for captive portaling.

I don’t know enough about ESP devices to comment on your specific proposal.

However several years ago I configured a RasPi as a portable Wi-Fi Access Point (for when at work). Routing, DHCP, firewall are built into linux (or easily added), and just needs to be configured. From memory, there was no easy way to swap between being an AP or being a client - so I ended up with 2 micro-SD cards.

Have a look at this project

2 Likes

Raspberry Pi can run Linux which comes built-in with router and Wi-Fi drivers. ESP devices (and popular frameworks thereof) do not come with routing code. The Wi-Fi repeater code that exists will give you maybe 2 megabits per second.

ESP devices are microcontrollers, not server class hardware.

The same guy made an ESP32 version: GitHub - martin-ger/esp32_nat_router: A simple NAT Router for the ESP32

You’re a guy full of (unbased) certainty, aren’t you :wink:

FYI and ideas, SuperHouseTV has a series connecting a RPi to a Ethernet interface to create an IoT access point. Later versions were circular with a 3D printed case.

TL;DR slow compared to commercial kit, but fine for Iot, and uses the Linux Kernel for routing between interfaces.

Just an ESP on its own might run a protocol gateway (e.g. like a MQTT server), but not sure if the network stack can support IP routing (certainly might need an ESP32).

1 Like

Oh wow 15 megabits. Lemme call my ISP and cancel my gigabit fiber, clearly this is enough.

On a more serious note, yes, you are right that I was not correct about the numbers. But I’m still relegating that ESP code to the status of toy, since any off-the-shelf $20 router or $50 Raspberry Pi can deliver 150-866 Mbps and do a proper routing job, not just NAT as the ESP code does (which renders devices attached to the ESP invisible to devices on the other side of the WLAN).

If you’re doing this for the fun, have as much fun as you want. I would not recommend trusting it for actual traffic that needs to be routed. Note that the code might only work in ESP32 devices, not ESP8266 devices.

Not saying, but for whatever reason, the subject of the thread is “ESP8266 as WiFi access point”.
I’m pretty sure the OP knows he can buy a COTS router :slight_smile:
Maybe the low power usage is a factor? Or just for fun, indeed…

Really have a hard time reading, do we :wink:
There are 2 different projects: one for ESP8266 and one, faster, for ESP32…

Cool. All the best to OP.