Home Assistant Community

Installing Home-Assistant on Linksys EA6500v2 Router or Entware enabled router

mqtt
router
Tags: #<Tag:0x00007fcf4d0d2c48> #<Tag:0x00007fcf4d0d2ab8>
#1

See updated post here with all necessary commands.

You may need to upgrade CFE. Follow below guide before starting installation of home assistant.

Hello Everyone,

As this is my very first post, please pardon if I’ve posted it into an incorrect forum. I wanted to share my experience on installing Home-Assistant on Linksys EA6500v2 running Tomato Firmware 1.28.0000 -3.5-140 K26ARM USB AIO-64K.

First step was to install entware on the router using this guide.

http://tomatousb.org/tut:optware-installation

Next step was to install python 3 on the router, by using command “opkg install python3”.
Below guide helped setup rest of the packages.

Next step was to install home assistant by using setup tools, wheels and then homeassistant it self by using below commands.

HOME=/opt/ha/ pip3 install homeassistant
–/opt/ha is the path that I want to use as temp path for compilation.

Also installed MQTT Broker by below command.

HOME=/opt/ha/ pip3 install hbmqtt

Next was to daemonize the two application on router, below are commands.

daemonize -c /opt/ha/ -p /opt/ha/pid.file -l /opt/ha/lock.file -o /opt/ha/out.log -e /opt/ha/err.log   /opt/bin/hass --c /opt/ha
daemonize -c /opt/hbmqtt/ -p /opt/hbmqtt/pid.file -l /opt/hbmqtt/lock.file -o /opt/hbmqtt/out.log -e /opt/hbmqtt/err.log  /opt/bin/hbmqtt -c /opt/hbmqtt/config.yaml

Configuration is standard configuration.

Edit 2018Oct
I ended up using mosquitto mqtt client as I was hbmqtt was not relaying/dispatching messages reliably.

opkg install mosquitto-nossl

And we can follow mosquitto configuraiton guide as usual. I could not get ssl version working for mosquitto.

Cheers.

2 Likes
Home Assistant on OpenWrt device
#2

Hi,

