Release candidate 0.5.0 (WiFi support!)

Hi Guys,

I have just put a release candidate online for 0.5.0. It is not recommended to update while you’re fermenting. Once this has had some real world testing and I have had feedback from the community that there are no bugs, we’ll release it into stable/master.

WiFi
The biggest new feature in this release is WiFi support. You can now setup WiFi on the Photon and change the port setting in the Python script to a TCP socket. Details on how to do this can be found here:

https://wiki.brewpi.com/how-to-setup-wifi-on-the-brewpi-spark

By the way, I have created a new wiki. This is the only article on it so far, but we’ll expand it and make it the central place for user documentation and build guides. I hope this new wiki (dokuwiki) will make it easier for the community to help with improving the docs. Keeping our docs on GitHub and build by readthedocs seemed to be a too high barrier.

Unfortunately, WiFi support takes about 4k of code space, which we do not have left on the core. Therefor WiFi support is not included in the binary for the Spark core, only for the photon. If we free up space in the future, we will include it, but for this release it was not feasible.

Extra logging sensors
Another big update in this release is the removal of ‘Room temp’ and the mocked black character display in the UI. Instead, you now have 3 logging sensors that behave the same as room temp: just logging.

Now all temperatures are shown at the top, without annoying switching between displaying room and fridge temp:

It is not very pretty but functional. I’d be happy to take a PR to make it look better.

Release notes
For the full release notes, take a look here:

How to update
Hopefully, trying the release candidate will be as easy as:

cd ~/brewpi-tools
sudo python updater.py --ask

Then pick the 0.5.0 release on all 3 prompts.

Bye bye pi?
With the ability to use WiFi instead of USB, it’s easier to use other hardware than the pi to run the server. I hope someone in the community can help us run BrewPi in a docker image. Maybe even on devices like a Synology NAS.

What’s next
There is a lot of groundwork in this release to make objects in the firmware more flexible and configurable. I want to change how PIDs and devices work. Instead of assigning a device as ‘fridge cooler’, I’d like to remove any notion of fridge, beer or mode. You just get a bunch of PIDs and you can configure what the input and output is.

If you want to set it up similar to the current setup, you’ll have:

  • A PID with fridge temp as input and a cooler as output
  • A PID with fridge temp as input and a heater as output
  • A PID with beer temp as input and a fridge setpoint manipulator as output

But if you have a glycol setup with a central reservoir, 2 fermenters and a 2 glycol pumps, you might set it up as:

  • A PID with glycol temp ans input and cooler as output
  • A PID with beer 1 temp as input and pump1 as output
  • A PID with beer 2 temp as input and pump2 temp as output.

To facilitate this change in how objects relate to each other, this release includes a new referencing system under the hood. Obviously, it also requires many changes to the UI.

Want to help?
If you want to help us build the new system, we can use help with:

  • Documentation
  • Firmware code in C++, for example building a new user interface on the device itself.
  • The new web interface, built with Vue.js

If you’re not sure where you can help, just send me a PM with what you’re skills are and I’m sure we can find a nice little side project.

I’m also still looking for a full time developer to join our team. So if you want a job in writing beer brewing software and live near Eindhoven, please contact us.

I know the releases are not coming fast enough, but I’m doing everything I can. Unfortunately Geke, the awesome woman responsible for processing orders and shipping packages at BrewPi, fell down the stairs while sleepwalking and broke her neck 2 months ago (vertebra C2). She’s recovering well and will be back in 1-2 months, as it looks now without any lasting complications. This however puts a heavier workload on me, since I’m covering for her absence myself.

Cheers,

Elco

4 Likes

I went ahead and installed the new rc on two of my setups. Everything is still up and running and cooling is actually working on my first setup. I have no heater to test. Seems like during the update the current data (temp graph) is lost though (happened on both setups). Doesn’t matter for me, but you may want to save that first before updating (This screenshot is from the first setup which is still running):

On my second setup the script is not starting anymore, I assume it has something todo with the device configuration, checking that out now.


I have reconfigured the devices, but script is no running. Could these logs/errors be related? I am not seeing these ony my first setup where the script runs just fine.

stderr:
Jun 25 2017 10:27:50 Error: Received invalid message on socket: lcd
Jun 25 2017 10:27:53 Error: Received invalid message on socket: lcd

Do you still have the console output of the update script?

For your first setup, can you open the debug console in the browser (F12) and check if there is anything in the console?

Did you ctrl-F5 refresh the browser on both? The “lcd” screen text message was removed from 0.5.0, so the web interface shouldn’t be sending it anymore. Given that your header has changed, I see you have updated. Maybe you just need a full refresh. Try in an incognito window too.

The script is probably running, but refreshing the temperatures (and previously LCD message) is what is used to detect it. If it fails, the script is reported to not run.

You say ‘I have reconfigured my devices’. Did you say no to letting the update script restore them?

Unfortunately I did not save the console output while updating.

For some reason Ctrl-F5 was not working on my PC, as soon as I opened the page on another tablet everything looked fine. After manually clearing the cache on my PC the second setup is now up and running again. So this was a problem on my side, nothing to do with BrewPi (even though a hint at the hint of the update script would sure help). Sorry, could have figured that one on my own. All good:

So two tiny issues, data from current beer lost during update, and states not yet being shown in the diagram. I guess for the later one a just need to wait a bit longer:

Yes, on my second setup I did choose to not restore my devices since I wanted to change some sensors anyways. This work as expected, after the update I had no installed devices.

Now I’ll try to get wifi on the sparks up and running. Can sparks even be updated over wifi or is there a connection needed for future updates?

