Skip to content
Snippets Groups Projects
README.rst 4.87 KiB

xAAL Python stack

Requirements

To install xAAL for Python, you need Python3.

Un*x like

Install the following packages:

  • subversion
  • python3-dev
  • python3-setuptools
  • libsodium-dev

For Debian / Ubuntu users:

$ apt-get install subversion python3-dev libsodium-dev python3-setuptools gcc
# recommended
$ apt-get install python3-venv python3-pip

Install

Right now, there is no public release (pip based) of xAAL Python binding, so you have to install things from SVN or archive.

You can use virtualenv (recommended).

First build a virtualenv :

$ python3 -m venv xaal_env

Everytime, you want to use the binding, you must source the activate script.

$ source xaal_env/bin/activate

Download sources from SVN:

$ svn checkout https://redmine.telecom-bretagne.eu/svn/xaal/code/Python/trunk/ xaal_svn

First, install the xaal.lib package:

$ cd xaal_svn/libs/lib/
$ python setup.py develop

Install the monitor lib (needed by Dashboard, REST API..)

$ cd xaal_svn/libs/monitor/
$ python setup.py develop

Install the schemas (needed by some devices)

$ cd xaal_svn/libs/schemas/
$ python setup.py develop

Install the tools

$ cd xaal_svn/apps/tools
$ python setup.py develop

You can use the python setup.py install instead of develop, but modification in source files, won't be applied, you have to re-install it. Right now develop, is the best option.

Create the configuration file in your home directory:

$ mkdir ~/.xaal/
$ cp xaal_svn/libs/lib/xaal.ini.sample ~/.xaal/xaal.ini
$ xaal-keygen

xaal-keygen will compute an key for a given passphrase. Edit the xaal.ini file according to your needs.

Tests

First, you can launch a message dumper with this tools

$ xaal-dumper
$ or xaal-tail

To start an fake lamp:

$ python -m xaal.dummy.lamp

To check devices, you can use:

# search alive devices
$ xaal-isalive

# search lamp.basic devices
$ xaal-isalive -t lamp.basic

# search any kind of lamp
$ xaal-isalive -t lamp.any

# display description / attribute
$ xaal-info xxxxxxxxxxxxxx <- uuid

# display description / attribute for all devices
$ xaal-walker

# same but on for lamp devices
$ xaal-walker -t lamp.any