Actuation using software_modules


Hi, I’ve been messing around inside openag_brain again and I’m curious how the actuation part works?

What I want to do: just oscillate a binary_actuator between on/off to start off.

Through my digging around my guess is that you use software_modules to control the actuators, and looks like the relevant piece here. Also, by looking at the other fixtures I assume this is the correct syntax for a direct_controller.

This adds a /environments/environment_1/circulation/commanded topic, so I’m assuming that everything I need is there.

The question is what the “correct” way to have that topic publish is?

OpenAg UI, cant connet to server

first mistake:


on_off_controller is a WIP…


So, the gh-pages openag_ui is VERY old, and the latest UI solves many problems that used to exist.

There’s a whole new menu:

and they will call the REST API correctly. Starting recipes also works very well. I’ve yet to test things with the hardware in front of me but things are going pretty smoothly.

[Help] Unable to Connect to UI

@spaghet Thanks for that guide–I wish I would have noticed it earlier today. I’ve been working on the same thing, but I got stuck this afternoon trying to figure out the right link to use for loading the CouchApp. The trick was to use .../app/_design/app/_rewrite. Thanks for pointing that out.

Here are my notes:

And here are some photos from when I experimented with adjusting the controls. I’ve wired up LEDs on a breadboard to the Arduino Mega’s pins for:

  • Illumination: red, blue, and white LEDs on the breadboard)
  • Doser pumps (yellow LEDs): nutrients, pH adjustment, and water
  • A couple pins related to the chiller (red LEDs on the breadboard)

Moving sliders and switches on the UI when ROS was running did affect the LEDs, but it wasn’t what I expected. The illumination LEDs didn’t dim, they turned off when I adjusted the slider past about 40%, then after a few seconds, they turned back on. For the nutrient switches, the LEDs pulsed briefly when I turned the switch on. For the pH and water switches, sometimes the LEDs would flicker off very quickly, but it was inconsistent.

Breadboard LEDs and UI in the initial configuration:

Breadboard LEDs and adjusted UI configuration:

Signal Board for PFC v.2

Regarding the LED’s, the fact that it’s seemingly binary, I’m not sure about.
However, the fact that it turns off seems to be intentional and is actually a variable for binary_actuator firmware.
With pwm_actuator it’s hardcoded.

Also, I found out that you can’t define your own topic names in recipes, but you need to choose from a specific list: