BrewBlox Tilt Service

So looks like its not being interpreted correctly.

Output of docker-compose config.

I’ll add it to the other file. and let you know.

  datastore:
    image: treehouses/couchdb:2.3.1
    labels:
      traefik.frontend.rule: 'PathPrefixStrip: /datastore'
      traefik.port: '5984'
    restart: unless-stopped
    volumes:
    - /home/pi/brewblox/couchdb:/opt/couchdb/data:rw
  emitter:
    image: brewblox/brewblox-emitter:rpi-edge
    labels:
      traefik.frontend.rule: 'PathPrefix: /emitter'
      traefik.port: '5000'
    restart: unless-stopped
  eventbus:
    image: arm32v6/rabbitmq:alpine
    restart: unless-stopped
  history:
    image: brewblox/brewblox-history:rpi-edge
    labels:
      traefik.frontend.rule: 'PathPrefix: /history'
      traefik.port: '5000'
    restart: unless-stopped
  influx:
    environment:
      INFLUXDB_DATA_INDEX_VERSION: tsi1
      INFLUXDB_DATA_WAL_FSYNC_DELAY: 1s
      INFLUXDB_HTTP_LOG_ENABLED: "false"
      INFLUXDB_LOGGING_LEVEL: warn
    image: influxdb
    restart: unless-stopped
    volumes:
    - /home/pi/brewblox/influxdb:/var/lib/influxdb:rw
  mdns:
    command: --port=5000
    image: brewblox/brewblox-mdns:rpi-edge
    network_mode: host
    restart: unless-stopped
  spark-one:
    command: '--name=spark-one --mdns-port=5000

      '
    depends_on:
    - datastore
    - eventbus
    image: brewblox/brewblox-devcon-spark:rpi-edge
    labels:
      traefik.frontend.rule: 'PathPrefix: /spark-one'
      traefik.port: '5000'
    privileged: true
    restart: unless-stopped
  tilt:
    command: -p 5001 --eventbus-host=172.17.0.1
    depends_on:
    - history
    image: j616s/brewblox-tilt:rpi-latest
    network_mode: host
    privileged: true
    restart: unless-stopped
    volumes:
    - /home/pi/brewblox/tilt:/share:rw
  traefik:
    command: '-c /dev/null --docker  --docker.domain=brewblox.local --entrypoints=''name:http
      Address::80 Redirect.EntryPoint:https'' --entrypoints=''name:https Address::443
      TLS:config/brewblox.crt,config/brewblox.key'' --defaultentrypoints="http,https"

      '
    image: traefik:v1.7
    ports:
    - 80:80/tcp
    - 443:443/tcp
    restart: unless-stopped
    volumes:
    - /home/pi/brewblox/traefik:/config:rw
    - /var/run/docker.sock:/var/run/docker.sock:rw
  ui:
    image: brewblox/brewblox-ui:rpi-edge
    labels:
      traefik.frontend.rule: Path:/, /ui, /ui/{sub:(.*)?}
      traefik.port: '80'
    restart: unless-stopped
version: '3.0'

Ok so worked in the other file. However I cannot check any of the items in the list, including the Spark-one items. As you can see they have all unticked themselves.

We pushed a fix for that a few hours ago. Run docker-compose pull to get it.

Thanks Bob, That’s working now.

Great support as usual.

Since the last brewblox update I am having issues with my tilt. According to the Logs the tilt is found but the data cannot be published for some reason. Anybody an idea why?

Scroll up a bit for the answer =)

The solution for now is to edit docker-compose.shared.yml and add the “ports” entry to the eventbus. See https://github.com/j616/brewblox-tilt#or-deploy-the-tilt-service-on-the-brewblox-stack for more info.

Edit: the best solution is to edit docker-compose.yml, and add the following entry under services:
(indented two spaces)

  eventbus: { ports: ["5672:5672"] }

Oh haha I didn’t see that post. It worked, Thanks!

OK, so I tried to get this working again, but it does not seem to be working again for me. I did a clean configuration of Brewblox, got the Tilt service set up, it was working for a short period, then stopped again.

Just ran update again today to make sure everything up to date.

Tilt not logging - and when i go to try to add metrics, the Tilt is not showing as available to select - only the Spark. I tried the steps Bob pointed to in order to install on the stack (I had previously just used the install script for Tilt).

Logs are here: https://termbin.com/2prqr

Running docker logs brewblox_tilt_1 just gives a series of repeated messages like this:

