Skip to content

How to Use

Xiangmin Xu edited this page Apr 19, 2022 · 2 revisions

Prerequistes

IMPORTANT

  1. This project has dependencies on cURL. To build cURL, we need the OPENSSL developer kit and curl lib:
sudo apt-get install libssl-dev libcurl4-openssl-dev
sudo apt install curl
  1. To use the I2C bus, make sure the linux I2C dev library is installed:
sudo apt-get install libi2c-dev
  1. To use the Qt lib, make sure ALL Qt dependencies have been installed:
sudo apt-get install qtdeclarative5-dev-tools libqwt-qt5-dev qtmultimedia5-dev qtbase5-dev
  1. To enable the tests, remember you have BOOST lib installed:
sudo apt install build-essential libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev

First things first: Build the program:

mkdir build && cd build
cmake ..
make

1. Unit Tests

make test

2. Hue light bulb brightness control: How to use

If you are new user to Hue, this command will automatically set the light bulb ready for you, you just need press the physicall hue button:

./Hue new

Then press the Hue Bridge button, you will get the json reply, following is an example:

[{"success":{"username":"HmAE6GByMxd1-3Lufz77SJUTJhRgIEFQhvUkEa3E"}}]

The IP and username are stored in log.txt, you can just go to the last step to adjust the brightness.

If you want to modify your static IP or username, you can:

./Hue user HmAE6GByMxd1-3Lufz77SJUTJhRgIEFQhvUkEa3E
./Hue ip 192.168.0.112

You can also do:

./Hue ip 192.168.0.112 user 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

Or just modify the log.txt:

192.168.0.100 <Your Bridge IP here>
S7BnUlaWvwAs6dZgYErkLO8GAWdRHTdTGi1wxwL0 <Your username here>

to modify both IP and user mannually.

After set IP and username, adjust the brightness like this:

./Hue 200

200 is brightness, integer, from 0-255, 0 means off.

3. MLX90640 main program: How to use:

sudo ./main