openHAB - Master Brick

This is the description of the openHAB API bindings for the Master Brick. General information and technical specifications for the Master Brick are summarized in its hardware description.

An installation guide for the openHAB API bindings is part of their general description.

Thing

UID:
  • tinkerforge:brickmaster:[UID]
Required firmware version:
  • 2.4.2
Firmware update supported:
  • no
Channels:
Actions:
Parameters:
  • Status LED Config – Type: boolean, Default: true
  • The status LED is the blue LED next to the USB connector. If enabled is is on and it flickers if data is transfered. If disabled it is always off.

  • SPITFP Enable Dynamic Baudrate – Type: boolean, Default: true
  • The SPITF protocol can be used with a dynamic baudrate. If the dynamic baudrate is enabled, the Brick will try to adapt the baudrate for the communication between Bricks and Bricklets according to the amount of data that is transferred. The baudrate will be increased exponentially if lots of data is sent/received and decreased linearly if little data is sent/received. This lowers the baudrate in applications where little data is transferred (e.g. a weather station) and increases the robustness. If there is lots of data to transfer (e.g. Thermal Imaging Bricklet) it automatically increases the baudrate as needed. In cases where some data has to transferred as fast as possible every few seconds (e.g. RS485 Bricklet with a high baudrate but small payload) you may want to turn the dynamic baudrate off to get the highest possible performance. The maximum value of the baudrate can be set per port. If the dynamic baudrate is disabled, the maximum baudrate will be used statically.

  • SPITFP Minimum Dynamic Baudrate – Type: integer, Default: 400000, Min: 400000, Max: 2000000
  • See SPITFP Enable Dynamic Baudrate

  • (Maximum) SPITFP Baudrate Port A – Type: integer, Default: 1400000, Min: 400000, Max: 2000000
  • The baudrate for Bricklet port A. If you want to increase the throughput of Bricklets you can increase the baudrate. If you get a high error count because of high interference you can decrease the baudrate. If the dynamic baudrate feature is enabled, this is the maximum baudrate. Regulatory testing is done with the default baudrate. If CE compatibility or similar is necessary in you applications we recommend to not change the baudrate.

  • (Maximum) SPITFP Baudrate Port B – Type: integer, Default: 1400000, Min: 400000, Max: 2000000
  • The baudrate for Bricklet port B. If you want to increase the throughput of Bricklets you can increase the baudrate. If you get a high error count because of high interference you can decrease the baudrate. If the dynamic baudrate feature is enabled, this is the maximum baudrate. Regulatory testing is done with the default baudrate. If CE compatibility or similar is necessary in you applications we recommend to not change the baudrate.

  • (Maximum) SPITFP Baudrate Port C – Type: integer, Default: 1400000, Min: 400000, Max: 2000000
  • The baudrate for Bricklet port C. If you want to increase the throughput of Bricklets you can increase the baudrate. If you get a high error count because of high interference you can decrease the baudrate. If the dynamic baudrate feature is enabled, this is the maximum baudrate. Regulatory testing is done with the default baudrate. If CE compatibility or similar is necessary in you applications we recommend to not change the baudrate.

  • (Maximum) SPITFP Baudrate Port D – Type: integer, Default: 1400000, Min: 400000, Max: 2000000
  • The baudrate for Bricklet port D. If you want to increase the throughput of Bricklets you can increase the baudrate. If you get a high error count because of high interference you can decrease the baudrate. If the dynamic baudrate feature is enabled, this is the maximum baudrate. Regulatory testing is done with the default baudrate. If CE compatibility or similar is necessary in you applications we recommend to not change the baudrate.

Channels

Stack Voltage

The stack voltage in V. The stack voltage is the voltage that is supplied via the stack, i.e. it is given by a Step-Down or Step-Up Power Supply.

Type:
  • Number:ElectricPotential
UID:
  • tinkerforge:brickmaster:[UID]:BrickMasterStackVoltage
Read only:
  • Yes
Unit:
  • Volt
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
USB Voltage

The USB voltage in V.

Type:
  • Number:ElectricPotential
UID:
  • tinkerforge:brickmaster:[UID]:BrickMasterUSBVoltage
Read only:
  • Yes
