BrewBlox Tilt Service

#1

Hello everyone.

I’ve been having a play and have managed to create a BrewBlox service for the Tilt Hydrometer (Thanks for the help @Bob_Steers!). Info about how to install it is available here https://github.com/j616/brewblox-tilt

It doesn’t have the calibration that the old BrewPi mod had yet but its on my todo. The data is also only available in graph widgets atm.

Give me a shout if you have any questions, comments, issues, etc. :slight_smile:

2 Likes
#2

Kudos @j616s, have been waiting for someone to produce this.

Will give it a try and report back findings.

#3

@j616s have updated the Tilt docker and have made all changes as per the git hub.

I now have the tilt in water just infront of the Raspberry pi 3b+ but not seeing anything in the graph metrics options.

Any ideas on what the problem is or anyway that I can see the data being logged?

#4

Could you please run brewblox-ctl log, and post the result?

That should make debugging a lot easier for j616s.

#5

Ok, Done

https://termbin.com/4mab

#6

Nothing looks immediately wrong to be honest. I’ll just add some extra logging. Give me a min.

#7

I’ve just added some more logging. If you run the following to update your system & bring the services back up.
brewblox-ctl update && brewblox-ctl up

Then I think you should be able to view the logs just for the Tilt service using:
docker logs brewblox_tilt_1 -f

You should now see the following if the bluetooth scanner is running and sees any devices at all:
Loop running & device found (may not be a Tilt)

And something like the following when it finds a Tilt:
Found Tilt: Black

If the loop is running and can see devices but can’t find a Tilt, then I think the problem is with the Tilt or with the Pi being able to see it. It might be worth trying the app on your phone near to where your raspberry pi is located and seeing if it can see your Tilt.

If the loop isn’t seeing anything at all (assuming there’s other bluetooth devices in the area running at higher power, i.e. not a low energy device) then that suggests a problem on my end. It could be I’ve installed something on my Raspberry Pi without releasing it and I need to figure out what that is and add it to the docs :slight_smile:

If the service finds your Tilt but no data is getting through then I’ll have to talk to @Bob_Steers to try and figure out whats going on

Just to confirm what you should expect to happen when things work. When you create a Graph widget, you go into the settings menu, into Metrics, and you should see an entry at the top level alongside spark-one etc called tilt. Under this you’ll each colour of Tilt detected and the values logged from it.

#8

@j616s,

Have performed the update and still cannot see the block on a Graph widget. Here is the output of the logging.

2019/04/19 05:34:36 INFO     brewblox_service.service        Creating [tilt] application
/usr/local/lib/python3.7/site-packages/aiohttp_swagger/helpers/builders.py:71: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  swagger = yaml.load(swagger_base)
/usr/local/lib/python3.7/site-packages/aiohttp_swagger/helpers/builders.py:30: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  yaml.load("\n".join(end_point_doc[end_point_swagger_start:]))
2019/04/19 05:34:36 INFO     brewblox_service.service        Endpoint [POST] <PlainResource  /tilt/_debug/publish>
2019/04/19 05:34:36 INFO     brewblox_service.service        Endpoint [POST] <PlainResource  /tilt/_debug/subscribe>
2019/04/19 05:34:36 INFO     brewblox_service.service        Endpoint [HEAD] <PlainResource  /tilt/_service/status>
2019/04/19 05:34:36 INFO     brewblox_service.service        Endpoint [GET] <PlainResource  /tilt/_service/status>
2019/04/19 05:34:36 INFO     brewblox_service.service        Endpoint [GET] <PlainResource  /tilt/api/doc>
2019/04/19 05:34:36 INFO     brewblox_service.service        Endpoint [GET] <PlainResource  /tilt/api/doc/>
2019/04/19 05:34:36 INFO     brewblox_service.service        Endpoint [GET] <PlainResource  /tilt/api/doc/swagger.json>
2019/04/19 05:34:36 INFO     brewblox_service.service        Endpoint [GET] <StaticResource  /tilt/api/doc/swagger_static -> PosixPath('/usr/local/lib/python3.7/site-packages/aiohttp_swagger/swagger_ui')>
2019/04/19 05:34:36 INFO     brewblox_service.service        Endpoint [HEAD] <StaticResource  /tilt/api/doc/swagger_static -> PosixPath('/usr/local/lib/python3.7/site-packages/aiohttp_swagger/swagger_ui')>
2019/04/19 05:34:36 INFO     brewblox_service.service        Feature [<class 'brewblox_service.scheduler.TaskScheduler'>] <brewblox_service.scheduler.TaskScheduler object at 0x7688a9d0>
2019/04/19 05:34:36 INFO     brewblox_service.service        Feature [<class 'brewblox_service.events.EventListener'>] <EventListener for "172.17.0.1">
2019/04/19 05:34:36 INFO     brewblox_service.service        Feature [<class 'brewblox_service.events.EventPublisher'>] <EventPublisher for "172.17.0.1">
2019/04/19 05:34:36 INFO     brewblox_service.service        Feature [<class 'brewblox_tilt.tiltScanner.TiltScanner'>] <brewblox_tilt.tiltScanner.TiltScanner object at 0x756aa270>
2019/04/19 05:34:36 INFO     brewblox_service.events         Closing <EventListener for "172.17.0.1">
2019/04/19 05:34:36 INFO     brewblox_tilt                   Started TiltScanner
2019/04/19 05:34:37 INFO     brewblox_tilt                   Loop running & device found (may not be a Tilt)
#9

