Create multicast group
Creates a multicast group: a shared address and shared session keys that let several devices receive the same downlink. The group is created in the application you are connected to.
The command only creates a record on the server. The server sends nothing to the devices: the group address and keys must be written into them separately — see How a device learns about the group.
Request and response: create_multicast_req → create_multicast_resp.
Access: high access level token only. With a low access level token the server responds with error 1.
Current ONS version
Differences from the v0.17 description:
- The group is always created in the application you are connected to. The server only validates the
application_euifield. regiondefaults to 0 (EU), not 6 (KZ865-868).group_typealso accepts the value 1 (class A).multicast_addris exactly 8 hex characters. The server rejects a 7-character address, as in the v0.17 example, with error 3.- A group has no
app_keyfield: the server ignores it. - The server stores
freq,drandping_slot_periodbut does not use them when transmitting frames.
Request
Fields not marked as required may be omitted.
| Field | Type | Description |
|---|---|---|
cmd | string | create_multicast_req |
operation_id | string | Any string; the server returns it in the response to match the request and the response |
multicast_eui | string | Required. Group EUI, 16 hex characters. Must be unique across the whole server among groups and devices |
multicast_addr | string | Required. Group address — the DevAddr its frames will be sent with, 8 hex characters. Must be unique across the whole server among groups and devices |
nwks_key | string | Required. Group NwkSKey, 32 hex characters. The server does not check that the key is present and creates the group without it |
apps_key | string | Required. Group AppSKey, 32 hex characters. The server does not check that the key is present and creates the group without it |
region | uint8 | Region code — the frequency plan of the group, 0–23, see Region codes. Default 0 (EU). |
group_type | uint8 | Group class: 3 — C, 2 — B, 1 — A. Default 3 |
description | string | Group description, up to 255 characters |
application_eui | string | AppEUI of one of the token owner's applications, 16 hex characters. The server only checks that such an application exists |
freq | float | Group frequency, MHz. The server only stores the value |
dr | uint8 | Group data rate (DR), 0–15. Default 0. The server only stores the value |
ping_slot_period | uint32 | Reserved. Default 128 |
{
"cmd": "create_multicast_req",
"operation_id": "xyw",
"multicast_eui": "7DA50BE8C74CE6DC",
"multicast_addr": "C74CE6DC",
"description": "Street lights",
"nwks_key": "EEFBF983C00B35240C9A7C2D8D011301",
"apps_key": "6F17B97CEA2C63D1089EF4268FD68D38",
"group_type": 3,
"region": 6
}
Response
| Field | Type | Description |
|---|---|---|
cmd | string | create_multicast_resp |
operation_id | string | Value from the request. Absent in responses with errors 1 and 3 |
status | uint8 | 1 — the group is created, 2 — error |
multicast_eui, multicast_addr | string | EUI and address of the created group |
application_eui | string | AppEUI from the request. If the field was omitted — the AppEUI of one of the owner's applications, not necessarily the one the group was created in |
description, nwks_key, apps_key, group_type, ping_slot_period, freq, dr, region | Stored values: from the request or defaults. Types are the same as in the request. A field that was not in the request and has no default is null | |
error_code, error_text | uint8, string | Only on error, see below |
{
"cmd": "create_multicast_resp",
"operation_id": "xyw",
"status": 1,
"multicast_eui": "7DA50BE8C74CE6DC",
"multicast_addr": "C74CE6DC",
"application_eui": "819EA8554FCD762A",
"description": "Street lights",
"nwks_key": "EEFBF983C00B35240C9A7C2D8D011301",
"apps_key": "6F17B97CEA2C63D1089EF4268FD68D38",
"group_type": 3,
"ping_slot_period": 128,
"freq": null,
"dr": 0,
"region": 6
}
Errors
error_code | error_text | What happened |
|---|---|---|
| 1 | Unauthorized access | The request came with a low access level token |
| 3 | Data is filled in with an error | Invalid format: multicast_eui or application_eui is not 16 hex characters, multicast_addr is not 8, a key is not 32; group_type is not 1–3; dr is not 0–15; region is not 0–23; freq is not a number |
| 5 | Application does not exists | The token owner has no application with this application_eui |
| 4 | Uniq failed | The token owner already has a group with this multicast_eui and multicast_addr |
| 0 | Unexpected error | The group was not created. Usually the reason is that multicast_eui or multicast_addr is already taken by another group or device on the server, or one of these fields is missing |
Good to know
- The server does not configure devices. The group address,
nwks_keyandapps_keymust be written into the devices as well — the same values as in the request. - Write the EUI and address in upper case. The server stores
multicast_euiandmulticast_addras is and looks the group up by exact match. - Specify the region explicitly. The default value 0 is the EU plan: if your devices use another plan, pass
regionexplicitly.
See also
- Multicast groups — what a group is, command order and limitations.
add_device_to_multicast_req— add a device to the group membership.