There were no problems installing cffi? Can’t pass this error in entware:

  Using cached https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz
    Complete output from command python setup.py egg_info:

        No working compiler found, or bogus compiler options passed to
        the compiler from Python's standard "distutils" module.  See
        the error messages above.  Likely, the problem is not related
        to CFFI but generic to the setup.py of any Python package that
        tries to compile C code.  (Hints: on OS/X 10.8, for errors about
        -mno-fused-madd see http://stackoverflow.com/questions/22313407/
        Otherwise, see https://wiki.python.org/moin/CompLangPython or
        the IRC channel #python on irc.freenode.net.)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /opt/tmp/pip-install-7fyyfg9d/cffi/
#4

Thank you for your guide, managed to install it on a R7000 with an modded ASUSWRT image from xvortex

Had several errors with some python package, had to edit the cffi package per guide section at the bottom.

ps- maybe adjust your title as it can be installed on many routers who support the latest Entware packages

1 Like
#5

Not really. Did not run into that error.

#6

Glad to hear I was helpful

Sure, Let me edit the title

#7

Hi,
Share your installation instructions cffi please :wink:

#8

see here

#9

Followed the instructions, but encountered an error. My actions:

  1. downloaded and unzipped the “cffi-1.11.5.tar.gz” archive to one of the directories
  2. Edited the contents of setup.py
  3. Run the command “python setup.py build” from the directory with “cffi-1.11.5”

An error is returned:

/opt/lib/cffi-1.11.5 # python3 setup.py build
unable to execute ‘mipsel-openwrt-linux-gnu-gcc’: No such file or directory
unable to execute ‘mipsel-openwrt-linux-gnu-gcc’: No such file or directory

No working compiler found, or bogus compiler options passed to
the compiler from Python's standard "distutils" module.  See
the error messages above.  Likely, the problem is not related
to CFFI but generic to the setup.py of any Python package that
tries to compile C code.  (Hints: on OS/X 10.8, for errors about
-mno-fused-madd see http://stackoverflow.com/questions/22313407/
Otherwise, see https://wiki.python.org/moin/CompLangPython or
the IRC channel #python on irc.freenode.net.)
#10

try installing gcc if its available for your architecture

opkg install gcc 
1 Like
#11

thx! Solved the problem after “Headers installation”

makwanajigneshm
lRadix
you have already set up autorun hass?

#12

Not auto run but in daemon mode. It does not start automatically but runs fine once started. I had a streak of 45 days continuous run before mosquito degraded.

#13

I installed cffi following the instructions: https://github.com/Entware/Entware-ng/wiki/Self-installation-of-python-modules


creating /opt/lib/python3.7/site-packages/cffi-1.12.2-py3.7-linux-mips.egg
Extracting cffi-1.12.2-py3.7-linux-mips.egg to /opt/lib/python3.7/site-packages
cffi 1.12.2 is already the active version in easy-install.pth

but I encountered an error when executing the command

HOME=/opt/ha/ pip3 install homeassistant

Could not find a version that satisfies the requirement cffi>=1.1 (from versions: )
No matching distribution found for cffi>=1.1

Please help.

#14

You may want to follow this guide.

By the way, I am using home assistant 0.75.3

1 Like
#15

Okay, So I ran into some troubles with the disk and I had lost all setup. So had to start from begining, starting from creating the opt partition. Below is the command log that is specific to HA.

opkg install gcc
opkg install busybox ldd make gawk sed
opkg install coreutils-install
wget -qO- http://pkg.entware.net/binaries/armv7/include/include.tar.gz | tar xvz -C /opt/include
opkg install python3
opkg install python3-pip
python3 -m pip install --upgrade pip setuptools
mkdir /opt/pip_home 
source /opt/bin/gcc_env.sh
cd /opt/lib
ln -s libffi.so.6 libffi.so
opkg install python-dev
opkg install python3-dev
HOME=/opt/pip_home pip3 install homeassistant

After long wait time, all packages are compiled and installed including cffi.

Installing collected packages: voluptuous, voluptuous-serialize, ruamel.yaml, Unidecode, python-slugify, attrs, multidict, idna, yarl, chardet, async-timeout, aiohttp, certifi, MarkupSafe, jinja2, pyyaml, pytz, astral, urllib3, requests, asn1crypto, six, pycparser, cffi, cryptography, PyJWT, bcrypt, homeassistant
Running setup.py install for voluptuous-serialize ... done
Running setup.py install for ruamel.yaml ... done
Running setup.py install for python-slugify ... done
Running setup.py install for multidict ... done
Running setup.py install for yarl ... done
Running setup.py install for MarkupSafe ... done
Running setup.py install for pyyaml ... done
Running setup.py install for pycparser ... done
Running setup.py install for cffi ... done
Successfully installed MarkupSafe-1.1.1 PyJWT-1.6.4 Unidecode-1.0.23 aiohttp-3.5.4 asn1crypto-0.24.0 astral-1.10.1 async-timeout-3.0.1 attrs-18.2.0 bcrypt-3.1.6 certifi-2019.3.9 cffi-1.12.2 chardet-3.0.4 cryptography-2.5 homeassistant-0.90.1 idna-2.8 jinja2-2.10 multidict-4.5.2 pycparser-2.19 python-slugify-1.2.6 pytz-2018.9 pyyaml-3.13 requests-2.21.0 ruamel.yaml-0.15.88 six-1.12.0 urllib3-1.24.1 voluptuous-0.11.5 voluptuous-serialize-2.1.0 yarl-1.3.0
#16

Hi, I followed your advice but I ran into this error:

Cannot allocate memory while executing command python setup.py egg_info

How can I solve this?

#17

Following below guide will help you.

1 Like
#18

Thank you for your reply but I´m doing this on Asus router.
Just for the record: turned out to be a problem with lack of RAM, so I resolved it easily by setting up a swap on external disk.

#19

Sorry for a newb question, I manged to install HA according to this post but I don´t know how to actually run it.

#20

How about reading something here?

#21

did you try this ?

daemonize -c /opt/ha/ -p /opt/ha/pid.file -l /opt/ha/lock.file -o /opt/ha/out.log -e /opt/ha/err.log /opt/bin/hass --c /opt/ha

then open with your http://routerIP:port