Skip to main content

Two routers configuration for Smart Home

When setting up the smart home system using WIFI as the core network infrastructure, it is important to split the surfing traffic and smart home traffic. This will ensure that the smart switches respond timely. 

For my smart home setup, I have used 2  Asus routers (RT-AC1200G+ & RT- AC68U), one is configured as the main the other configured as the slave. There is no reason why a particular model is chosen as it is based on what I have on-hand but it is better to have dual-band routers because I will have 4 separate bands (Two 5Ghz and two 2.4 GHz) of network bandwidth.




The router is configured as a Master-slave mode with different subnets and network route is added to make sure that the traffic can flow both ways. The smart switches are all connected to a dedicated 2.4 GHz bandwidth and the remaining 3 bands are for normal surfing.

For normal surfing, in order to the client devices to automatic connect to the strongest signal frequency, all the SSIDs have to be the same.  So the client device will automatically connect to the strongest signal router.

For some reason, setting up the static route in the web interface does not enable the routing. A separate route has to be added to the iptables by Telnet into the console. The following are the commands to set the iptables:

# to list all the forwarding rules  
iptables -L FORWARD -v

# add an entry to allow all traffics between the 2 routers.
iptables -I FORWARD 3 -i br0 -o br0 -j ACCEPT

Comments

Popular posts from this blog

Using ESP-Link transparent bridge (ESP-01 and Arduino Pro Mini)

Recently stumbled across an interesting open source project ESP-Link. Its main purpose is to network-enable a non-network microcontroller (MCU) such as Arduino Uno, Pro mini or Nano using ESP8266. The author termed it as "Transparent Bridge". The ESP and MCU  communicate via the serial link and there is a companion Arduino library EL-Client for the MCU to connect up the network using MQTT, REST, TCP and UDP.
Setup I have put together an ESP-01 and an Arduino Pro Mini for this experiment. I have chosen a 3.3 version Pro mini so that I do not need to do any voltage level shifting between the I/O pins. In order to have a stable voltage source, the ESP8266 is powered by Pro Mini and the Pro Mini "RAW" pin is connected to a 5v USB power source. The RAW pin can take voltage up to 12V. The reset pin of Pro Mini is connected to GPIO 0 of ESP-01. This enables the ESP-01 to reset the Pro Mini.




I have linked up an APDS 9960 sensor to it and periodically send the luminosity a…

Using ESP-Link transparent bridge (ATmega2560+ESP8266 board)

I have found this interesting board selling on Aliexpress website. It is an Arduino Mega 2650 with a built-in ESP8266 which allows the Mega to connect to wifi. This board has cut down a lot of wiring and bring out interesting possibilities. One of this is to connect up both the microcontrollers using ESP-link firmware. I have an earlier blog post that described how to wire up an ESP-01 and Arduino Pro Mini.



One of the tricky parts in this setup is the sequence of flashing the ESP firmware. Flashing the onboard ESP8266 requires some setting changes to the dip switches. The following are the sequences which I get both the microcontrollers to talk to each other.
Set the jumper 5,6,7 to ON and the rest OFF. This will set the ESP to update mode.I am using version 3.0.14 and flashed the ESP using the following parameters:
esptool --port com26 --baud 230400 write_flash -fm dio -fs 4MB -ff 80m 0x0 boot_v1.6.bin 0x1000 user1.bin 0x3fc000 esp_init_data_default.bin 0x3fe000 blank.bin After flash…

DIY Sonoff RF Bridge

Tasmota recently supported the RF bridge by iTead which allowed for RF 433 remote devices to be controlled/controlling using Sonoff products. e.g A handphone can be used to control a remote RF device or an RF remote control can use to control a WIFI enabled device.

By using Tasmota, I can control the device using MQTT. This idea fits exactly to my smart home plan. Here is the schematic:



I cheated a bit by having ESP01 mounted on a breakout board. This breakout board converts all the external pins to 5v which simplified the wiring and I do not need to use a voltage level shifter. Moreover, the Arduino 3.3v power does not have enough current to power the ESP reliably and I have to power it via the 5V from Arduino Uno. Next, I used an Arduino Uno prototype shield with a tiny breadboard to hold all the components together. For the RF 433 transmitter/receiver, I am using the development kits when I purchased the all-in-one Arduino development kits. An antenna is added for more sensitivity.