install paho-mqtt on openWRT

download openWRT source

./scripts/feeds update

./scripts/feeds install python

make

ls -l bin/ipq806x/packages/packages/python*

scp all the python ipk file to openWRT

opkg install python*

then you will find below package not found

* satisfy_dependencies_for: Cannot satisfy the following dependencies for python-codecs:
* libffi *
* opkg_install_cmd: Cannot install package python-codecs.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for python-db:
* libdb47 *
* opkg_install_cmd: Cannot install package python-db.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for python-gdbm:
* libgdbm *
* opkg_install_cmd: Cannot install package python-gdbm.

and my openwrt only have 32MB

so I try another way, just install the module needed while install mqtt

opkg install python-base_2.7.9-6_ipq806x.ipk python-distutils_2.7.9-6_ipq806x.ipk python-light_2.7.9-6_ipq806x.ipk libffi_3.0.13-1_ipq806x.ipk python-email_2.7.9-6_ipq806x.ipk

wget https://pypi.python.org/packages/source/p/paho-mqtt/paho-mqtt-1.1.tar.gz

scp paho-mqtt-1.1.tar.gz root@192.168.1.1:/root/

tar zxf paho-mqtt-1.1.tar.gz

cd paho-mqtt-1.1/

python setup.py install

used 4.8MB for above modules

/dev/ubi0_2 31.5M 4.6M 25.3M 15% /overlay
/dev/ubi0_2 31.5M 9.4M 20.4M 32% /overlay

now I can do import paho in python

 

發表留言