Giter Site home page Giter Site logo

linjmeyer / tilt-pitch Goto Github PK

View Code? Open in Web Editor NEW
48.0 10.0 15.0 551 KB

Simple replacement for the Tilt Hydrometer mobile apps and TiltPi with lots of features

License: GNU General Public License v3.0

Python 100.00%
beer brewing tilt hydrometer prometheus influxdb python webhook grafana homebrew

tilt-pitch's People

Contributors

astephon88 avatar linjmeyer avatar nyanhp avatar robweber avatar shawnbuckley avatar taplistioteam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tilt-pitch's Issues

Install error?

Had an issue attempting to install tilt-pitch on my Linux Mint machine. I saved a text file of the readouts from the Terminal. Below is the last error I got:

plex@PLEXSERVER:~$ pip3 install tilt-pitch
Defaulting to user installation because normal site-packages is not writeable
Collecting tilt-pitch
Downloading tilt_pitch-1.0.2-py3-none-any.whl (36 kB)
Collecting influxdb-client[ciso]
Downloading influxdb_client-1.39.0-py3-none-any.whl (743 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 744.0/744.0 KB 4.7 MB/s eta 0:00:00
Collecting influxdb
Downloading influxdb-5.3.1-py2.py3-none-any.whl (77 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 KB 5.8 MB/s eta 0:00:00
Collecting pybluez
Downloading PyBluez-0.23.tar.gz (97 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.6/97.6 KB 1.8 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in PyBluez setup command: use_2to3 is invalid.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
plex@PLEXSERVER:$ pytho3 - pitch
Command 'pytho3' not found, did you mean:
command 'python3' from deb python3 (3.10.6-1
22.04)
Try: sudo apt install
plex@PLEXSERVER:$ python3 -m pitch
/usr/bin/python3: No module named pitch
plex@PLEXSERVER:
$

Crash due to casting issue when invalid gravity detected.

File "/home/jslay/.local/lib/python3.8/site-packages/pitch/pitch.py", line 138, in _beacon_callback
print("Ignoring broadcast due to invalid gravity: " + tilt_status.gravity)
TypeError: can only concatenate str (not "float") to str

pip3 setuptools version 59.6.0 not supported, causes the following error

Collecting pybluez
Using cached PyBluez-0.23.tar.gz (97 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in PyBluez setup command: use_2to3 is invalid.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Reverting setuptools to 57.0.0 allowed pip3 install tilt-pitch to run without errors.

pip3 install setuptools==57.0.0

408 error connecting to Brewfather stream

I am receiving an error "408 Client Error: Request Timeout for url: https://log.brewfather.net/stream?id=XxXxXxXxXxXx " when trying to post to brewfather using a raspi zero w.

I have tested my stream id URL with another program on the same raspi system (tilt_hydrometer) and the URL works fine, I am also able to access the stream URL in a browser, so I think this is something to do with tilt-pitch. I have also tested both https and http, with the same results in both cases.

Here is example output from the terminal:

Updated provider Prometheus for color blue took 0.002 seconds
Updated provider File (pitch_log.json) for color blue took 0.010 seconds
Skipping update due to rate limiting for provider Brewfather (https://log.brewfather.net/stream?id=xXxXxXxXxX) for color blue
{"timestamp": "2021-08-28T11:18:18.112278", "color": "blue", "name": "Saison for BAM Barrel 2021-08-17", "temp_fahrenheit": 86, "temp_celsius": 30, "original_gravity": 1.056, "gravity": 1.034, "alcohol_by_volume": 2.89, "apparent_attenuation": 41.67, "temp_valid": true, "gravity_valid": true}
Queue is full (3 events), scans will be ignored until the queue is reduced
Updated provider Prometheus for color blue took 0.003 seconds
Updated provider File (pitch_log.json) for color blue took 0.022 seconds
408 Client Error: Request Timeout for url: https://log.brewfather.net/stream?id=xXxXxXxXxX
{"timestamp": "2021-08-28T11:23:11.536475", "color": "blue", "name": "Saison for BAM Barrel 2021-08-17", "temp_fahrenheit": 86, "temp_celsius": 30, "original_gravity": 1.056, "gravity": 1.034, "alcohol_by_volume": 2.89, "apparent_attenuation": 41.67, "temp_valid": true, "gravity_valid": true}

and my pitch config file:

{
"blue_name" : "Saison for BAM Barrel 2021-08-17",
"blue_original_gravity" : 1.056,
"brewfather_custom_stream_url": "https://log.brewfather.net/stream?id=XxXxXxXxXxXx",
"queue_empty_sleep_seconds" : 300
}

Is there an issue with my configuration?

Beacon scanning packet types too broad

As currently configured, the beacon scanner returns any beacon type it detects. Since _beacon_callback is assuming everything it receives is an iBeacon packet, it may try to access fields that don't exist. For example, I am frequently picking up ExposureNotificationFrame packets that do not contain a uuid, which causes tilt-pitch to crash when trying to access that field.

busy loop causes performance hit

Hey mate

thank you for creating this script. It really helps me to get data from my tilts into our logging system.
While playing around I noticed that this code uses a lot of CPU time (it maxes out a single core tbh).

To me it look like you created ssome kind of busy loop inside the scanner function.
To fix this please add a time.sleep(1) inside the endless loop below this line:

_handle_pitch_queue(enabled_providers, console_log)

This causes the

Works like a charm and now uses ~1%CPU time.

Cheers
-Manuel

P.S: oh and while we're on it .. my tilt ceates some kind of bogus enries at the start of a 'burst' where the temperature fahrenheit is always 999.. would be greate to filter them out

InfluxDB database schema for Grafana dashboard

Could you provide the schema for your InfluxDB? 1.0 preferably if different from the 2.0 version. I got Pitch, InfluxDB 1.8, and Grafana installed. I added the dashboard and based my old rusty DB skills created a database. I think I have my pitch.json and Grafana both pointing to the same database I created (Pitch). However, I don't see how I create the tables, etc. in the database.

Thanks,
Chuck

Yellow tilt reports as Pink

I'm having an issue where my yellow tilt is reported as a pink one. The UUID in packets is reported as the same as the pink one which is a495bb70-c5b1-4b44-b512-1370f02d74de. It is a new production yellow tilt marked part number BB70 that was purchased last week.

web UI or Command line ?

Hi, thanks for the grainfather request. I had a hard time upgrading my old laptop to ubuntu 20.xx to install tilt-pitch.

I "think" it is running. i have this in the terminal window:

Starting...
...started: Prometheus (http://127.0.0.1:8000/metrics)
...started: File (pitch_log.json)
...started: Grainfather Custom URL
...started: Tilt scanner
Ready! Listening for beacons

Question: is there a web interface ?

pitch_log.json is 0 bytes so i cannot tell if anything is wrong.

Merci,

Mario

Bluetooth Error

I'm trying to run this on an Intel NUC that has a bluetooth adapter. I have it all setup and installed, but when I run python3 -m pitch I get the following:

python3 -m pitch
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
    ____  _ __       __
   / __ \(_) /______/ /_
  / /_/ / / __/ ___/ __ \
 / ____/ / /_/ /__/ / / /
/_/   /_/\__/\___/_/ /_/


Starting...
...started: File (pitch_log.json)
...started: InfluxDb2 (localhost:8086)
...started: Tilt scanner
Ready!  Listening for beacons
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/tj/.local/lib/python3.8/site-packages/beacontools/scanner.py", line 147, in run
    self.set_scan_parameters(**self.scan_parameters)
  File "/home/tj/.local/lib/python3.8/site-packages/beacontools/scanner.py", line 236, in set_scan_parameters
    self.backend.send_cmd(self.socket, OGF_LE_CTL, command_field, scan_parameter_pkg)
  File "/home/tj/.local/lib/python3.8/site-packages/beacontools/backend/linux.py", line 19, in send_cmd
    return bluez.hci_send_cmd(socket, group_field, command_field, data)
_bluetooth.error: (1, 'Operation not permitted')

Figured it was a permissions issue, but when I do sudo python3 -m pitch It just says /usr/bin/python3: No module named pitch

How do I give permission to pitch to use the bluetooth adapter?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.