Brewer Systems

Lets Build Something

Proximity Open WGM Firmware

15 April 2021

Packet Structure

CANbus Speed: 115Kbps

CANbus ID generally references the Module ID as the subject, but also may reference a Group of Modules.

CANbus ID of 000 is generally received by all devices.

Byte # Description Examples
0 WGM_ACTION SET, GET, NOTIFY, EXEC
1 WGM_TARGET RELAY, LED, BUZZ, CREDENTIALS, REX, ect
2 Parameter 01  
3 Parameter 11  
4 Parameter 21  
5 Parameter 31  
6 Parameter 41  
7 CRC8 Checksum  

WGM_ACTION

A WGM_ACTION represents only the first nibble of the first byte.

Action Byte Description
WGM_ACTION_SET 0x10 SET value of a TARGET with param0-4 values
WGM_ACTION_GET 0x20 GET value of a TARGET
WGM_ACTION_NOTIFY 0x50 Notification from Device, Door Contact state Change, Credentials Presented, Heartbeat, etc.
WGM_ACTION_EXEC 0x60 Command to Execute Target Function

WGM_ACTION_RESPONSE

Each Action Request should expect a Response. An action response is appended to the original ACTION for the response. Whereas the actual WGM_ACTION is the first nibble of the first byte. Action Response is the lower nibble of the first byte.

Action Response Byte Description
WGM_ACTION_RESPONSE_ACK 0x01 Acknowledging your Action, No returned Data.
WGM_ACTION_RESPONSE_ACK_U1_RESULT 0x02 Acknowledging your Action, bool result P0
WGM_ACTION_RESPONSE_ACK_U8_RESULT 0x03 Acknowledging your Action, uint8 result P0
WGM_ACTION_RESPONSE_ACK_U16_RESULT 0x04 Acknowledging your Action, uint16 result P[0-1]
WGM_ACTION_RESPONSE_ACK_U32_RESULT 0x05 Acknowledging your Action, uint32 result P[0-3]
WGM_ACTION_RESPONSE_ACK_U8_U8_RESULT 0x06 Acknowledging your Action, uint8 P0 result and uint8 P1 result
unused 0x07  
unused 0x08  
unused 0x09  
WGM_ACTION_RESPONSE_NACK_CRC_FAILED 0x0A Negative Acknowledgment - BAD CRC
WGM_ACTION_RESPONSE_NACK_NOT_HANDLED 0x0B Negative Acknowledgment - Not Handled
WGM_ACTION_RESPONSE_NACK_NOT_SUPPORTED 0x0C Negative Acknowledgment - Not Supported
WGM_ACTION_RESPONSE_NACK_INVALID_CONTEXT 0x0D Negative Acknowledgment - Invalid Context
WGM_ACTION_RESPONSE_NACK_INVALID_TARGET 0x0E Negative Acknowledgment - Invalid Target
WGM_ACTION_RESPONSE_NACK_TERRIBLE_REQUEST 0x0F Your request could have caused issues. Contemplate life choices.

WGM_TARGET

Target Name Byte Description
WGM_TARGET_RELAY 0x10 State or Target state is param0; Supports Actions of GET and SET
WGM_TARGET_LED 0x20 State or Target state is param0; Supports Actions of GET and SET
WGM_TARGET_BUZZ 0x30 State or Target state is param0; Supports Actions of GET and SET
WGM_TARGET_DOORCONTACT 0x40 State or Target state is param0; Used Actions of NOTIFY and GET
WGM_TARGET_CREDENTIALS_KEYPAD 0x50 P0 is Data Length, uint32 P[1-4] value. Used Action: NOTIFY
WGM_TARGET_CREDENTIALS_RFID 0x51 P0 is Data Length, uint32 P[1-4] value. Used Action: NOTIFY
WGM_TARGET_CREDENTIALS_TRANSLATED 0x52 P0 is Data Length, uint32 P[1-4] value. Used Action: NOTIFY
WGM_TARGET_CREDENTIALS_UNKNOWNTYPE 0x53 P0 is Data Length, uint32 P[1-4] value. Used Action: NOTIFY
WGM_TARGET_STATUS_BLOCK_A 0x60 Heartbeat. P0 buzzer state. P1 LED state. P2 rexInput state. P3 contact input state. P4 relay state.
WGM_TARGET_REX 0x70 P0 is Event during NOTIFY action. EXEC action requires no parameters to trigger REX.
WGM_TARGET_RESET 0x80 Used Action: NOTIFY; Controller will notify that it has been reset, along with the REASON (see table)
WGM_TARGET_TEST_FUNC_LOCKUP 0x90 Used Action: EXEC ; Cause Device to Lockup (Test Watchdog Timer)
WGM_TARGET_CONFIG_MODE 0xA0 P0 uint8 value; 0 Not Configured, 1 Provisioned, 2 Stand Alone Mode #FU ; Used Action: SET, GET
WGM_TARGET_CONFIG_MODULE_ID 0xA1 P0 uint8 value; Used Action: SET, GET
WGM_TARGET_CONFIG_GROUP_ID 0xA2 P0 uint8 value; Used Action: SET, GET
WGM_TARGET_CONFIG_REX_DURATION 0xA3 P[0-1] uint16 value; Duration in milliseconds; Used Action: SET, GET
WGM_TARGET_CONFIG_REX_REPLAY 0xA4 P0 bool value ; 1 Enabled, 0 Disabled ; Used Action: SET, GET
WGM_TARGET_CONFIG_HEARTBEAT_INTERVAL 0xA5 P[0-1] uint16 value; Duration in milliseconds; Used Action: SET, GET
WGM_TARGET_CONFIG_TRANSLATE_WG 0xA6 P0 bool value ; 1 Enabled, 0 Disabled ; Used Action: SET, GET
WGM_TARGET_CONFIG_ENCRYPTION_MODE 0xA7 #FU ; Used Action: SET, GET
WGM_TARGET_CONFIG_CIPHER_KEY_PART 0xA8 #FU ; Used Action: SET, GET
WGM_TARGET_CONFIG_RESET 0xA9 Used Action: EXEC ; wipe MODULE_ID and CONFIG mode and restart
WGM_TARGET_IDENTIFY 0xB0 P0 as speed of flashing onboard LED. 0 is off. Used Action: SET, GET
WGM_TARGET_IDENTIFY_BY_UID 0xB1 If uint32 P[0-4] = UID onboard LED strobing speed = P5; 0 Disabled; Used Action: SET
WGM_TARGET_TEMPERATURE 0xC0 Used Action: GET
WGM_TARGET_U32_UID 0xD1 P[0-4] uint32 value; Used Action: SET, GET ; This is set before module is shipped out
WGM_TARGET_PROVISION_UID 0xF0 If P[0-4] uint32 = UID, then MODULE_ID = P5 uint8

Parameter Specifics for Target/Action Requests and Responses.

REX_EVENT

REX event Types are described by WGM_ACTION_NOTIFY action packets with a WGM_TARGET_REX target.

  • REX_EVENT_STARTED is sent when a contact input triggers a REX event.
  • If a module is configured with a GROUP_ID and WGM_TARGET_CONFIG_REX_REPLAY is enabled a EXECUTE command is sent on the bus for that group.
  • If a module receives a group EXEC command for REX, the module begins the REX event by sending a NOTIFY event of REX_EVENT_REPLAY_EVENT_STARTED
Event Name Byte Description
REX_EVENT_STARTED 0x01 REX Started. (Initiated by contact input)
REX_EVENT_ENDED 0x02 Rex Timedout (if REX DURATION > 0)
REX_EVENT_REX_BUTTON_RELEASED 0x03 Button initiating REX event has been released
REX_EVENT_REPLAY_EVENT_STARTED 0x04 A command over the canbus or another module has started the REX event

Example Interactions

NEXUS WGM CANbus Communication - Example Interactions

CRC is calculated as follows: CRC = ACTION ^ TARGET ^ P0 ^ P1 ^ P2 ^ P3 ^ P4

For the sake of testing, use 0xFF as CRC value to bypass the checksum.

Toggling a Target Relay on WGM Module.

Payload Action Target P0 P1 P2 P3 P4 CRC 001##10100100000000FF WGM_ACTION_SET 0x10 WGM_TARGET_RELAY 0x10 0x01 0x00 0x00 0x00 0x00 0x01 001##10100000000000FF

WGM_ACTION_SET 0x10 WGM_TARGET_RELAY 0x10 0x00 0x00 0x00 0x00 0x00 0x00

Toggling a Target LED state on WGM Module.

Payload Action Target P0 P1 P2 P3 P4 CRC 001##10200100000000FF

WGM_ACTION_SET 0x10 WGM_TARGET_LED 0x20 0x01 0x00 0x00 0x00 0x00 0xFF 001##10200000000000FF

WGM_ACTION_SET 0x10 WGM_TARGET_LED 0x20 0x00 0x00 0x00 0x00 0x00 0xFF

Toggling a Target Buzzer state on WGM Module.

Payload Action Target P0 P1 P2 P3 P4 CRC 001##10200100000000FF

WGM_ACTION_SET 0x10 WGM_TARGET_BUZZ 0x30 0x01 0x00 0x00 0x00 0x00 0xFF 001##10200000000000FF

WGM_ACTION_SET 0x10 WGM_TARGET_BUZZ 0x30 0x00 0x00 0x00 0x00 0x00 0xFF

  1. References to the Parameter section of can bus frames may be referred to as P0, P1, P2, P3, and P4. Data values requiring more than one byte may be referred to as uint16 P[0-1], uint32 P[0-3], etc.  2 3 4 5