- configure a domain
- create a vhost or container with php/webserver/ssl certificate on your server for the domain
- create data/ dir in webroot with write access for webserver
- configure mqtt parameters
- run and debug until it works :)
wget https://getcomposer.org/installer
php installer --install-dir=bin --filename=composer
php bin/composer require php-mqtt/client
if [ ! -d "data" ] ; then
# create data dir, set permissions
mkdir -p data
chmown root/www-data data
chmod ug+rwx data
chmod o-w data
fi
if [ ! -f "config.mqtt.php" ] ; then
cp config.mqtt.php.template config.mqtt.php
fi
sources used to assemble this:
- madavi-api data_simple.php airrohr sensor data API example License not stated, but recommended as starting point by author, and other works like the corresponding firmware
- php-mqtt/client library's example code 01_authorize_with_username_and_password.php, both MIT license
The european Joinup Licensing Assistant compatibility checker states, that the permissive MIT license allows redistribution under other licenses, so here EUPL-1.2 is our choice.
Licenses handled and added via the great reuse tool, thanks to all contributors of openly licensed source code and infrastucture! Shoutout for great dev/debug sessions with Alex.
Such a functionality seems to have been already implemented elsewhere at jklmnn/airrohr-mqtt for Homeassistant.