I have not tested the update over WiFi yet. It should be possible, but haven’t tried. It might require some code changes. I’ll look into it.

I have also just found the issue why the chart was not rendering. It was due to a mismatch between the new number of labels and the old number of labels. I’ll see if I can resolve that too.

I have added a note after the setup.

I have added a note to not update mid-brew.
The problem is that in the old version of the script, the data had 7 columns. In the version of the script, the data has 9 columns.

I have added a fix that makes sure the data can still be rendered:

If you run the updater again, I think your old graph will also render okay.

Wow, that was a quick fix! I will confirm it the old graphs render fine as soon as I can test, at the moment I am trying to get WiFi running on the photon. The photon app keeps telling me that claiming my photon failed. But the Wifi connection is running, I have assigned a fix IP on the router for the photon and I can ping it there.

In your howto (https://wiki.brewpi.com/how-to-setup-wifi-on-the-brewpi-spark) it says to configure settings.cfg, isn’t that config.cfg? I guess yes since I am up and running:

Jun 25 2017 12:22:02 Opening serial port
Jun 25 2017 12:22:18 Notification: Script started for beer 'Kegerator ab 25.06.2017'
Jun 25 2017 12:22:28 Checking software version on controller... 
Jun 25 2017 12:22:28 Found BrewPi v0.5.0 build 0.4.4-145-g74a708070, running on a Particle Photon with a V2 shield on port socket://10.0.0.75:6666

Edit:
So I ran the update script again, but since I am now on WiFi the script stops and waits for a device to be connected in DFU mode. So I assume this means for an update a serial connection is required. Or is it just required to manually put it into dfu mode?

Edit2:
Second setup now running on WiFi too. And I can confirm that the old data is now rendered correctly again. To summarise:

  • I am still missing the states in the diagram. Maybe I just have to wait longer. If these don’t appear till tomorrow I will report again.
  • I tested with the update script waiting for a device in DFU mode to manually put the photon into DFU mode. Seems like WiFi is not running in that mode and the script does not detect anything. SO I think the script should be updated to tell you to plugin the photon before sending the command to put it into DFU mode.

Thanks. Fixed. I already had a note that claiming the Photon doesn’t work. I have expanded it a bit. Feel free to improve the wiki if you see something else.

Our update script defaults to using DFU for the photon when running as root. DFU is a different USB protocol and it is even completely separate from python, so the port setting doesn’t affect it. When you reboot into DFU, the Photon is detected as a different type of USB device. Obviously, that doesn’t work over WiFi. I’ll have to rewrite some things to try to get that to work.

The states are shown in my chart. The only quick I see is that if I load the chart, state is not shown in the legend. When I mouse over the graph, it appears.

So after almost 3 hours, both my setups are showing this warning in the log:
Jun 25 2017 13:49:29 Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.

This is due to both photons having lost their WiFi connection, I can’t ping them any longer. They are still working and keeping the target temperature, but the script isn’t running any more on the raspberry.

Is there any chance this could be related to the brewpi firmware on the photon? Might very well be my WiFi too, but I dont have any other problems (over 30 devices in network). I will keep monitoring that and let you know how that develops.

Edit:
It basically doesnt matter since it causes no issues, but I am still getting the lcd error:

What was color and blink rate of the LED when they lost WiFi?

If I remember correctly Green, very slow blinking. But I will check next time it happens. All three I own are now on the WiFi and have not lost connection during the last 3 hours.

Ok that’s good. That means it has a WiFi connection.

I have changed the script to exit when the version number cannot be received. That way, it can start again later to try again. We didn’t exit before, because then the controller could be reprogrammed via the script, but we have other means to do that now, so this is better.

OK, looks like this was a one time issue, maybe on my side. At least none of the three photons lost connection during the last 20 hours.

Thanks for your valuable input. I have just fixed the state display issue.

Had this issue again, all 3 Photons lost connection at the very same time. None of the other 30+ devices on my WiFi has lost connection. It also seems like manually rebooting the sparks is required to get them to connect again, then the script needs to be restarted as well (or maybe I just didn’t wait long enough.

I know this could be my WiFi, but I am really wondering if anybody else is seeing such issues?

My Wifi reliability has just been checked by a pro from our company since we had some problems with the product we are developing in my network, turned out it was the device and not my WiFi. So at the moment I would have no clue where to start searching the error. @Elco let me know if you need detailed information about the WiFi settings.

Kegerator:

Conical1:

Conical2:

EDIT:
I have just rebooted my WiFi AP, the photons connected after this and I can ping them all. But all of my three BrewPi setups can’t reconnect to them with the following error:

Jun 28 2017 07:32:02 Opening serial port
Jun 28 2017 07:32:12 Errors while opening serial port:
Could not open port socket://10.0.0.77:6666: [Errno 111] Connection refused

LED of the Photons is slow blinking green in this state. I have rebooted two and they work fine again. I left one in this state in case you need further information.

If this happens, can you ping it?

Are you saying you can recreate this issue by rebooting the AP? I have tried myself, but they seemed to come back. I’ll try again.

Edit: found an issue! will try to come with an update today.

I have uploaded new binaries that should better handle losing WiFi.

I updated my brewpi and spark v2 to 0.5.0/0.5.0 w/firmware 0.5.0-rc2 and it went pretty smooth! Its running my 49cf commercial fridge used for beer storage running in fridge constant mode. I’m going to flip it over to wifi control tonight.

1 Like

I have updated all my three setups this morning, but I did not have enough time to test with a reboot of the AP. I will do that tonight and let you know the results.

Glad to hear you found something, I was hoping at least some of my information is useful :wink:

1 Like