SSR expansion board not on device list [SOLVED]

As I understand it, the SSR expansion board should have two outputs (over one wire) for the SSRs and then any devices plugged into the 3 remaining sockets should also show up in the device list.

I can see the 3 temperature sensors plugged into the expansion board and can set them up as devices fine. I cannot, however, see any devices pertaining to the SSR outputs. I can only see the 4 digital pin outputs for the brewpi board.

I tried adding a new device manually, but this has no chance of working since it does not link to the unique address of the expansion board, right?

Anybody else have this issue?

I’ll have to look into this when I’m back from vacation, sorry.

I was wondering that too when I got mine up and running. I got my dev environment running and it looks like firmware/platform/spark/modules/ConfigDefault.h has it set to disabled in both master and develop branches. Looks like only the pwm branch has it enabled. After grabbing the develop branch, I enabled it, recompiled, flashed, and the OneWire switches showed right up.

#ifndef BREWPI_DS2413 
#define BREWPI_DS2413 0 // TODO
#endif

I didn’t try the 0.3.0a firmware, but its logical it might be built from the pwm branch and already have it enabled?

I have the same problem… and can’t manage to compile here (maybe a GNU Make version problem, not yet figured it out yet). Could you send me, @sjbaker, the firmware with this flag enabled? Thx!

Upon further testing, there are some issues. For one, only pin 0 (A side) of the expansion board appears to work. Second, pin state does not appear to match the web interface perfectly. With pin 0 configured for cooling, it does come on when the web interface says “Cooling”, but does not go off when it goes “Idle”. I does go off if it goes so far as to go into “Heating” mode if heating is configured for pin 1. I’m kinda wondering if the pin statuses are stepping on one another.

I haven’t had any time to look into these issues though. My glycol compressor ceased last week, kinda putting a crimp in my brewpi plans.

image is attached if you want to try it.

brewpi.bin (58.8 KB)

I will fix this when I get back. I believe I already fixed it in the PWM release, but forgot to merge in in the stable release.

Thank you @sjbaker, the actuators are indeed seen now! I’ve tried to use it and have exactly the same problem: it’s not switching off when going to “idle” and the second pin is never used.
I’ve tried the 0.3.0a firmware, the B side works but it’s doing pretty weird things too :wink:

Anyway, this allowed me to test my setup since it’s brand new… and everything works, so hooray! :smile:

Once you’re back @Elco, feel free to ask for test, code or anything, I’m willing to help… but first, enjoy the end of your holidays!

Cheers

I’ve figured out the issues with the boards changing states. There are two minor bugs in OneWireAcutator.h and DS2413.h

  1. OneWireActuator.h in the setActive() function. For some reason the bool type is not liking the bitwise operators. Thus it is not correctly respecting the invert setting. I’m really not sure why the XOR failed to work since it looked correct, but I fixed it by changing to logical not:

    bool realactive = invert ? !active : active;
    device.channelWrite(pio, realactive);

  2. DS2413.h in pioMask() function. Return should be ++pio instead of pio++ to return the correct bit mask.

    return ++pio;

Also, the pins should always be inverted in normal operation because the DS2413 chip defines 1 as off. Thats more of a gotcha than a bug.

Elco, last thing I noticed is that there are two copies of DS2413.h. One in wiring and one in spark/modules. The one in wiring appears newer and is in fact the one actively included by brewpi. I am assuming that the other one is deprecated and really just needs to be removed from git?

brewpi.bin (59.2 KB)

1 Like

Just tried your fix and it works like a charm! Thank you very much :slight_smile:

After 1 day of running a test fermentation, I can confirm it’s working really well (see screenshot)

I did a pull request for the fixes you outline a while ago but they never got implemented.

@Dan, I used your fixes as a starting point, but discovered that there were more bugs in the DS2413 implementation.

Different bit masks are needed for reading the latch, reading the pin or writing the latch.
I also thought using ++pio as a mask directly was a bit dirty, so I refactored it to use hex values for the masks.

I have refactored the actuators in the pwm-actuators branch and fixed the bugs there:

But I didn’t merge it into master yet.

Ahh apologies I hadn’t seen that. Good work.

So is the pwm branch essentially the develop branch at the moment with all the latest fixes?

Actually, the feature/pidclass is meant to be the future, but because I was going on holiday and people were in need of a release that could work for mash control, I hacked a release together for that, which is 0.3.0a.

It is in all honesty just a quick and dirty hack to get PWM support into the old format. I am testing it in my fridge now, and if it works better than 0.2.11 it could maybe be released as a stable after a few bugs are fixed. But most of it will be discarded in favor of the pidclass branch, which breaks up TempControl in flexible objects and introduces a fixed point class to handle calculations and conversions. Releasing the PWM branch would be just to buy time.

The file TempControl.cpp should disappear entirely. The state machine (HEATING/COOLING/IDLE) will disappear and the PIDs will independently drive the actuators (which could be part of different processes (fermentation/mash)). So instead of this interwoven temp control, there will be a list of sensors, a list of PIDs and a list of actuators. They will be updated in order: sensors, PIDS, actuators.

The filtering has moved into the PID class as an input filter, instead of being part of the TempSensor class.

To prevent heating and cooling quickly after each other, I intend to create a mutex class: a group of actuators of which only one can be active at a time, with a configurable time in between (switching from one to the other).

In the pidclass branch, I am also adding unit tests for the new code I write:
https://github.com/BrewPi/firmware/tree/feature/pid-class/boost_test

I’m having the same problem with the stock firmware 0.2.11. Not sure if your fixes made it in to that release but it looks like they didn’t. My symptoms are exactly the same as above. I see my two temp sensors that are connected to the controller board but don’t see the SSRs as one wire devices. Anyway I thought I would ask to see if 0.2.11 should work before going to the trouble of figuring out how to clone and then compile the development firmware. Probably should do that anyway but I don’t have time at the moment. Also I’m assuming that you can connect the spark to any on the rj11 connectors right?

I’m having difficulty with all avenues of trying to upgrade the firmware. I’ve tried to compile it under linux and windows with no luck, windows is a nightmare with a bunch of tools like xxd etc missing, also the mkdir command under windows doesn’t work unless you edit the make file to include inverted commas around the file name because of the forward slashes. I did download sjbakers lastest binary from above and tried to install it through the web interface but it was complaining about ardunio files not being present on the pi even though I have the card set to the spark. I get the following after the install has finished but have no idea if the new version is installed. output is below. With this version I still do not see the expansion board SSR’s in the device list. One final question, I only have a 4 core cable joining the brewpi spark (only the middle 4 pins) do I need a full 6 core cable to get the expansion board to appear in the device list? I thought the expansion board was one wire.

Please help, I’m really starting to get frustrated here as I had the problem with the touchscreen being DOA as well.

Requesting old settings from Arduino...
Saved old settings to file settings-Oct-26-2015-18-41-13.json
Loading programming settings from board.txt
Could not read boards.txt from Arduino, probably because Arduino has not been installed
Please install it with: sudo apt-get install arduino-core
Oct 26 2015 18:41:13 New program uploaded to controller, script will restart
Oct 26 2015 18:41:20 Opening serial port
Oct 26 2015 18:41:20 Notification: Script started for beer 'My First BrewPi Run'
Oct 26 2015 18:41:30 Checking software version on controller...
Oct 26 2015 18:41:30 Found BrewPi v0.2.11 build 0.2.11-0-ga28c22d, running on a Particle Photon with a V2 shield on port /dev/ttyACM0

Oct 26 2015 18:45:29 Installed devices received: [{"a": "2801455C06000009", "c": 1, "b": 1, "d": 0, "f": 9, "i": 0, "h": 2, "j": 0.0, "p": 0, "t": 1}, {"a": "2877E65C0600005E", "c": 1, "b": 1, "d": 0, "f": 5, "i": 1, "h": 2, "j": 0.0, "p": 0, "t": 1}]
Oct 26 2015 18:45:29 Available devices received: [{"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 17, "t": 0, "x": 1}, {"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 16, "t": 0, "x": 1}, {"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 11, "t": 0, "x": 1}, {"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 10, "t": 0, "x": 1}]
Oct 26 2015 18:46:07 Installed devices received: [{"a": "2801455C06000009", "c": 1, "b": 1, "d": 0, "f": 9, "i": 0, "h": 2, "j": 0.0, "p": 0, "t": 1}, {"a": "2877E65C0600005E", "c": 1, "b": 1, "d": 0, "f": 5, "i": 1, "h": 2, "j": 0.0, "p": 0, "t": 1}]
Oct 26 2015 18:46:08 Available devices received: [{"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 17, "t": 0, "x": 1}, {"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 16, "t": 0, "x": 1}, {"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 11, "t": 0, "x": 1}, {"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 10, "t": 0, "x": 1}]
Oct 26 2015 19:58:53 Opening serial port
Oct 26 2015 19:58:53 Notification: Script started for beer 'My First BrewPi Run'
Oct 26 2015 19:59:03 Checking software version on controller...
Oct 26 2015 19:59:03 Found BrewPi v0.2.11 build 0.2.11-0-ga28c22d, running on a Particle Photon with a V2 shield on port /dev/ttyACM0

**** Arduino Program script started ****
Settings will be restored if possible
Devices will be restored if possible
Oct 26 2015 20:02:31 Opening serial port
Checking old version before programming.
Checking current version: Found BrewPi v0.2.11 build 0.2.11-0-ga28c22d, running on a Particle Photon with a V2 shield on port /dev/ttyACM0

Been doing a little looking around and it looks like (although I’m not 100% sure) that the expansion board should be supported in the latest firmware release and that you do indeed need a 6 wire (6P6 RJ12) cable from the spark to the expansion board. If someone could confirm this that would be good.

The extra 2 pins are for RS485 which is for future expansion and not currently used. 4 wire cable is fine. Also I believe the expansion board also doesn’t require the 12V pin, just 5V, GND and 1-wire.

Ok so Dan was correct the outside pins are actually not needed for the expansion board to show up. What I had to do was install the 0.3.0a firmware using the --tag 0.3.0a option when running the flashDfu utility. The expansion board showed up under my list of devices finally. So 4wires was all that was necessary.

Now I have a new problem. It doesn’t matter what pin I assign each of the SSRs to on the expansion board only side A comes on regardless if it is firing pin0 or pin1. Is there some special configuration required? Don’t know where to go from here. I guess I’ll go back to trying to compile the firmware. Much appreciated if someone could help me out. It looks like people have the full expansion board working if they could comment on what version of the firmware they are using and a description of their setup I’d be grateful. Maybe I’m setting the config wrong or something. Anyone?