Skip to content

CLI Usage

Luke Sweeney edited this page Oct 24, 2019 · 12 revisions

Installation

Quick install on raspberry pi:

$ curl -L https://github.com/NavasotaBrewing/brewdrivers/releases/download/0.4.1/brewdrivers-raspi > brewdrivers
$ sudo chmod 777 brewdrivers
$ ./brewdrivers

That's it. If that doesn't work, read below.

You can find the latest release on the repository releases page. You can just download the brewdrivers executable, or clone the source code and compile it yourself. Keep in mind that each executable runs on a different platform ie. there's a raspberry pi version, a mac version, a windows version, etc...

If an executable doesn't exist for your platform, clone the source code and run cargo build --release in the root directory. You'll need cargo installed. This will create ./target/release/brewdrivers which you can execute or copy to a directory in your path.

If you're on a raspberry pi, you can copy the executable to /usr/local/bin/, then you can run it from anywhere with brewdrivers.

Usage

Install it first, go back and read the installation section.

Note: Remember you can type help at any time for a list of commands.

Configuring

You need to set the configuration to use the right address, port, and baudrate. This applies to both relay board and Omegas. The configuration for these are both the same.

See the current configuration. These are the defaults.

> config
-- Controller Config --
Port:      /dev/ttyAMA0
Address:   22
Baudrate:  19200

Change the port. Should be a string.

> with_port [new_port]
Now using port [new_port]

Change the address. Should be a number 0-255.

> with_addr [new_addr]
Now using address [new_addr]

Change the baudrate. Should be a number.

> with_baud [new_baud]
Now using baudrate [new_baud]

Keep in mind that this does not change the settings of the device, it only changes the model the CLI uses. If the settings of the CLI don't match the actual settings of the controller, it won't work.

If you want to edit the controller address of a device, the relay CLI provides a way to do that (set_cn) for relay boards, and you can change the address of an Omega physically on the Omega itself.

Relay CLI

Configure it first, see above.

$ brewdrivers relay
Entering Relay CLI

Get the relay state. You can provide as many relay numbers as you can
> get_relay [relay_nums]

Set a relay. Relay number, then state. 1 for on, 0 for off.
> set_relay [relay_num] [state]

Set the controller address. Should be a number 0-255
> set_cn [new_addr]

Omega CLI

Configure it first, see above.

$ brewdrivers omega
Entering Omega CLI

Get the process value
> pv

Gets the setpoint value
> sv

Sets the setpoint value. Should be a number 0.1-752
> set_sv [new_setpoint]

Run the PID. Be careful with this.
> run

Stop the PID
> stop

Check if the PID is running
> is_running

Clone this wiki locally