Download the PHP package unreal4u/ds18b20-sensor-read without Composer
On this page you can find all versions of the php package unreal4u/ds18b20-sensor-read. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ds18b20-sensor-read
RPi3 DS18B20 PHP7 Sensor reader
This package will read out rpi3 1-wire sensors and send the output of those readings to a MQTT broker.
Working of this package
Step 0:
Ensure you've got a running php7 installation on your RPi3. How to do this falls outside the scope of this application.
Don't forget to install composer as well. I'll assume it's installed at usr/bin/composer.phar
.
Step 1:
Install the library in a fresh directory, the minimum stability is there because many dependencies on this class does
not yet have any stable releases, this will change in the future:
Step 2:
Create a folder sensors/
, and in there create symlinks to the actual sensor id. Make the symlink a name for your
sensor, this name will be used for the topic name and general logging, for example:
Making the sensors actually work falls outside the scope of this application and you'll have to find out for yourself how to do this.
Step 3:
Create a configuration file. Create a new configuration file that extends BaseConfig.php
and adjust the values that
you use in your environment:
Step 4:
Create your proyect! I've included a small example of my current setup here, you can also take a look at the
examples/index.php
as an example and go ahead! I'll suppose you have created an app
folder in which you have created
your own configuration and runnable file:
Step 5:
Set up a cronjob that runs every X minutes in order to read out the sensors.
Cron examples:
Known issues
- If there is any problem whatsoever with the sensor, this package will fail silently. This may be changed in the future
- No real usage of the Logger so far, this will also change in the future in order to establish more easily problematic areas
- Some idea for the future: be able to publish to multiple topics at the same time
Enjoy!
All versions of ds18b20-sensor-read with dependencies
unreal4u/mqtt Version ^1.1
unreal4u/file-operations Version ~0.4.1
monolog/monolog Version ~1.23