Development Update?

I fully appreciate this is in a pre-beta stage, and don’t expect any support, …but… :grin:

I have successfully installed BrewBlox using the guide linked above, and flashed the spark, all worked well! Is there a getting-started guide on how to get running with a basic fermentation chamber (one-wire probe in fridge, another probe in beer and control of chamber heating and cooling as per standard BrewPi setup) ?

Or alternatively… is there a simple step to revert the spark back to BrewPi firmware so it can be returned to the old environment easily?

Here is a bullet point list until we have added this in the documentation.
We want to provide some kind of templates later too.

The BrewPi set up was:

  • A PID driving the fridge air cooler
  • A PID driving the fridge air heater
  • A PID manipulating the fridge setpoint based on the beer setpoint.
  • Constraints to prevent alternating between heating and cooling
  • Minimum on and off time for the compressor

To set up the same configuration on BrewBlox:

  • Connect a temp sensor. On the spark widget, click ‘discover blocks’. Rename to fridge/beer/whatever and repeat.

Now go to a dashboard to create a few widgets (and the blocks they display).

  • Create a setpoint ‘Fridge setting’
  • Create a setpoint ‘Beer setting’
  • Create a Sensor/Setpoint pair ‘Fridge’ and link it to the fridge sensor and fridge setpoint
  • Create a Sensor/Setpoint pair ‘Beer’ and link it to the beer sensor and beer setpoint

That’s the process inputs covered.

Now the outputs:

  • On the spark page, rename your Actuator Pins as ‘cooler pin’, ‘heater pin’, etc.
  • On the actuator pin blocks, open settings and click the copy button to create a widget on your dashboard. Now go back to the dahsboard page.
  • Create a Pulse Width Modulator named ‘Cool PWM’ with cooler pin as target and a period of 30m.
  • Create a Pulse Width Modulator named ‘Heat PWM’ with heater pin as target and a period of 10s
  • Create a Mutex and set the minimal wait time for switching between actuators to 30m.
  • Now we will add some constraints on the actuators:
    • On the cool pin, go to block settings and load the preset for a fridge compressor. This will set a minimum OFF time of 300s and a minimum ON time of 180s. This will protect your compressor from overheating.
    • On both the cool pin and the heat pin, add a ‘mutually exclusive’ constraint so they cannot be active at the same time, linked to the mutex you just created.

Now create 2 PIDs:

  • For the ‘Cooling PID’, load the fridge compressor block preset.
  • For the ‘Heating PID’, load the fridge heater block preset.
  • Assign the inputs of the PID to the ‘Fridge’ sensor setpoint pair
  • Assign the outputs to ‘Cool PWM’ and ‘Heat PWM’

You now have your fridge process fully set up. You can run in what used to be called “Fridge constant” mode.

To control beer temperature, we are going to manipulate the fridge setpoint. We do this with an ‘Offset Actuator’ driven by our ‘Beer PID’.

  • First add the offset actuator and name it ‘Fridge setpoint driver’. Set the driven process value to ‘Fridge’ and the reference process value to ‘Beer’.
    • Add a minimum -10 and a maximum 10 constraint to limit the fridge setting to 10 degrees above and below the beer setpoint.
  • Add the Beer PID and load the preset for “Fridge setpoint driver”. Assign ‘Beer’ to input and ‘Fridge Setpoint Driver’ to output.

Now you have the same kind of setup that was hidden behind the previous version of BrewPi, but with much more freedom to tweak and see internal values.

Rearrange your dashboard in any way you like and try out the session widget. The session widget allows you to create charts for each brew by selecting a time range and block data to show in the chart.

If you want to run a profile for your beer temperature, create a SetPoint profile widget/block and use that as the setpoint in the ‘Beer’ sensor setpoint pair instead.

We’re open for suggestions on how to simplify this process :slight_smile:.

1 Like

Elco, thanks so much for the detail there. I will digest and you can consider me a willing beta-tester.

Edit: I’ve reverted back for a bit… Spark is connected by USB but getting a default ip (10.0.1.2, which isn’t routable on my network) and wasn’t available to the PI. I couldn’t see how to switch between USB and TCP for the spark connection, but will re-visit this. Ideally I need a spare 'spark!

@Elco,

Brilliant job on the new interface and thanks for the summary above on the setup, all systems are go.

I have one small problem on setting the Pi to talk to the Spark over Wifi.

As you can see the Spark has an IP address but when I unplug the Pi from the Sparks USB port it all goes off line.

Is there a setting/file config I’m missing some where?