Predicate:
  • This channel will only be available if the Brick has a hardware version less than 2.1.0.
Unit:
  • Volt
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Stack Current

The stack current in A. The stack current is the current that is drawn via the stack, i.e. it is given by a Step-Down or Step-Up Power Supply.

Type:
  • Number:ElectricCurrent
UID:
  • tinkerforge:brickmaster:[UID]:BrickMasterStackCurrent
Read only:
  • Yes
Unit:
  • Ampere
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Bricklets Enabled

Enables/disables all four Bricklets. If you disable the Bricklets the power supply to the Bricklets will be disconnected.

Type:
  • Switch
UID:
  • tinkerforge:brickmaster:[UID]:BrickMasterBrickletsEnabled
Read only:
  • No
Predicate:
  • This channel will only be available if the Brick has a hardware version of at least 3.0.0.

Actions

Actions can be used in rules by creating an action object. All actions return a Map<String, Object>. Returned values can be accessed by name, sometimes the type deduction needs some hints, as shown below:

val actions = getActions("tinkerforge", "tinkerforge:brickmaster:[UID]")
val hwVersion = actions.brickMasterGetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))

Basic Actions

brickMasterGetStackVoltage()
Return Map:
  • voltage – Type: int, Unit: 1 mV, Range: [0 to 216 - 1]

Returns the stack voltage. The stack voltage is the voltage that is supplied via the stack, i.e. it is given by a Step-Down or Step-Up Power Supply.

Note

It is not possible to measure voltages supplied per PoE or USB with this function.

brickMasterGetStackCurrent()
Return Map:
  • current – Type: int, Unit: 1 mA, Range: [0 to 216 - 1]

Returns the stack current. The stack current is the current that is drawn via the stack, i.e. it is given by a Step-Down or Step-Up Power Supply.

Note

It is not possible to measure the current drawn via PoE or USB with this function.

Advanced Actions

brickMasterGetExtensionType(short extension)
Parameters:
  • extension – Type: short, Range: [0 to 1]
Return Map:
  • exttype – Type: long, Range: See constants

Returns the type for a given extension as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

The following constants are available for this function:

For exttype:

  • val EXTENSION_TYPE_CHIBI = 1
  • val EXTENSION_TYPE_RS485 = 2
  • val EXTENSION_TYPE_WIFI = 3
  • val EXTENSION_TYPE_ETHERNET = 4
  • val EXTENSION_TYPE_WIFI2 = 5
brickMasterIsChibiPresent()
Return Map:
  • present – Type: boolean

Returns true if the Master Brick is at position 0 in the stack and a Chibi Extension is available.

brickMasterGetChibiAddress()
Return Map:
  • address – Type: short, Range: [1 to 255]

Returns the address as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

brickMasterGetChibiMasterAddress()
Return Map:
  • address – Type: short, Range: [1 to 255]

Returns the address as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

brickMasterGetChibiSlaveAddress(short num)
Parameters:
  • num – Type: short, Range: [0 to 254]
Return Map:
  • address – Type: short, Range: [0 to 255]

Returns the slave address for a given num as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

brickMasterGetChibiSignalStrength()
Return Map:
  • signalStrength – Type: short, Unit: 1 dB, Range: [0 to 255]

Returns the signal strength in dBm. The signal strength updates every time a packet is received.

brickMasterGetChibiErrorLog()
Return Map:
  • underrun – Type: int, Range: [0 to 216 - 1]
  • crcError – Type: int, Range: [0 to 216 - 1]
  • noAck – Type: int, Range: [0 to 216 - 1]
  • overflow – Type: int, Range: [0 to 216 - 1]

Returns underrun, CRC error, no ACK and overflow error counts of the Chibi communication. If these errors start rising, it is likely that either the distance between two Chibi stacks is becoming too big or there are interferences.

brickMasterGetChibiFrequency()
Return Map:
  • frequency – Type: short, Range: See constants

Returns the frequency value as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

The following constants are available for this function:

For frequency:

  • val CHIBI_FREQUENCY_OQPSK_868_MHZ = 0
  • val CHIBI_FREQUENCY_OQPSK_915_MHZ = 1
  • val CHIBI_FREQUENCY_OQPSK_780_MHZ = 2
  • val CHIBI_FREQUENCY_BPSK40_915_MHZ = 3
brickMasterGetChibiChannel()
Return Map:
  • channel – Type: short, Range: ?

Returns the channel as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

brickMasterIsRS485Present()
Return Map:
  • present – Type: boolean

Returns true if the Master Brick is at position 0 in the stack and a RS485 Extension is available.

brickMasterGetRS485Address()
Return Map:
  • address – Type: short, Range: [0 to 255]

Returns the address as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

brickMasterGetRS485SlaveAddress(short num)
Parameters:
  • num – Type: short, Range: [0 to 255]
Return Map:
  • address – Type: short, Range: [0 to 255]

Returns the slave address for a given num as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

brickMasterGetRS485ErrorLog()
Return Map:
  • crcError – Type: int, Range: [0 to 216 - 1]

Returns CRC error counts of the RS485 communication. If this counter starts rising, it is likely that the distance between the RS485 nodes is too big or there is some kind of interference.

brickMasterGetRS485Configuration()
Return Map:
  • speed – Type: long, Unit: 1 Bd, Range: [0 to 232 - 1]
  • parity – Type: char, Range: See constants
  • stopbits – Type: short, Range: [1 to 2]

Returns the configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

The following constants are available for this function:

For parity:

  • val RS485_PARITY_NONE = 'n'
  • val RS485_PARITY_EVEN = 'e'
  • val RS485_PARITY_ODD = 'o'
brickMasterIsWifiPresent()
Return Map:
  • present – Type: boolean

Returns true if the Master Brick is at position 0 in the stack and a WIFI Extension is available.

brickMasterGetWifiConfiguration()
Return Map:
  • ssid – Type: String, Length: up to 32
  • connection – Type: short, Range: See constants
  • ip – Type: short[], Length: 4, Range: [0 to 255]
  • subnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • gateway – Type: short[], Length: 4, Range: [0 to 255]
  • port – Type: int, Range: [0 to 216 - 1], Default: 4223

Returns the configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

The following constants are available for this function:

For connection:

  • val WIFI_CONNECTION_DHCP = 0
  • val WIFI_CONNECTION_STATIC_IP = 1
  • val WIFI_CONNECTION_ACCESS_POINT_DHCP = 2
  • val WIFI_CONNECTION_ACCESS_POINT_STATIC_IP = 3
  • val WIFI_CONNECTION_AD_HOC_DHCP = 4
  • val WIFI_CONNECTION_AD_HOC_STATIC_IP = 5
brickMasterGetWifiEncryption()
Return Map:
  • encryption – Type: short, Range: See constants
  • key – Type: String, Length: up to 50
  • keyIndex – Type: short, Range: [1 to 4]
  • eapOptions – Type: short, Range: See constants
  • caCertificateLength – Type: int, Range: [0 to 216 - 1]
  • clientCertificateLength – Type: int, Range: [0 to 216 - 1]
  • privateKeyLength – Type: int, Range: [0 to 216 - 1]

Returns the encryption as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

Note

Since Master Brick Firmware version 2.4.4 the key is not returned anymore.

The following constants are available for this function:

For encryption:

  • val WIFI_ENCRYPTION_WPA_WPA2 = 0
  • val WIFI_ENCRYPTION_WPA_ENTERPRISE = 1
  • val WIFI_ENCRYPTION_WEP = 2
  • val WIFI_ENCRYPTION_NO_ENCRYPTION = 3

For eapOptions:

  • val WIFI_EAP_OPTION_OUTER_AUTH_EAP_FAST = 0
  • val WIFI_EAP_OPTION_OUTER_AUTH_EAP_TLS = 1
  • val WIFI_EAP_OPTION_OUTER_AUTH_EAP_TTLS = 2
  • val WIFI_EAP_OPTION_OUTER_AUTH_EAP_PEAP = 3
  • val WIFI_EAP_OPTION_INNER_AUTH_EAP_MSCHAP = 0
  • val WIFI_EAP_OPTION_INNER_AUTH_EAP_GTC = 4
  • val WIFI_EAP_OPTION_CERT_TYPE_CA_CERT = 0
  • val WIFI_EAP_OPTION_CERT_TYPE_CLIENT_CERT = 8
  • val WIFI_EAP_OPTION_CERT_TYPE_PRIVATE_KEY = 16
