Arduino Yun used as Wi-Fi hotspot I use for a project an Arduino Yun with Node.JS + socket.io to provide interactivity between a smartphone, driving through a webpage different devices. 

I would like to enable this service for several smartphones at the same time. However I would like to work in the very same conditions that a (well configured) hotspot does:


I want to ensure that no user can see the other users on the network,
I want to have a limited number of connections on the Yun at the same time,
I want to force the different users when connected to the Wi-Fi to be routed to a captive portal on the first connection.


Does anyone know first if it is possible with an Arduino Yun (maybe some actions must be performed on a NodeJS virtual server as point 2). If yes, do you have a tutorial or any clues (do I have to use LuCi)?

Last question, in the same topic, I would like to use a fast granted access using NFC tag emulation to provide Wi-Fi credentials. Has anyone tried this with Arduino Yun and a shield?
Finally, here is how I did the job. In short, I separated the two topics of getting a trace of any user using socket.io and giving a limitations of the number of users.

First, my Arduino Yun is on a Ethernet network where a router, acting also as the internet gateway, is a dhcp server. My Arduino Yun have a static IP address in the subnet of this router (so it is not a dhclient). This can be set either by modifying the file /etc/init.d/network.

Including the lines:

config 'interface' 'wan'
        option 'proto' 'static'
        option 'ifname' 'your_interface_name'
        ipaddr xxx.xxx.xxx.xxx


or by using the LuCi interface.

For more information about the way to properly configure the network in OpenWRT, see Network configuration.

Then the router is set to authorize only few IP addresses. 

The last step is to bridge the Wi-Fi and the Ethernet (WAN and LAN) keeping the configuration of the Ethernet interface. This can be done using the LuCi interface. Be careful of what interface configuration you keep. How to setup an OpenWRT router as a Wi-Fi bridge to an Ethernet router gives the way to do this.

Note that this can also be done using the Arduino Yun as a DHCP server if you don't want to be connected on a network.

In the end, any connections on the Arduino Wi-Fi will get its IP address in the authorized range (up to 16 users at the same time in my case) by the router/DHCP server through the bridge.

In socket.io, I took the id that is given to any connected client and the IP address to ensure that I have a same user.

About the NFC dynamic tag, I developed a NFC specific board with a dynamic tag in the Arduino Yun/Uno format and its library to push through the bridge between ATmega and Atheros any new Wi-Fi code or any webpage. I think it is outside of this scope so if you need anything about this I can give you in PM.

I finally get at the end a device:


Connected to an existing network and accessing the internet,
Serving the webpages I want using my node serve,
Able to push any information on any other devices on the network through my nodeJS server,
Enabling access to people to local or network content,
Serving some specific local information through the NFC shield.