Check my previous post about DIY home monitoring system before continuing. Also, try to acquire an Android phone before continuing. It will be a great asset.
Raspbian has python pre-installed, however, you might want to check the version.
Run the following:
sudo apt-get install python3-dev python3-psutil
Also, in order to analyse bluetooth HCI packets, you need to install bluez. The hcidump utility allows the monitoring of bluetooth activity, i.e. the activity of your tags.
sudo apt-get install bluez bluez-hcidump
Get your ruuvi’s up and running
Next, put your ruuvi tags in action. Open the package (if you have not already) and wire up your tags. You can watch this helpful video of how to get started with ruuvi’s first. You want to use the data format 4. You can change the data format at any time, but for the purpose of this post, use 4.
Android part
Now, if you have an Android phone, use it (or borrow from a friend at this point). Find the app called RuuviScanner and install it. Open the app and click on the menu on the upper left corner. Click Add new device. Find the ruuvi’s nearby. Pay attention to the MAC address and identifier (a letter or a number). You will soon need them.
What’s the plan?
RuuviTag Sensor is a Python library for communicating with RuuviTag BLE Sensor Beacon and for decoding sensors data from broadcasted eddystone-url. You will use this library for collecting the data from sensors with your Rasbian. Later-on you will store the data and forward it to Power BI for reporting purposes.
Next you should read the following story: https://pypi.org/project/ruuvitag_sensor/. You can install the latest version or the latest development version. Depending on your python version, use one of the commands below:
sudo pip3 install ruuvitag_sensor
sudo pip install ruuvitag_sensor
You might need to install the missing libraries to your Rasbian. Check the following page Installing Python packages for helpful info.
Next, collect the MAC addresses of your ruuvi’s with the help of the Android program. Also create a new folder under your web root directory
cd /var/www/html/
sudo mkdir /data/
You can use whatever name you like, I use “data”. We are close to a solution.