brickMasterGetWifiStatus()
Return Map:
  • macAddress – Type: short[], Length: 6, Range: [0 to 255]
  • bssid – Type: short[], Length: 6, Range: [0 to 255]
  • channel – Type: short, Range: ?
  • rssi – Type: short, Range: [-215 to 215 - 1]
  • ip – Type: short[], Length: 4, Range: [0 to 255]
  • subnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • gateway – Type: short[], Length: 4, Range: [0 to 255]
  • rxCount – Type: long, Range: [0 to 232 - 1]
  • txCount – Type: long, Range: [0 to 232 - 1]
  • state – Type: short, Range: See constants

Returns the status of the WIFI Extension. The state is updated automatically, all of the other parameters are updated on startup and every time RefreshWifiStatus() is called.

Possible states are:

State Description
0 Disassociated
1 Associated
2 Associating
3 Error
255 Not initialized yet

The following constants are available for this function:

For state:

  • val WIFI_STATE_DISASSOCIATED = 0
  • val WIFI_STATE_ASSOCIATED = 1
  • val WIFI_STATE_ASSOCIATING = 2
  • val WIFI_STATE_ERROR = 3
  • val WIFI_STATE_NOT_INITIALIZED_YET = 255
brickMasterRefreshWifiStatus()

Refreshes the Wi-Fi status (see GetWifiStatus()). To read the status of the Wi-Fi module, the Master Brick has to change from data mode to command mode and back. This transaction and the readout itself is unfortunately time consuming. This means, that it might take some ms until the stack with attached WIFI Extension reacts again after this function is called.

brickMasterGetWifiCertificate(int index)
Parameters:
  • index – Type: int, Range: [0 to 1311, 10000 to 11311, 20000 to 24319, 65534 to 216 - 1]
Return Map:
  • data – Type: short[], Length: 32, Range: [0 to 255]
  • dataLength – Type: short, Range: [0 to 32]

Returns the certificate for a given index as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

brickMasterGetWifiPowerMode()
Return Map:
  • mode – Type: short, Range: See constants, Default: 0

Returns the power mode as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

The following constants are available for this function:

For mode:

  • val WIFI_POWER_MODE_FULL_SPEED = 0
  • val WIFI_POWER_MODE_LOW_POWER = 1
brickMasterGetWifiBufferInfo()
Return Map:
  • overflow – Type: long, Range: [0 to 232 - 1]
  • lowWatermark – Type: int, Unit: 1 B, Range: [0 to 1500]
  • used – Type: int, Unit: 1 B, Range: [0 to 1500]

Returns informations about the Wi-Fi receive buffer. The Wi-Fi receive buffer has a max size of 1500 byte and if data is transfered too fast, it might overflow.

The return values are the number of overflows, the low watermark (i.e. the smallest number of bytes that were free in the buffer) and the bytes that are currently used.

You should always try to keep the buffer empty, otherwise you will have a permanent latency. A good rule of thumb is, that you can transfer 1000 messages per second without problems.

Try to not send more then 50 messages at a time without any kind of break between them.

brickMasterGetWifiRegulatoryDomain()
Return Map:
  • domain – Type: short, Range: See constants, Default: 1

Returns the regulatory domain as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

The following constants are available for this function:

For domain:

  • val WIFI_DOMAIN_CHANNEL_1TO11 = 0
  • val WIFI_DOMAIN_CHANNEL_1TO13 = 1
  • val WIFI_DOMAIN_CHANNEL_1TO14 = 2
brickMasterGetLongWifiKey()
Return Map:
  • key – Type: String, Length: up to 64

Returns the encryption key as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

Note

Since Master Brick firmware version 2.4.4 the key is not returned anymore.

New in version 2.0.2 (Firmware).

brickMasterGetWifiHostname()
Return Map:
  • hostname – Type: String, Length: up to 16

Returns the hostname as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

An empty String means, that the default hostname is used.

New in version 2.0.5 (Firmware).

brickMasterGetWifiAuthenticationSecret()
Return Map:
  • secret – Type: String, Length: up to 64, Default: ""

Returns the authentication secret as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

New in version 2.2.0 (Firmware).

brickMasterGetUSBVoltage()
Return Map:
  • voltage – Type: int, Unit: 1 mV, Range: [0 to 216 - 1]

Returns the USB voltage. Does not work with hardware version 2.1.

brickMasterIsEthernetPresent()
Return Map:
  • present – Type: boolean

Returns true if the Master Brick is at position 0 in the stack and an Ethernet Extension is available.

New in version 2.1.0 (Firmware).

brickMasterGetEthernetConfiguration()
Return Map:
  • connection – Type: short, Range: See constants
  • ip – Type: short[], Length: 4, Range: [0 to 255]
  • subnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • gateway – Type: short[], Length: 4, Range: [0 to 255]
  • port – Type: int, Range: [0 to 216 - 1], Default: 4223

Returns the configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

The following constants are available for this function:

For connection:

  • val ETHERNET_CONNECTION_DHCP = 0
  • val ETHERNET_CONNECTION_STATIC_IP = 1

New in version 2.1.0 (Firmware).

brickMasterGetEthernetStatus()
Return Map:
  • macAddress – Type: short[], Length: 6, Range: [0 to 255]
  • ip – Type: short[], Length: 4, Range: [0 to 255]
  • subnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • gateway – Type: short[], Length: 4, Range: [0 to 255]
  • rxCount – Type: long, Unit: 1 B, Range: [0 to 232 - 1]
  • txCount – Type: long, Unit: 1 B, Range: [0 to 232 - 1]
  • hostname – Type: String, Length: up to 32

Returns the status of the Ethernet Extension.

mac_address, ip, subnet_mask and gateway are given as an array. The first element of the array is the least significant byte of the address.

rx_count and tx_count are the number of bytes that have been received/send since last restart.

hostname is the currently used hostname.

New in version 2.1.0 (Firmware).

brickMasterGetEthernetWebsocketConfiguration()
Return Map:
  • sockets – Type: short, Range: [0 to 7], Default: 3
  • port – Type: int, Range: [0 to 216 - 1], Default: 4280

Returns the configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

New in version 2.2.0 (Firmware).

brickMasterGetEthernetAuthenticationSecret()
Return Map:
  • secret – Type: String, Length: up to 64, Default: ""

Returns the authentication secret as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

New in version 2.2.0 (Firmware).

brickMasterGetConnectionType()
Return Map:
  • connectionType – Type: short, Range: See constants

Returns the type of the connection over which this function was called.

The following constants are available for this function:

For connectionType:

  • val CONNECTION_TYPE_NONE = 0
  • val CONNECTION_TYPE_USB = 1
  • val CONNECTION_TYPE_SPI_STACK = 2
  • val CONNECTION_TYPE_CHIBI = 3
  • val CONNECTION_TYPE_RS485 = 4
  • val CONNECTION_TYPE_WIFI = 5
  • val CONNECTION_TYPE_ETHERNET = 6
  • val CONNECTION_TYPE_WIFI2 = 7

New in version 2.4.0 (Firmware).

brickMasterIsWifi2Present()
Return Map:
  • present – Type: boolean

Returns true if the Master Brick is at position 0 in the stack and a WIFI Extension 2.0 is available.

New in version 2.4.0 (Firmware).

brickMasterGetWifi2AuthenticationSecret()
Return Map:
  • secret – Type: String, Length: up to 64

Returns the WIFI authentication secret as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

New in version 2.4.0 (Firmware).

brickMasterGetWifi2Configuration()
Return Map:
  • port – Type: int, Range: [0 to 216 - 1], Default: 4223
  • websocketPort – Type: int, Range: [0 to 216 - 1], Default: 4280
  • websitePort – Type: int, Range: [0 to 216 - 1], Default: 80
  • phyMode – Type: short, Range: See constants
  • sleepMode – Type: short, Range: [0 to 255]
  • website – Type: short, Range: [0 to 255]

Returns the general configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

The following constants are available for this function:

For phyMode:

  • val WIFI2_PHY_MODE_B = 0
  • val WIFI2_PHY_MODE_G = 1
  • val WIFI2_PHY_MODE_N = 2

New in version 2.4.0 (Firmware).

brickMasterGetWifi2Status()
Return Map:
  • clientEnabled – Type: boolean
  • clientStatus – Type: short, Range: See constants
  • clientIP – Type: short[], Length: 4, Range: [0 to 255]
  • clientSubnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • clientGateway – Type: short[], Length: 4, Range: [0 to 255]
  • clientMACAddress – Type: short[], Length: 6, Range: [0 to 255]
  • clientRXCount – Type: long, Unit: 1 B, Range: [0 to 232 - 1]
  • clientTXCount – Type: long, Unit: 1 B, Range: [0 to 232 - 1]
  • clientRSSI – Type: byte, Range: [-128 to 127]
  • apEnabled – Type: boolean
  • apIP – Type: short[], Length: 4, Range: [0 to 255]
  • apSubnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • apGateway – Type: short[], Length: 4, Range: [0 to 255]
  • apMACAddress – Type: short[], Length: 6, Range: [0 to 255]
  • apRXCount – Type: long, Unit: 1 B, Range: [0 to 232 - 1]
  • apTXCount – Type: long, Unit: 1 B, Range: [0 to 232 - 1]
  • apConnectedCount – Type: short, Range: [0 to 255]

Returns the client and access point status of the WIFI Extension 2.0.

The following constants are available for this function:

For clientStatus:

  • val WIFI2_CLIENT_STATUS_IDLE = 0
  • val WIFI2_CLIENT_STATUS_CONNECTING = 1
  • val WIFI2_CLIENT_STATUS_WRONG_PASSWORD = 2
  • val WIFI2_CLIENT_STATUS_NO_AP_FOUND = 3
  • val WIFI2_CLIENT_STATUS_CONNECT_FAILED = 4
  • val WIFI2_CLIENT_STATUS_GOT_IP = 5
  • val WIFI2_CLIENT_STATUS_UNKNOWN = 255

New in version 2.4.0 (Firmware).

brickMasterGetWifi2ClientConfiguration()
Return Map:
  • enable – Type: boolean, Default: true
  • ssid – Type: String, Length: up to 32
  • ip – Type: short[], Length: 4, Range: [0 to 255]
  • subnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • gateway – Type: short[], Length: 4, Range: [0 to 255]
  • macAddress – Type: short[], Length: 6, Range: [0 to 255]
  • bssid – Type: short[], Length: 6, Range: [0 to 255]

Returns the client configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

New in version 2.4.0 (Firmware).

brickMasterGetWifi2ClientHostname()
Return Map:
  • hostname – Type: String, Length: up to 32

Returns the client hostname as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

New in version 2.4.0 (Firmware).

brickMasterGetWifi2APConfiguration()
Return Map:
  • enable – Type: boolean, Default: true
  • ssid – Type: String, Length: up to 32
  • ip – Type: short[], Length: 4, Range: [0 to 255], Default: {0, 0, 0, 0}
  • subnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • gateway – Type: short[], Length: 4, Range: [0 to 255]
  • encryption – Type: short, Range: See constants, Default: 4
  • hidden – Type: boolean, Default: false
  • channel – Type: short, Range: [0 to 255], Default: 1
  • macAddress – Type: short[], Length: 6, Range: [0 to 255]

Returns the access point configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

The following constants are available for this function:

For encryption:

  • val WIFI2_AP_ENCRYPTION_OPEN = 0
  • val WIFI2_AP_ENCRYPTION_WEP = 1
  • val WIFI2_AP_ENCRYPTION_WPA_PSK = 2
  • val WIFI2_AP_ENCRYPTION_WPA2_PSK = 3
  • val WIFI2_AP_ENCRYPTION_WPA_WPA2_PSK = 4

New in version 2.4.0 (Firmware).

brickMasterGetWifi2FirmwareVersion()
Return Map:
  • firmwareVersion – Type: short[], Length: 3
    • 0: major – Type: short, Range: [0 to 255]
    • 1: minor – Type: short, Range: [0 to 255]
    • 2: revision – Type: short, Range: [0 to 255]

Returns the current version of the WIFI Extension 2.0 firmware.

New in version 2.4.0 (Firmware).

brickMasterEnableWifi2StatusLED()

Turns the green status LED of the WIFI Extension 2.0 on.

New in version 2.4.0 (Firmware).

brickMasterDisableWifi2StatusLED()