Thanks for this. The last line shows the main discovery loop is running and it is finding bluetooth devices. But it seems it’s not finding any Tilts as there’s nothing after that. Have you double checked your Tilt is working and you can see it through the Tilt app?

#10

@j616s, I had checked before doing the update as I did think that maybe the battery had gone, but the Tilt is in a jug of water and sat near the Pi. The Tilt app shows the green tilt with the temp and OG.

Also if it helps here’s the output of a ‘hcitool lescan’

LE Scan ...
46:D9:64:E2:B2:55 (unknown)
46:D9:64:E2:B2:55 (unknown)
FB:DC:66:0C:F1:CE (unknown)
F8:64:95:7A:D2:A7 (unknown)
F8:64:95:7A:D2:A7 Tile
24:4B:03:9C:9E:75 (unknown)
5E:11:FE:46:D8:2F (unknown)
5E:11:FE:46:D8:2F (unknown)
E6:EE:D1:A6:03:66 Tile
E6:EE:D1:A6:03:66 (unknown)
77:45:99:80:52:66 (unknown)
72:14:36:3A:FF:04 (unknown)
72:14:36:3A:FF:04 (unknown)
77:45:99:80:52:66 (unknown)
#11

OK. That’s useful to know. It might be I’ve made some incorrect assumptions when reverse engineering certain aspects of the Tilt advertisements. I’ll take another look at my code and get back to you. Might be later on though as I’m laying a patio in my garden today :slight_smile:

#12

No worries, don’t know where you are but if in the UK you have a nice day for it. don’t forget the sunblock.

#13

I am and I’ll try not to! :slight_smile:

#14

In addition to the above I have ran ibeacon_scan.sh and have the following out put

PACKET: 04 3E 1A 02 01 00 01 55 B2 E2 64 D9 46 0E 02 01 06 0A FF 4C 00 10 05 07 1C A9 83 A0 D1
PACKET: 04 3E 0C 02 01 04 01 55 B2 E2 64 D9 46 00 C1
PACKET: 04 3E 1A 02 01 00 01 53 15 2D 8A 4C 4C 0E 02 01 1A 0A FF 4C 00 10 05 01 18 83 8C 1B A7
PACKET: 04 3E 0C 02 01 04 01 53 15 2D 8A 4C 4C 00 A7
PACKET: 04 3E 2A 02 01 03 01 CE F1 0C 66 DC FB 1E 02 01 04 1A FF 4C 00 02 15 A4 95 BB 20 C5 B1 4B 44 B5 12 13 70 F0 2D 74 DE 00 41 03 EA 00 B5
UUID: A495BB20-C5B1-4B44-B512-1370F02D74DE MAJOR: 65 MINOR: 1002 POWER: -256 RSSI: -75 BATTERY:
PACKET: 04 3E 19 02 01 00 01 66 03 A6 D1 EE E6 0D 02 01 06 03 03 ED FE 05 09 54 69 6C 65 D4
PACKET: 04 3E 28 02 01 03 00 75 9E 9C 03 4B 24 1C 1B FF 75 00 42 04 01 80 AC 24 4B 03 9C 9E 75 26 4B 03 9C 9E 74 01 00 00 00 00 00 00 A5
PACKET: 04 3E 13 02 01 00 01 A7 D2 7A 95 64 F8 07 02 01 06 03 03 ED FE A7

as you can see the tilt is found and the data present. hope this helps.

Rich

#15

Just a quick update. The gardens taken up most of the past two days (angle grinder broke :frowning: ) and heading to my local home brew group now so will look at this tomorrow. I have a few plans of action to try so will report back when I’m done :slight_smile:

#16

Great, thanks for the update, have a great weekend.

If you need anything just let me know.

#17

Pushed an update that now relies on the UUID for identifying Tilts rather than using the local name. You can try updating to the latest with brewblox-ctl update && brewblox-ctl up

It might take a min for data to actually make its way through. It can just take a while for the Raspberry Pi to pick up devices sometimes. I think there’s also a slight delay through the brewblox history service, though I’m not certain.

#18

I think there’s also a slight delay through the brewblox history service, though I’m not certain.

Both reading and writing data is done in set intervals (default: 5s). When writing, the timestamp is the point at which history read from the eventbus, not when it writes the batch.
If you’re viewing data for longer timespans, it will take longer, as you’ll be viewing a downsampled data set. You can enable “Combined Influx Points” to check this: a value of 1 means you’re viewing the live dataset.

#19

I seem to have to wait for multiple responses from the brewpi temp sensors before an update from the tilt service sometimes. But this might be down to it sometimes taking a while for the service to see updates over Bluetooth. I’ll investigate more when I get a chance.

#20

@j616s, Good news, just updated and the Brewblox picked it up straight away. Now logging a brew I managed to sneak in this morning,:grin: