Hi rmyers and aspexin,
Below are the basic steps for getting the SDK working on the ar300m, but I would think that the steps would generally apply for other OpenWRT devices.
The one caveat is the amount of storage the device has - I went for the ar300m with 128mb of storage to ensure that I had enough headroom for installing the dependencies.
I would think that you could install it on a device with 16mb of storage but you might have to remove some packages not needed (possibly python-base rather than python-light?).
I also stuck with the stock firmware although you might be able to get some more space with vanilla OpenWRT.
I tried the deployment on an X86 version of OpenWRT running under VirtualBox before installing on the ar300m - This just meant that when I got something wrong I could go back to a snapshot so I knew that I was on a clean build.
I also did the git clone onto my laptop rather than copy the full GoTenna repository to the router.
The actual steps of installing the SDK follow closely the GoTenna instructions (apologies if I have missed anything - when I have time I will reset the device and run through the steps to check).
You will also need internet access for the router during the setup stage - either by cable or WISP mode, SSH also needs to be enabled (its was on by default on my device).
I also found that I had to connect the laptop to the router.
The basic process is:
1 - Update the package manager (this needs to be done every time the device is rebooted):
2 - Then I installed python 2.7 and went for the “python-light” package (https://openwrt.org/docs/guide-user/services/python), you might get away with python-base but I would expect that you need to install some other python packages:
opkg install python-light
3 - You then need to install the python package manager (pip):
opkg install python-pip
4 - Then you need to install cffi and cryptography support, the packages are different to the GoTenna documentation:
opkg install python-cffi
opkg install python-cryptography
5 - I found that I was getting an “out of memory error” when I initially tried to install the GoTenna SDK, to solve this I found that upgrading pip resolved the problem (even though I had just installed it…):
pip install --upgrade pip
6 - Make a working directory on the router:
7 - On a laptop get the GoTenna SDK from gitlab, then copy the install file to the router:
scp goTenna-0.12.5-py2-none-any.whl email@example.com:/gotenna/
8 - You can install the GoTenna SDK:
pip install goTenna-0.12.5-py2-none-any.whl
9 - To test the installation works, launch python:
It will either work by simply returning to the prompt or throw an error about a failure to import the “spi” library (it takes a few seconds to load).
10 - I could not find a suitable package and the router does not appear to have an spi interface, so I edited the following file:
I changed the string “Linux” on line 34 (I think but check the line number in the error message), to “Linux-Disabled” and this stopped the SDK attempting to load the library.
11 - You can then copy the “sample.py” script to the router and if you have a valid API Key it should all work…
Hope this makes sense and works for you…