Python Program tag_test.py Not Working!


#1

The Python program tag_test.py from https://github.com/ttu/ruuvitag-sensor/blob/master/install_guide_pi.md isn’t working… I followed all the instructions.

nick@wine:~/Python/ruuvitag-sensor $ hcitool dev
Devices:
hci0 B8:27:EB:1F:5E:BA
nick@wine:~/Python/ruuvitag-sensor $ sudo apt-get install libbz2-dev liblzma-dev libsqlite3-dev libncurses5-dev libgdbm-dev zlib1g-dev libreadline-dev libssl-dev tk-dev
[sudo] password for nick:
Reading package lists… Done
Building dependency tree
Reading state information… Done
libbz2-dev is already the newest version.
libgdbm-dev is already the newest version.
liblzma-dev is already the newest version.
libncurses5-dev is already the newest version.
libreadline-dev is already the newest version.
libsqlite3-dev is already the newest version.
libssl-dev is already the newest version.
tk-dev is already the newest version.
zlib1g-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nick@wine:~/Python/ruuvitag-sensor $ sudo apt-get install bluez-hcidump
Reading package lists… Done
Building dependency tree
Reading state information… Done
bluez-hcidump is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nick@wine:~/Python/ruuvitag-sensor $ pip3 install --user ruuvitag-sensor
Requirement already satisfied (use --upgrade to upgrade): ruuvitag-sensor in /home/nick/.local/lib/python3.4/site-packages
Requirement already satisfied (use --upgrade to upgrade): psutil in /home/nick/.local/lib/python3.4/site-packages (from ruuvitag-sensor)
Requirement already satisfied (use --upgrade to upgrade): rx in /home/nick/.local/lib/python3.4/site-packages (from ruuvitag-sensor)
Cleaning up…
nick@wine:~/Python/ruuvitag-sensor $ cd
nick@wine:~ $ python3 ~/.local/lib/python3.4/site-packages/ruuvitag_sensor --help
usage: ruuvitag_sensor [-h] [-g MAC_ADDRESS] [-f] [-l] [-s] [–version]

optional arguments:
-h, --help show this help message and exit
-g MAC_ADDRESS, --get MAC_ADDRESS
Get data
-f, --find Find broadcasting RuuviTags
-l, --latest Get latest data for found RuuviTags
-s, --stream Stream broadcasts from all RuuviTags
–version show program’s version number and exit
nick@wine:~ $ alias ruuvitag='python3 ~/.local/lib/python3.4/site-packages/ruuvitag_sensor’
nick@wine:~ $ ruuvitag -f
Finding RuuviTags. Stop with Ctrl+C.
Start receiving broadcasts
E9:A4:EF:14:A2:72
{‘pressure’: 1025.87, ‘humidity’: 84.5, ‘temperature’: 4.61, ‘acceleration_x’: -476, ‘acceleration_y’: -712, ‘acceleration_z’: 580, ‘battery’: 2827, ‘acceleration’: 1034.3693730964776}
D6:38:B8:3F:0C:01
{‘pressure’: 1023.0, ‘identifier’: ‘X’, ‘temperature’: 22.0, ‘humidity’: 40.0}
^CStop receiving broadcasts
nick@wine:~ $ cd Python
nick@wine:~/Python $ vi tag_test.py
nick@wine:~/Python $ chmod +x tag_test.py
nick@wine:~/Python $ cat ./tag_test.py
#!/usr/bin/python3

from ruuvitag_sensor.ruuvi import RuuviTagSensor

RuuviTagSensor.find_ruuvitags()

nick@wine:~/Python $ ./tag_test.py
No response…!


#2

Please open issue at the github repository if you cannot find a solution. If you do find a solution, please update the install instructions with a pull request.


#3

Hi!
You need to enable logging:

import ruuvitag_sensor.log
ruuvitag_sensor.log.enable_console()

to get print outs in the console.