brewpi-brewometer
brewpi-brewometer copied to clipboard
Not Issue - Install Suggestion
@sibowler Here are directions that I think will greatly help all of your new RaspPi / new users going in the right direction quickly...
So I had my BrewPi all set up, added in the extra "security" features (to allow for Public/Private viewing) as well as hosting 2 web servers on my RaspPi. Below should be the steps to get you back up and brewing with the Tilt Hydrometer working.
-
cd /home/brewpi
-
sudo git clone https://github.com/sibowler/brewpi-brewometer.git
-
sudo apt-get install bluez python-bluez python-scipy python-numpy libcap2-bin
-
sudo setcap cap_net_raw+eip $(eval readlink -f ``which python
)` -
python /brewpi-brewometer/tiltHydrometer-test/TiltHydrometerTest.py
-
cd brewpi-brewometer/brewpi-web/
<------- only do these steps if you have already completed the "PublicBeerPanel" setup----->
-
cp index.php admin.php
(this copy/pastes the index pages as the new admin page, due to Public/Admin setup; the goal is to replace the admin.php page [current] with this new page) -
rm -r index.php
(this deletes the index.php page from the Tilt additional code, so it won't overwrite the current index.php page)
<-------end of PublicBeerPanel specific directions------------------------------------------>
-
sudo cp -r * /var/www/html/BrewPi/
(This is because I am running 2 web servers and this is where BrewPi is at) -
sudo chown -R www-data:www-data /var/www/html/BrewPi/
-
cd /home/brewpi/brewpi-brewometer/brewpi-script/
-
sudo cp -r * /home/brewpi/
-
sudo chown -R brewpi:brewpi /home/brewpi
-
sudo shutdown -r
I hope this helps. If you need to take a look at how I was setting up the PublicBeerPanel to see I missed anything I have it posted here as well... http://backpackbees.com/home-brewing/brew-controller-brew-servers/
I wasn't able to fully test because I don't have my Tilt Hydrometer yet.
Hey! Im giving your instructions a go but on step 5 i get:
root@2ff923962d6a:/home/brewpi# python ./brewpi-brewometer/tiltHydrometer-test/TiltHydrometerTest.py ERROR: Loading default settings file (tiltHydrometer/settings.ini): No section: 'Manager' Scanning - 20 Secs (Control+C to exit early) Red: None Green: None Black: None Purple: None Orange: None Blue: None Yellow: None Pink: None Unhandled exception in thread started by <bound method TiltHydrometerManager.scan of <TiltHydrometer.TiltHydrometerManager instance at 0xb51c7738>> Traceback (most recent call last): File "/home/brewpi/brewpi-brewometer/tiltHydrometer-test/TiltHydrometer.py", line 360, in scan blescan.hci_le_set_scan_parameters(sock) File "/home/brewpi/brewpi-brewometer/tiltHydrometer-test/blescan.py", line 107, in hci_le_set_scan_parameters old_filter = sock.getsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, 14) _bluetooth.error: (9, 'Bad file descriptor')
Looks like a typo in your command:
python /brewpi-brewometer/tiltHydrometer-test/TiltHydrometerTest.py
is the command in step 5
You entered:
python ./brewpi-brewometer/tiltHydrometer-test/TiltHydrometerTest.py
(should be python / not python ./)
Im not too proficient with coding, but with the way brewpi is installed with the new containers on the raspberry ./ is the only way i can access the "brewpi-brewometer" folder. If I use / then it says the folder doesn't exist.
and even if I cd into that folder and run I still get:
root@2ff923962d6a:/home/brewpi/brewpi-brewometer/tiltHydrometer-test# python TiltHydrometerTest.py
Scanning - 20 Secs (Control+C to exit early)
Red: None
Green: None
Black: None
Purple: None
Orange: None
Blue: None
Yellow: None
Pink: None
Unhandled exception in thread started by <bound method TiltHydrometerManager.scan of <TiltHydrometer.TiltHydrometerManager instance at 0xb51ed738>>
Traceback (most recent call last):
File "/home/brewpi/brewpi-brewometer/tiltHydrometer-test/TiltHydrometer.py", line 360, in scan
blescan.hci_le_set_scan_parameters(sock)
File "/home/brewpi/brewpi-brewometer/tiltHydrometer-test/blescan.py", line 107, in hci_le_set_scan_parameters
old_filter = sock.getsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, 14)
_bluetooth.error: (9, 'Bad file descriptor')
^CTraceback (most recent call last):
File "TiltHydrometerTest.py", line 21, in
If using brewpi via Docker, run your container with --net host to access bluetooth...
Yup! That did it. I now get a reading from my Tilt while running the test. Thank you, I am still new to using Dockers. For now I have a fermentation going on so I am going to wait until that is over before proceeding past the TiltHydrometerTest, but so far so good.
when I run brewpi.py as non-root, I get this error in the log:
Unhandled exception in thread started by <bound method TiltHydrometerManager.scan of <TiltHydrometer.TiltHydrometerManager instance at 0x745454e0>> Traceback (most recent call last): File "/home/brewpi/TiltHydrometer.py", line 374, in scan blescan.hci_enable_le_scan(sock) File "/home/brewpi/blescan.py", line 79, in hci_enable_le_scan hci_toggle_le_scan(sock, 0x01) File "/home/brewpi/blescan.py", line 103, in hci_toggle_le_scan bluez.hci_send_cmd(sock, OGF_LE_CTL, OCF_LE_SET_SCAN_ENABLE, cmd_pkt) _bluetooth.error: (1, 'Operation not permitted')
This feels like I missed the setcap command, but I ran it.
This revised setcap worked for me
sudo setcap 'cap_net_raw,cap_net_admin+eip' $(eval readlink -f `which python`)