Turns the green status LED of the WIFI Extension 2.0 off.

New in version 2.4.0 (Firmware).

brickMasterIsWifi2StatusLEDEnabled()
Return Map:
  • enabled – Type: boolean

Returns true if the green status LED of the WIFI Extension 2.0 is turned on.

New in version 2.4.0 (Firmware).

brickMasterGetWifi2MeshConfiguration()
Return Map:
  • enable – Type: boolean, Default: false
  • rootIP – Type: short[], Length: 4, Range: [0 to 255], Default: {0, 0, 0, 0}
  • rootSubnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • rootGateway – Type: short[], Length: 4, Range: [0 to 255]
  • routerBSSID – Type: short[], Length: 6, Range: [0 to 255]
  • groupID – Type: short[], Length: 6, Range: [0 to 255]
  • groupSSIDPrefix – Type: String, Length: up to 16
  • gatewayIP – Type: short[], Length: 4, Range: [0 to 255]
  • gatewayPort – Type: int, Range: [0 to 216 - 1]

Requires WIFI Extension 2.0 firmware 2.1.0.

Returns the mesh configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

New in version 2.4.2 (Firmware).

brickMasterGetWifi2MeshRouterSSID()
Return Map:
  • ssid – Type: String, Length: up to 32

Requires WIFI Extension 2.0 firmware 2.1.0.

Returns the mesh router SSID as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.

New in version 2.4.2 (Firmware).

brickMasterGetWifi2MeshCommonStatus()
Return Map:
  • status – Type: short, Range: See constants
  • rootNode – Type: boolean
  • rootCandidate – Type: boolean
  • connectedNodes – Type: int, Range: [0 to 216 - 1]
  • rxCount – Type: long, Unit: 1 B, Range: [0 to 232 - 1]
  • txCount – Type: long, Unit: 1 B, Range: [0 to 232 - 1]

Requires WIFI Extension 2.0 firmware 2.1.0.

Returns the common mesh status of the WIFI Extension 2.0.

The following constants are available for this function:

For status:

  • val WIFI2_MESH_STATUS_DISABLED = 0
  • val WIFI2_MESH_STATUS_WIFI_CONNECTING = 1
  • val WIFI2_MESH_STATUS_GOT_IP = 2
  • val WIFI2_MESH_STATUS_MESH_LOCAL = 3
  • val WIFI2_MESH_STATUS_MESH_ONLINE = 4
  • val WIFI2_MESH_STATUS_AP_AVAILABLE = 5
  • val WIFI2_MESH_STATUS_AP_SETUP = 6
  • val WIFI2_MESH_STATUS_LEAF_AVAILABLE = 7

New in version 2.4.2 (Firmware).

brickMasterGetWifi2MeshClientStatus()
Return Map:
  • hostname – Type: String, Length: up to 32
  • ip – Type: short[], Length: 4, Range: [0 to 255]
  • subnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • gateway – Type: short[], Length: 4, Range: [0 to 255]
  • macAddress – Type: short[], Length: 6, Range: [0 to 255]

Requires WIFI Extension 2.0 firmware 2.1.0.

Returns the mesh client status of the WIFI Extension 2.0.

New in version 2.4.2 (Firmware).

brickMasterGetWifi2MeshAPStatus()
Return Map:
  • ssid – Type: String, Length: up to 32
  • ip – Type: short[], Length: 4, Range: [0 to 255]
  • subnetMask – Type: short[], Length: 4, Range: [0 to 255]
  • gateway – Type: short[], Length: 4, Range: [0 to 255]
  • macAddress – Type: short[], Length: 6, Range: [0 to 255]

Requires WIFI Extension 2.0 firmware 2.1.0.

Returns the mesh AP status of the WIFI Extension 2.0.

New in version 2.4.2 (Firmware).

brickMasterGetIdentity()
Return Map:
  • uid – Type: String, Length: up to 8
  • connectedUid – Type: String, Length: up to 8
  • position – Type: char, Range: ['0' to '8']
  • hardwareVersion – Type: short[], Length: 3
    • 0: major – Type: short, Range: [0 to 255]
    • 1: minor – Type: short, Range: [0 to 255]
    • 2: revision – Type: short, Range: [0 to 255]
  • firmwareVersion – Type: short[], Length: 3
    • 0: major – Type: short, Range: [0 to 255]
    • 1: minor – Type: short, Range: [0 to 255]
    • 2: revision – Type: short, Range: [0 to 255]
  • deviceIdentifier – Type: int, Range: [0 to 216 - 1]

