Asus RT-AC66U: How to Configure DHCP Static IP Reservations for IOT/Smart Home Devices

533bdddb0ad6e58

I’ve never been a fan of using DHCP reservations to reserve an IP address for a device. However, there are a few situations where a static reservation is the best route to take.

Try your hand with Home Automation via devices like the Wink Hub,  IP cameras,  smart plugs,  satellite receivers, or even the Raspberry Pi and you will know full well the right time to use a static IP reservation.

In this post, I am going to walk you through that process on the Asus RT-AC66u.

First, log into your Routers webUI, select “LAN” in the left-hand menu. Then select the “DHCP Server” tab. Scroll midway down the page. Locate “Enable Manual Assignment” and select the “Yes” radio button.

asus0

 

Just below the section above, you will see a drop down box that you can use to select your device using the MAC or currently assigned IP. Enter the “Hostname” for the device. Select “Add/Delete“. This will add your device to the list.

 

asus3

Scroll down and find your device in the list. Select the icon to the left.  Change the “Name” of the device if you so desire. The only really important information here is the “IP” and the “MAC”. 

asus4

 

 

Here you also can change the default icon for the device, or add your own custom icons. Here, I am using a camera icon that I downloaded.

asus6

 

Below you can see some of the custom icons and names that I have set to help me keep track of my devices.

asus-1

 

Asus RT-AC66: Cannot Login Unless Logout Another User First

asus-rt-ac66u

 

When attempting to login to your router’s webUI, you may have run into the error below.

cannot Login unless logout another user first.

This error is usually caused by improperly closing router’s WebUI. This can occur if you are logged in and lose connectivity, or if your browser crashed.

Fortunately, the fix is simple… Assuming you have SSH enabled.

First, SSH into your router and run the two commands shown below.

admin@RT-AC66U:/tmp/home/root# nvram unset login_ip
admin@RT-AC66U:/tmp/home/root# nvram commit

See screenshot below

login-cleanup

Now, attempt to login via the webUI. You should be able to log in without issue.

If you do not have SSH or telnet enabled, you can just power cycle your router.

 

 

Home Assistant: Checking configuration.yaml for errors

alexa-512x512

See instructions below on how to verify your configuration.yaml.

Ssh into your Home Assistant host. In my environment, I am running home assistant on a Raspberry Pi 2.

First I ssh as root. I have manually set the root password and have enabled root logins via /etc/ssh/sshd_config.  I have also added a static DNS entry for my Raspberry Pi 2.

 $ ssh root@ha

Su to the user, homeassistant.

root@ha:/var/log# su – homeassistant

Then run the command below.

homeassistant@ha:~ $ /srv/homeassistant/bin/hass –script check_config
Testing configuration at /home/homeassistant/.homeassistant

If you run into an error, you should see output similar to the example below.

homeassistant@ha:~ $ /srv/homeassistant/bin/hass –script check_config
Testing configuration at /home/homeassistant/.homeassistant
17-02-27 18:20:43 ERROR (MainThread) [homeassistant.bootstrap] Invalid config for [media_player.directv]: required key not provided @ data[‘host’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/media_player.directv/
Failed config
media_player.directv:
platform: directv

In the example above, there is an issue with my directv config. I will need to troubleshoot.

 

OpenStack: Rabbitmq Cannot Join Cluster, Already a Member

rabbitmq-sh-600x600

You can run into this error when attempting to join a node into a Rabbitmq cluster when the cluster believes that a particular node is already a member of the cluster. I have run into this issue a few times and is usually seen when attempting to recover from a crash of an OpenStack controller.

I have run into this issue a few times and is usually seen when attempting to recover from a crash of an OpenStack controller.

Below are the steps to resolve the issue.

The error below is seen when attempting to add a node back into the cluster.

INFO REPORT==== 27-Jan-2017::16:57:22 ===
Already member of cluster: [rabbit@nodectrl2,rabbit@nodectrl1,
rabbit@nodectrl0]

We check the cluster status for confirmation.

root@nodectrl1 rabbitmq]# rabbitmqctl cluster_status
Cluster status of node rabbit@nodectrl1 …
[{nodes,[{disc,[rabbit@nodectrl0,rabbit@nodectrl1,
rabbit@nodectrl2]}]},
{running_nodes,[rabbit@nodectrl2,rabbit@nodectrl1]},
{cluster_name,<<“rabbit@nodectrl0.localdomain”>>},
{partitions,[]},
{alarms,[{rabbit@nodectrl2,[]},{rabbit@nodectrl1,[]}]}]

Now we force the cluster to forget the affected node.

[root@nodectrl1 rabbitmq]# rabbitmqctl forget_cluster_node rabbit@nodectrl0
Removing node rabbit@nodectrl0 from cluster …

We then check the cluster status to ensure that it has been removed from the cluster.

[root@nodectrl1 rabbitmq]# rabbitmqctl cluster_status

Cluster status of node rabbit@nodectrl1 …
[{nodes,[{disc,[rabbit@nodectrl1,rabbit@nodectrl2]}]},
{running_nodes,[rabbit@nodectrl2,rabbit@nodectrl1]},
{cluster_name,<<“rabbit@nodectrl0.localdomain”>>},
{partitions,[]},
{alarms,[{rabbit@nodectrl2,[]},{rabbit@nodectrl1,[]}]}]

We can now add our node back into the cluster.

[root@nodectrl1 rabbitmq]#  rabbitmqctl -n nodectrl1 join_cluster rabbit@nodectrl0.localdomain

OpenStack: instackenv.json Format Example

stack-example

Here is a quick and dirty example of the format of your instackenv.json. This is the file that Ironic uses to import nodes.

Enter your IPMI user id under “pm_user”

Enter your IPMI password under “pm_password”

 

{
"nodes":[
    {
        "mac":[
            "74:E6:E2:FB:71:B0"
        ],
        "cpu":"4",
        "memory":"6144",
        "disk":"40",
        "arch":"x86_64",
        "name":"control01",
        "pm_type":"pxe_ipmitool",
        "pm_user":"admin",
        "pm_password":"admin",
        "pm_addr":"10.75.99.120"
    },
    {
        "mac":[
            "74:E6:E2:FB:71:D6"
        ],
        "cpu":"4",
        "memory":"6144",
        "disk":"40",
        "arch":"x86_64",
        "name":"control02",
        "pm_type":"pxe_ipmitool",
        "pm_user":"admin",
        "pm_password":"admin",
        "pm_addr":"10.75.99.119"
    },
    {
        "mac":[
            "74:E6:E2:FB:73:D0"
        ],
        "cpu":"4",
        "memory":"6144",
        "disk":"40",
        "arch":"x86_64",
        "name":"control03",
        "pm_type":"pxe_ipmitool",
        "pm_user":"admin",
        "pm_password":"admin",
        "pm_addr":"10.75.99.118"
    },
    {
        "mac":[
            "74:E6:E2:FB:27:D4"
        ],
        "cpu":"4",
        "memory":"6144",
        "disk":"40",
        "arch":"x86_64",
        "name":"compute01",
        "pm_type":"pxe_ipmitool",
        "pm_user":"admin",
        "pm_password":"admin",
        "pm_addr":"10.75.99.117"
    },
]
}