2020/03/09 16:56:47 INFO     brewblox_service.service        Creating [tilt] application
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/site-packages/brewblox_tilt/__main__.py", line 28, in <module>
    main()
  File "/usr/local/lib/python3.7/site-packages/brewblox_tilt/__main__.py", line 18, in main
    tiltScanner.setup(app)
  File "/usr/local/lib/python3.7/site-packages/brewblox_tilt/tiltScanner.py", line 39, in setup
    features.add(app, TiltScanner(app))
  File "/usr/local/lib/python3.7/site-packages/brewblox_tilt/tiltScanner.py", line 238, in __init__
    self.messageHandler = MessageHandler()
  File "/usr/local/lib/python3.7/site-packages/brewblox_tilt/tiltScanner.py", line 120, in __init__
    self.sgCal = Calibrator(SG_CAL_FILE_PATH)
  File "/usr/local/lib/python3.7/site-packages/brewblox_tilt/tiltScanner.py", line 46, in __init__
    self.loadFile(file)
  File "/usr/local/lib/python3.7/site-packages/brewblox_tilt/tiltScanner.py", line 63, in loadFile
    uncal = float(line[1].strip())
IndexError: list index out of range

I have a tilt/SGCal.csv file with the following contents:

black, 1.002, 1.000
black, 1.089, 1.095
black, 1.073, 1.077
black, 1.063, 1.066
black, 1.047, 1.053
black, 1.036, 1.043
black, 1.029, 1.034
red, 0.997, 1.000
red, 1.098, 1.095
red, 1.071, 1.077
red, 1.059, 1.066
red, 1.047, 1.053
red, 1.037, 1.042
red, 1.027, 1.034

Any ideas what I am doing wrong?

Thanks,
Jerry

This could be caused by an empty line at the end of your calibration CSV file (or anywhere in the file)

Well, thanks for that. There was a blank line after the entries. This has been removed and this is working now!

A bit strange that this would cause the BrewBlox from reading values from the Tilt. I will monitor and see how it goes.

This fixed the same issue for me thanks @Bob_Steers

I got my system upgraded to BrewBlox finally. I installed the Tilt service but am seeing periodic spikes that will make the data unreadable. The tilt is sitting in a pitcher of water and really shouldn’t be seeing any change. I have two Tilts and both are doing this but not at the same times. Any suggestions?

2020-03-14_19-00-24

We’ve seen the issue before, but there it reported a single spike with 9+ zeroes.

The problem should eventually be fixed in the Tilt service itself, but for now the best solution is to manually remove the offending data points from the history database.

I’ll have to get back to you for the exact sql command to do so: that is not something I can write on my phone and get it right the first time.

Thanks, I found the post on this. Didn’t realize Influx was behind this. Given that I work with commercially available time-series historians on a daily basis this was a good learning experience. I ended up writing a script that removes points < 0.995 and > 2 for now and scheduled it to run every 10 mintues.

The service really needs to be doing some filtering and probably averaging of the points. Even better would be generic settings to do filtering an averaging on the raw historian data in the plots.

2 Likes

Just to avoid any doubt, this plugin isn’t part of the main code base. It’s something I’ve created in my spare time, hence it’s functionality being minimal. Pull requests are welcome.

2 Likes

Maybe if the corona thing last long enough I’ll try learning some Python.

Generic filtering and averaging I would envision being an option in the chart. Keep the raw data in the historian but filter when querying Influx for the plot.

1 Like

The data stored in the history database is too dynamic to allow for effective history-side filtering. All services can push arbitrary data.

We do automatically average data, in steps of 1m, 10m, 1h, and 6h. Realtime data is kept for 24h, and the averaged datasets are kept indefinitely.

Downsampled datasets are stored as retention policies of the brewblox database. For example: to show available fields for the spark-one service, averaged with a 10m period, you can run show field keys on "brewblox"."downsample_10m"."spark-one".

Whenever the UI fetches data for a graph, the most suitable dataset is selected. You can see which dataset is used by hovering over the selector in graph settings.

downsample-hover

I found numerous points in the downsampled db’s that had high values due to the averaging so that makes sense. I can’t find this, but are there any options to set fixed limits on the Y axis?

The real fix would indeed be to never push invalid values to the database by doing a sanity check in the tilt service. A simple skip if SG value is not between 0.5 and 2 should suffice I guess?

There is an issue open for adding manual overrides for graph ranges in the UI. It’s a feature that would need careful UX design for it to not create more confusion than it solves issues.

As a direct fix, I’ll submit a fix to the Tilt service. It’s significantly simpler to fix the problem there.

3 Likes