This is the command to control Building Automation Stackable Card for Raspberry Pi
Don't forget to enable I2C communication:
~$ sudo raspi-config
~$ git clone https://github.com/SequentMicrosystems/megabas-rpi.git
~$ cd megabas-rpi/
~/megabas-rpi$ sudo make install
Now you can access all the functions of the BAS board through the command "megabas". Use -h option for help:
~$ megabas -h
If you clone the repository, any update can be made with the following commands:
~$ cd megabas-rpi/
~/megabas-rpi$ git pull
~/megabas-rpi$ sudo make install
For cards version 5.0 and up, input types are not dipswitch selectable, as for the previous versions, but software selectable. The default setting of the Inputs type is 0-10V, to change it:
- Make sure you have the latest
megabas
command installed, as explained above. - Run the command
megabas <stack> incfgwr <channel> <value>
, where- stack = 0 - 7, Stack level selectable from ID0, ID1, ID2 dipswitches
- channel = 1 - 8, Channel number you need to modify
- value = 0 for 0-10V, 1 for 1K Thermistor or Dry contact, 2 for 10K Thermistor
For more info on the commands' parameters run megabas -h incfgwr
and megabas -h incfgrd
.
The input type settings are saved into the card's nonvolatile memory, so will be preserved after power-down.
The board can act as Modbus RTU slave device, checkout modbus instructions