Returns the UID, the UID where the Brick is connected to, the position, the hardware and firmware version as well as the device identifier.

The position is the position in the stack from '0' (bottom) to '8' (top).

The device identifier numbers can be found here

brickMasterIsStatusLEDEnabled()
Return Map:
  • enabled – Type: boolean, Default: true

Returns true if the status LED is enabled, false otherwise.

New in version 2.3.2 (Firmware).

brickMasterGetChipTemperature()
Return Map:
  • temperature – Type: short, Unit: 1/10 °C, Range: [-215 to 215 - 1]

Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature!

The temperature is only proportional to the real temperature and it has an accuracy of ±15%. Practically it is only useful as an indicator for temperature changes.

brickMasterGetSendTimeoutCount(short communicationMethod)
Parameters:
  • communicationMethod – Type: short, Range: See constants
Return Map:
  • timeoutCount – Type: long, Range: [0 to 232 - 1]

Returns the timeout count for the different communication methods.

The methods 0-2 are available for all Bricks, 3-7 only for Master Bricks.

This function is mostly used for debugging during development, in normal operation the counters should nearly always stay at 0.

The following constants are available for this function:

For communicationMethod:

  • val COMMUNICATION_METHOD_NONE = 0
  • val COMMUNICATION_METHOD_USB = 1
  • val COMMUNICATION_METHOD_SPI_STACK = 2
  • val COMMUNICATION_METHOD_CHIBI = 3
  • val COMMUNICATION_METHOD_RS485 = 4
  • val COMMUNICATION_METHOD_WIFI = 5
  • val COMMUNICATION_METHOD_ETHERNET = 6
  • val COMMUNICATION_METHOD_WIFI_V2 = 7

New in version 2.4.3 (Firmware).

brickMasterGetSPITFPBaudrateConfig()
Return Map:
  • enableDynamicBaudrate – Type: boolean, Default: true
  • minimumDynamicBaudrate – Type: long, Unit: 1 Bd, Range: [400000 to 2000000], Default: 400000

Returns the baudrate config, see the thing configuration.

New in version 2.4.6 (Firmware).

brickMasterGetSPITFPErrorCount(char brickletPort)
Parameters:
  • brickletPort – Type: char, Range: ['a' to 'd']
Return Map:
  • errorCountACKChecksum – Type: long, Range: [0 to 232 - 1]
  • errorCountMessageChecksum – Type: long, Range: [0 to 232 - 1]
  • errorCountFrame – Type: long, Range: [0 to 232 - 1]
  • errorCountOverflow – Type: long, Range: [0 to 232 - 1]

Returns the error count for the communication between Brick and Bricklet.

The errors are divided into

  • ACK checksum errors,
  • message checksum errors,
  • framing errors and
  • overflow errors.

The errors counts are for errors that occur on the Brick side. All Bricklets have a similar function that returns the errors on the Bricklet side.

New in version 2.4.3 (Firmware).

brickMasterGetSPITFPBaudrate(char brickletPort)
Parameters:
  • brickletPort – Type: char, Range: ['a' to 'd']
Return Map:
  • baudrate – Type: long, Unit: 1 Bd, Range: [400000 to 2000000], Default: 1400000

Returns the baudrate for a given Bricklet port, see the thing configuration.

New in version 2.4.3 (Firmware).

Internal Actions

brickMasterSetBrickletsEnabled(boolean brickletsEnabled)
Parameters:
  • brickletsEnabled – Type: boolean

This function is only available in Master Brick hardware version >= 3.0.

Enables/disables all four Bricklets if set to true/false.

If you disable the Bricklets the power supply to the Bricklets will be disconnected. The Bricklets will lose all configurations if disabled.

New in version 2.5.0 (Firmware).

brickMasterGetBrickletsEnabled()
Return Map:
  • brickletsEnabled – Type: boolean

Returns true if the Bricklets are enabled, false otherwise.

New in version 2.5.0 (Firmware).