It automatically discovers USB devices and then mdns devices. Probably mdns discover is not finding it automatically.

In the docker-compose.yml, for the devcon service add this argument to command:

–device-host=192.168.101.23

Sorry to be stupid, but you mean the docker-compose.yml in the /brewblox directory?

If it is in this file is it under the spark: section that I just add

 command:
    –device-host=192.168.101.23

as there is no commas: as you can see.


services:

  mdns:
    image: brewblox/brewblox-mdns:rpi-develop
    network_mode: host
    restart: unless-stopped

  eventbus:
    image: rabbitmq:alpine
    restart: unless-stopped

  influx:
    image: influxdb
    restart: unless-stopped
    volumes:
      - ./influxdb:/var/lib/influxdb
    environment:
      - INFLUXDB_HTTP_LOG_ENABLED=false
      - INFLUXDB_LOGGING_LEVEL=warn

  datastore:
    image: treehouses/couchdb
    restart: unless-stopped
    labels:
      - "traefik.port=5984"
      - "traefik.frontend.rule=PathPrefixStrip: /datastore"
    volumes:
      - ./couchdb/:/opt/couchdb/data/

  spark:
    image: brewblox/brewblox-devcon-spark:rpi-develop
    privileged: true
    depends_on:
      - eventbus
      - datastore
    restart: unless-stopped
    labels:
      - "traefik.port=5000"
      - "traefik.frontend.rule=PathPrefix: /spark"

  history:
    image: brewblox/brewblox-history:rpi-develop
    depends_on:
      - influx
      - eventbus
    restart: unless-stopped
    labels:
      - "traefik.port=5000"
      - "traefik.frontend.rule=PathPrefix: /history"

  ui:
    image: brewblox/brewblox-ui:rpi-develop
    restart: unless-stopped
    labels:
      - "traefik.port=80"
      - "traefik.frontend.rule=PathPrefix: /"

  traefik:
    image: traefik
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./traefik:/config
      - /var/run/docker.sock:/var/run/docker.sock
    command: -c /config/traefik.toml --docker --docker.domain=brewblox.local```

Sorry, I was a bit unclear. I was answering from my phone.

  spark:
    image: brewblox/brewblox-devcon-spark:rpi-develop
    privileged: true
    depends_on:
      - eventbus
      - datastore
    restart: unless-stopped
    labels:
      - "traefik.port=5000"
      - "traefik.frontend.rule=PathPrefix: /spark"
    command: >
      --device-host=192.168.1.58

For more than one spark, use unique names (at 3 places per service).

  spark1:
    image: brewblox/brewblox-devcon-spark:rpi-develop
    privileged: true
    depends_on:
      - eventbus
      - datastore
    restart: unless-stopped
    labels:
      - "traefik.port=5000"
      - "traefik.frontend.rule=PathPrefix: /spark1"
    command: >
      --name=spark1
      --device-host=192.168.1.58

  spark2:
    image: brewblox/brewblox-devcon-spark:rpi-develop
    privileged: true
    depends_on:
      - eventbus
      - datastore
    restart: unless-stopped
    labels:
      - "traefik.port=5000"
      - "traefik.frontend.rule=PathPrefix: /spark2"
    command: >
      --name=spark2
      --device-host=192.168.1.59

Besides of --device-host, the service also supports --device-id=123456789012345678901234, where the ID is the unique ID of your Photon/P1, which can be found in the Spark widget.

--device-host sets to connect to a fixed IP, so set up a static lease in your router. If you provide only the device ID, it will try to find the Spark on USB or using mDNS network discovery.

Please note the > after command

Wouderful, that’s got it sorted.

Thanks for your help @Elco

Hi everyone, I am very much a newbie (and sympathise 100% with those who struggle with the BrewPi). I am looking for the link to download the new software, as I understand it would allow my Spark v2 to work wirelessly. I have moved houses and can no longer use an ethernet cable as the fridge is in the shed and doesn’t receive wifi signal. I am on the cusp of selling my Spark, because I find it so difficult to work out what I should be doing. Before I buy a wifi repeater, I want to make sure that I can successfully get the Spark to work with wifi.

If anyone can please point me in the direction of the following, I would be very grateful:

  • link to new software
  • refresher on how to update it (I took the SD card out of the RaspberryPi and put it in my laptop? then what? Am also concerned as laptop is telling me the SD card might be corrupted)

Many thanks in advance.

Btw @OxfordRich - In case you see this, I live in North Oxford. Are you nearby?

@WaldbaldAle Hi - I’m about as far south as you can get in Oxfordshire.

The new BrewBlox software is not ready for release yet, and is monstrously complicated, especially for a simple 1 fermenting fridge setup. I would urge you to stick with the current version and shift your questions here into a new topic for more help. (Windows reporting the card is corrupt is normal, as parts of it are in an unknown format. You can get the existing version of BrewPi to communicate by wifi with the spark, I intend to do so for my own setup soon)

To use WiFi on BrewPi (not BrewBlox), you will just need to update the firmware on the Spark to the latest version. You don’t need BrewBlox to get WiFi.

If you previous setup was with docker, connect the Spark with USB and run:

docker stop brewpi; docker rm brewpi
docker pull brewpi/brewpi-raspbian
docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --trigger
docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --noreset

Your Spark will now be blinking blue. Use the Particle app on your phone to set up WiFi.

Then start a fresh brewpi container again:

docker run -d --name brewpi -p 80:80 -v ~/brewpi-data:/data -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime --restart always brewpi/brewpi-raspbian

If you were not running with docker, the instructions the docker version of brewpi are here:
https://wiki.brewpi.com/getting-started/raspberry-pi-docker-install

@OxfordRich Yep, reducing the complexity is our major challenge. The BrewBlox stack gives the user freedom to set up almost anything, so it is hard to make it simple.
We’re planning to create wizards to set up common configurations, which will hopefully make it a lot easier to use. BrewPi was also complex, but that was hidden not configurable.

Just followed the install procedure and updated to brewblox, no problems whatsoever and it looks good. The only thing that doesn’t work for me is the process view with the following issues:

  • The block itself can’t be deleted
  • The trashcan symbol removes all blocks
  • There aren’t too many building blocks to choose from and you can’t assign any logic (guessing this is in the backlog)
  • After a few drag-n-drops it stops showing the building blocks and reverts to some numbers, e.g. 10.2.

The process view widget is still under construction in an early stage. It is not in a usable state yet.

Add the Beer PID and load the preset for “Fridge setpoint driver”.

Trying to follow your instructions for recreating the BrewPi setup, @Elco. But I don’t seem to have a pre-set for “Fridge Setpoint Driver” in the PID. Closest is HLT Setpoint Driver is the Fridge Setpoint Driver preset different?

Thanks, btw. The setup is a little slow having to create all the blocks individually. But it’s a fantastic piece of software and I love being able to see what everything is doing individually and drill down.

Yes, that’s an error. You can take the HLT setpoint driver, but tweak the PID settings.
I suggest a Kp of 5, Ti of 2h and Td 0 to start.

We have plans for process templates that create most of the blocks for you. We’re aware that this is one of the biggest missing pieces and are working on adding it.

2 Likes

Just released new changes to edge:

  • Improved wizards for services / dashboards / widgets.
  • Added a new type of wizard: arrangements. These wizards create and configure multiple services / dashboards / widgets.
  • Added the “Classic BrewPi” wizard. This creates a dashboard + widgets for the BrewPi fridge configuration.
  • All modals consistently refuse to close when the user clicks the background.
  • Graphs now support multiple Y axes. Each value can be configured to use either the left or the right Y axis. Both Y axes will scale independently.
  • Fixed a bug where widgets cached in the browser would be recreated if they were deleted on the back end.
  • Widgets on dashboards can now be pinned to an X/Y position. This allows creating a fixed layout for dashboards.
  • When editing dashboards, you can now access the widget menu with a button (used to be long press).
  • Added a toolbar to the block relations diagram.
  • Setpoint Profile now displays a vertical line at current time.

For developers:

  • Due to the recent acquisition and mass redundancies at Travis, we have migrated our CI to Azure Pipelines. This includes the example configuration in brewblox-boilerplate. If you have any questions about setting up a CI pipeline, feel free to drop us a message.
3 Likes

Great news!
I have 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.
Is there a similiar wiki page for Brewblox as it were for brewpi?
Can someone please provide me a link to the latest up to date brewblox version?

Thanks in advance

https://brewblox.netlify.com/ has instructions on how to set up and configure BrewBlox.

So this just creates the typical fermentation fridge profile (standard fridge, tube heater and fv vessel - think you got rid of the ambient sensor but I could be wrong)?
Can this also be duplicated or run again to run a second fridge (fermentation or kegerator)?
Thinking about making the jump to have a play around with it.

Yes. Run it again with a new name and input/output pins, and it’ll work fine.

There indeed is no ambient sensor, but assuming you’re not using it as input for a SSPair / PID, this is trivial to add yourself.

1 Like