BrewBlox not working and can't backport to BrewPi

While I was here, and assuming my issues were due to trying to adapt the install procedures to my Ubuntu 18.04 system rather than a clean RPI3, I decided to do a clean install with the RaspberryPi3b, just to see.

Unfortunately, I’m finding myself in a similar place. I followed all of the steps from installing RaspianLite on a clean SD onward. Setup went clean and without errors up to running brewpi-ctl up.

When navigating to the brewblox website ( https://raspberrypi), the page comes up, with the same issues. In this case it said the Service Running was OK, but still couldn’t connect.

Next step - I ran the Flash Firmware process.

no luck, same situation. I can see the brewblox, but Service Running but Spark not connected. USB is connected to power the spark, but on the interface screen, the USB is greyed out and the Wifi is lit up with the properly assigned IP.

Log file for the clean rPi install is here:
https://termbin.com/vxh2

First of all: thanks @wactuary for the detailed information. It really helps a lot while tracking what went wrong.

As a side note: if you change the docker-compose.yml file, it needs a full restart of the system before it reads the file again (docker-compose down && docker-compose up -d). You can also do this with brewblox-ctl down up

Ubuntu

We do all our development on Ubuntu 18.04 machines, so it certainly is not an unusual configuration.

On your machine, it seems that device discovery is working correctly. The mdns service reports it discovering your spark at 192.168.1.163, but as it took him nearly 50 seconds to find the device, you restarted it just when it made connection.

I’m not sure what’s causing the delay. Discovery of already-started Spark controllers is generally instant.

Starting discovery:

spark-one_1  | 2019-02-16T00:23:02.952602305Z 2019/02/16 00:23:02 INFO     ..._devcon_spark.communication  Starting device discovery, id=None...

You refreshing the page in the UI, while it’s not yet connected

spark-one_1  | 2019-02-16T00:23:13.124896559Z 2019/02/16 00:23:13 INFO     ...ox_devcon_spark.api.sse_api  Initial subscription push failed: NotConnected(<SparkConduit for None> not connected)
spark-one_1  | 2019-02-16T00:23:18.217072867Z 2019/02/16 00:23:18 INFO     ...ox_devcon_spark.api.sse_api  Initial subscription push failed: NotConnected(<SparkConduit for None> not connected)

Device found, connected. (second green check in the UI). It will now update the controller time, and get settings from the datastore. Note how device discovery started at 00:23:02, and it connects at 00:23:51.

spark-one_1  | 2019-02-16T00:23:51.422602049Z 2019/02/16 00:23:51 INFO     ..._devcon_spark.communication  Connected <SparkConduit for 192.168.1.163:8332>
spark-one_1  | 2019-02-16T00:23:51.602553693Z 2019/02/16 00:23:51 INFO     ...blox_devcon_spark.commander  Spark event: "Connected to BrewBlox v0.1.0"
spark-one_1  | 2019-02-16T00:23:51.741202057Z 2019/02/16 00:23:51 INFO     ...devcon_spark.couchdb_client  <CouchDBClient for http://datastore:5984> Existing document found (430029001347343339383037-blocks-db)
spark-one_1  | 2019-02-16T00:23:51.741510418Z 2019/02/16 00:23:51 INFO     ...devcon_spark.couchdb_client  <CouchDBClient for http://datastore:5984> Existing document found (430029001347343339383037-config-db)
spark-one_1  | 2019-02-16T00:23:51.744188785Z 2019/02/16 00:23:51 INFO     ...devcon_spark.couchdb_client  <CouchDBClient for http://datastore:5984> Existing document found (430029001347343339383037-savepoints-db)
spark-one_1  | 2019-02-16T00:23:51.744602135Z 2019/02/16 00:23:51 INFO     ...blox_devcon_spark.datastore  <CouchDBConfig for spark-service/430029001347343339383037-config-db> Read 1 setting(s). Rev = 2-cca2f702b879bd0a61e6b592e2b365a4
spark-one_1  | 2019-02-16T00:23:51.746709160Z 2019/02/16 00:23:51 INFO     ...blox_devcon_spark.datastore  <CouchDBBlockStore for spark-service/430029001347343339383037-blocks-db> Read 19 blocks. Rev = 2-264d7eebef0f740c7de91d2872b2d82d
spark-one_1  | 2019-02-16T00:23:51.748289940Z 2019/02/16 00:23:51 INFO     ...blox_devcon_spark.datastore  <CouchDBConfig for spark-service/430029001347343339383037-savepoints-db> Read 0 setting(s). Rev = 1-bc82f7787f7b495c97a6fcf633688885

Shutting down (00:23:54).

spark-one_1  | 2019-02-16T00:23:54.648340644Z 2019/02/16 00:23:54 INFO     brewblox_service.events         Closing <EventListener for "eventbus">
spark-one_1  | 2019-02-16T00:23:54.648422328Z 2019/02/16 00:23:54 INFO     brewblox_service.events         Closing <EventPublisher for "eventbus">

Raspberry

Here discovery seems to not work at all. It started discovery at 03:22:10, and by 03:24:50, it still hadn’t received a response. It is using the default compose file, so connection may yet be solved by taking the following steps:

  • stop the system (docker-compose down or brewblox-ctl down)
  • add --device-host=192.168.1.163 to the spark-one command in docker-compose.yml
  • start the system (docker-compose up -d or brewblox-ctl up)

Conclusion

The whole thing seems to almost work, but still has a few kinks. If you want us to try and help out during your next attempt, I can invite you to the Slack chat.

Meanwhile, I’ll take a look at pushing more information to the UI when the Spark is busy discovering / connecting. That should offer some more insight in what it’s trying to do, without having to resort to reading Docker logs.

So I came over to my desktop this morning, and of the many tabs open on my browser, one of them was still pointing to the Ubuntu 18.04 machine, and the brewblox had at some point connected! I guess that’s the connection you saw in the logs, which I hadn’t realized happened before shutting it down. Unfortunately, since I had shut down that docker session and moved spark to the pi, that was just a dead screen. But it was heartening to see it there!

I moved from Ubuntu to the raspberry pi just so I would have a clean system to start from in case anything else on that machine was conflicting. I use that other box to serve my music, and runs a few other servers and may have had packages or processes that conflicted. At least with the pi, it’s clean and fresh and I can wipe it and restart if you need. Eventually, I’d definitely prefer to get it up on the ubuntu box because its so much faster and more responsive. At least with BrewPi, I found that if a brew had gone for a long time, the rpi would bog down with the graphing data after a few weeks worth. Once I moved to the larger and faster box, those issues disappeared. I’m sure less frequent data polling would have helped, but where is the fun in that! :slight_smile:

Anyway, this morning I added the --device-host line to the yml file and brought docker down and then up. So far no connection. Log file below and I’m happy to get on a slack discussion to track this down. Let me know how to connect, I have a slack account already.

https://termbin.com/zy4c

thanks!

By the way, it looks like this page:
https://brewblox.netlify.com/user/examples/single_spark.html#service-spark
might be out of date. It says to use the tag --device-url instead of --device-host. I gave it a shot to see what would happen, but I get Service Not Running, and an error at the bottom saying something about a bad JSON at position 0 flashing at the bottom of the screen briefly.

Reverted back to --device-host.

Also this page:
https://brewblox.netlify.com/user/adding_services.html#step-4-connect-to-a-specific-spark
refers to rpi-stable, but I believe that’s currently rpi-edge. That could be confusing if not commented, although I’m sure eventually the -stable is the right answer so not sure if it should be updated on this page.

Anyway, since my spark is on wifi but also connected to USB, I figured I’d switch the yml file to the serial number figuring that would be a bit less ambiguous and should work for either path.

I’m having the same issues shown here (discovery taking a long long time and not working).

Perhaps the difference is that I’m using the USB cable and do not plan to connect through Wifi (didn’t run brewblox-ctl wifi).

I already tried adding the device-id SER number in the YAML file without any success.

Service is running but the controller won’t connect.

spark-one_1  | 2019/02/27 18:33:30 INFO     brewblox_service.events         Closing <EventListener for "eventbus">
spark-one_1  | 2019/02/27 18:33:30 INFO     ..._devcon_spark.communication  Starting device discovery, id=3a001e001147353236343033...
spark-one_1  | 2019/02/27 18:33:30 INFO     ...ox_devcon_spark.broadcaster  Starting Broadcaster
spark-one_1  | 2019/02/27 18:33:30 INFO     ...ox_devcon_spark.api.sse_api  Starting SSEPublisher

It’s stuck at this point after 10 minutes.

After trying to open the UI I got:

spark-one_1 | 2019/02/27 18:29:09 INFO ...ox_devcon_spark.api.sse_api Initial subscription push failed: NotConnected(<SparkConduit for None> not connected)

My docker-compose.yml:

  spark-one:
    image: brewblox/brewblox-devcon-spark:rpi-${BREWBLOX_RELEASE:-stable}
    privileged: true
    depends_on:
      - eventbus
      - datastore
    restart: unless-stopped
    labels:
      - "traefik.port=5000"
      - "traefik.frontend.rule=PathPrefix: /spark-one"
    command: >
      --name=spark-one
      --device-id=3a001e001147353236343033
      --mdns-port=${BREWBLOX_PORT_MDNS:-5000}

:rofl::rofl::rofl::rofl:

Tried to connect via Wifi and it worked (the discovery).

Docker containers can only access devices that are present when they boot. Don’t know if that could be the issue here too.

As a side note: device-id does not change where it looks during discovery, it’s only an additional check: discovered devices must have this ID.

If you want to enforce USB, you can use --device-serial (usually /dev/ttyACM0).

I’ll update documentation to clarify the distinction between the args.

Hello team and all good people out there.
I hope that someone might have some spare time to help an fellow brewer.
I have earlier been using Brewpi 0.5.10 with the spark 3.
Im a bit of a noob in all these stuff but atleast managed to get the spark going.
Now that i am eager to test the new Brewblox i cant get it running at all.
I have been following the guide step by step all the way to step 3 where you are supposed to connect the Spark 3 via SSH.
The spark are connected to my wifi ( Since brewpi) and has an Ip adress showing in the screen.
When i am trying to connect via SSH with putty i am frequently havning an error message Saying “Connection refused”. Where do i go from here?
I have no containers running in docker and even tried to connect via putty when having docker Uninstalled if this even helps.

Thank you in advance.

You should SSH into the raspberry pi you’re installing the software on, not the brewpi controller itself. Hope that helps!

Thank you so much for answering!
So i cant SSH and get the brewblox installed at the spark 3? https://store.brewpi.com/brewpi-spark-18
Is it neccessary to buy an seperate Raspberry pi 3 for getting the new software?

You should already have a raspberry pi (or other computer) connected to the spark either over USB or wifi to serve the website & to manage the spark.

Ah okey!
Thank you for taking the time!
I dident really know what i was getting when i bought the spark i guess, so i might have gotten things a bit backwards,
All along i thought the spark 3 were the Raspberry pi.
I used Windows for installing docker and to get the spark 3 going with portainer.
So am i supposed to SSH into my Pc and install brewbox onto it aswell?

If you’re absolutely determined, you could install BrewBlox on a Windows PC, but this would require significant knowhow, and lots of effort. I can point you in the right direction, but you’re looking at a few weeks / months work to understand the various software you’d have to set up.

If you’d rather skip all that, our advice is to get a Raspberry Pi. We made the installation process pretty simple, but it requires software not available on Windows.

Thank you so much for answering and clearing that out.
So in other words my brewpi spark 3 is not comptible with Brewblox ?

Your Spark is connected to the sensors and actuators of your brewing system, and regulates them.
The Raspberry Pi is connected to the Spark, and allows you to control the Spark with a user interface.

You need both.

To add to what Bob said: with the BrewPi software you already ran a web server (in your case your windows pc) and the spark with the BrewPi firmware connected to it.

BrewBlox doesn’t change that.

It is possible to run on windows, but docker support isn’t great, because it runs in a Linux virtual machine.
A raspberry pi is a cheap Linux computer for which we release an install and update tool.

Instead of dealing with the docker on Windows quirks getting a pi as your always online BrewBlox server will probably save some hassle setting up and updating.

The BrewBlox firmware is a free upgrade for the spark and you’ll upgrade it as part of the install process.

Hahaha im still laughing at myself!!
Thank you so much for your patience and informative answers.
Ive been itching my head with the spark for way too long, now it all makes sense.
Off to the store to get a pi 3!
Thank you all so much, very well appreciated.

1 Like

Thank you for your time.
Ive bought the Pi now and are following the guide for the brewblox install.
How am i supposed to SSH into the pi?
i have logged in to the pi with the password but afterwards i get stuck in the boot with the command line.
Others seem to get some sort of desktop up.
Tried to write “pi” in putty on my pc but it says host does not exsist. Also tried with figuring out the Pi ip with §hostname, but then the boot command line says command not found.
I also tried to write the brewblox install command in the boot command line, but it dident recognized the 3rd §sudo pip3 install -U brewblox-ctl

How do i advance from the boot command line after the log in?

Sorry for all the questions but im way under water.

You should install putty on your Windows PC as an SSH client.
Then connect to the address raspberrypi.local or the ip address of the raspberry pi.

The Android/iOS app Fing can be helpful to find the IP address of the pi.

It is normal that you only have a command line, you don’t need anything else to install brewblox.
You should use putty to connect to the command line of the pi remotely , from your Windows PC. That will make it a lot easier to copy and paste commands. That’s what ssh does: securely connect to a remote shell.

Step 1-2 should be done first, then for step 3 you use putty and continue remotely:
https://wiki.brewpi.com/getting-started/raspberry-pi-docker-install