Skip to content
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
d7e5b36
add use cmd by subs
AlvaroVega Aug 27, 2025
656e205
add subscriptionId
AlvaroVega Aug 28, 2025
f559088
fix subscription response handler
AlvaroVega Aug 28, 2025
8866af5
notify all attributes
AlvaroVega Aug 28, 2025
e0ad376
add attrsFormat to subscribe
AlvaroVega Aug 29, 2025
ca671ca
update tests with attrsFormat when subscribe
AlvaroVega Aug 29, 2025
28f2409
update test
AlvaroVega Aug 29, 2025
ad4d5c8
update tests
AlvaroVega Aug 29, 2025
6156ab1
update test
AlvaroVega Aug 29, 2025
b99c53b
update tests
AlvaroVega Aug 29, 2025
ab0e614
replace useCmdBySubs by cmdMode
AlvaroVega Aug 29, 2025
55087ea
fix typo
AlvaroVega Aug 29, 2025
3e41e96
fix typo
AlvaroVega Aug 29, 2025
929aef3
fix cmd mode
AlvaroVega Sep 1, 2025
c98e0c6
Update doc
AlvaroVega Sep 1, 2025
d793429
add simply test
AlvaroVega Sep 1, 2025
93c8902
add config doc
AlvaroVega Sep 3, 2025
68b4bf3
fix group model
AlvaroVega Sep 3, 2025
d2df9b6
update CNR
AlvaroVega Sep 3, 2025
f295e21
FIX improved docuemntation regarding commands
fgalan Sep 3, 2025
0fc09e5
recover /notify suffix for providerUrl of notification
AlvaroVega Sep 4, 2025
36ec053
simplify test
AlvaroVega Sep 4, 2025
5160925
Apply suggestions from code review
fgalan Sep 4, 2025
126cb64
Merge pull request #1735 from telefonicaid/improve-commands-doc
AlvaroVega Sep 4, 2025
6f4c667
Update doc/admin.md
fgalan Sep 4, 2025
0595e38
Update doc/admin.md
fgalan Sep 4, 2025
f366858
Update CHANGES_NEXT_RELEASE
fgalan Sep 4, 2025
7e4cf16
Update doc/admin.md
fgalan Sep 4, 2025
901c51b
Update doc/admin.md
fgalan Sep 4, 2025
e5010c3
Update CHANGES_NEXT_RELEASE
fgalan Sep 4, 2025
461f040
Update CHANGES_NEXT_RELEASE
fgalan Sep 4, 2025
b557049
Apply suggestions from code review
fgalan Sep 4, 2025
08dfb28
Update subscription-NGSI-v2.js
AlvaroVega Sep 4, 2025
b1dff66
Update simpleSubscriptionRequest2.json
AlvaroVega Sep 4, 2025
3fa7da7
Update simpleSubscriptionRequest.json
AlvaroVega Sep 4, 2025
a70c28e
Update subscribeIoTAgentCommands.json
AlvaroVega Sep 4, 2025
1c08fe6
update unsubscribe
AlvaroVega Sep 5, 2025
7aaf3ee
use cmdMode from group in test
AlvaroVega Sep 5, 2025
19c339d
check global config
AlvaroVega Sep 8, 2025
2f7386f
update config
AlvaroVega Sep 8, 2025
1127b8b
update test
AlvaroVega Sep 8, 2025
1ea3e55
create initial entity when commands by subs
AlvaroVega Sep 22, 2025
80542dd
update tests with initial entity when commands by subs
AlvaroVega Sep 22, 2025
ceecf81
update log
AlvaroVega Sep 23, 2025
871875e
check subscriptions before use it
AlvaroVega Sep 23, 2025
1ea2bb0
fix template validation
AlvaroVega Sep 23, 2025
9201aa5
update tests with update command device
AlvaroVega Sep 23, 2025
e2ec47c
update CNR
AlvaroVega Sep 23, 2025
d028469
use newDevice when creates initialEntity by commands·
AlvaroVega Sep 25, 2025
b1ba69e
update log
AlvaroVega Sep 25, 2025
3da4080
add more logs
AlvaroVega Sep 25, 2025
3349467
check newDevice instead of deviceData
AlvaroVega Sep 25, 2025
78de1f7
remove status and info of create initial reference with commands
AlvaroVega Sep 25, 2025
f35a679
add logs about diff
AlvaroVega Sep 25, 2025
5e6218b
fix log
AlvaroVega Sep 29, 2025
dd03086
fix concat for commands
AlvaroVega Sep 30, 2025
ac6fa1e
fix old code
AlvaroVega Sep 30, 2025
04824d4
Update CHANGES_NEXT_RELEASE
fgalan Oct 1, 2025
ad5303f
FIX doc about entity creation when cmdMode is notification
fgalan Oct 1, 2025
4bdaa2a
Update documentation on entity creation and commands
fgalan Oct 1, 2025
05c18f6
check if device has commands
AlvaroVega Oct 2, 2025
cbd4952
Update lib/services/devices/devices-NGSI-v2.js
AlvaroVega Oct 2, 2025
d7a95ff
simplify block
AlvaroVega Oct 2, 2025
d5a4b88
Apply suggestion from @fgalan
AlvaroVega Oct 2, 2025
667eeaf
Apply suggestions from code review
fgalan Oct 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
- Fix update device with useCBflowControl
- Add: command modes (new field cmdMode): legacy, notification and advancedNotification (#1732)
- Set Nodejs 20 as minimum version in packages.json (effectively removing Nodev16 and Nodev18 from supported versions)
3 changes: 2 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ var config = {
defaultType: 'Thing',
expressLimit: '1Mb',
useCBflowControl: false,
storeLastMeasure: false
storeLastMeasure: false,
cmdMode: 'legacy'
};

module.exports = config;
12 changes: 12 additions & 0 deletions doc/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,17 @@ If this flag is activated, when iotAgent invokes Context Broker will use
[flowControl option](https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/admin/perf_tuning.md#updates-flow-control-mechanism).
This flag is overwritten by `useCBflowControl` flag in group or device. This flag is disabled by default.

#### `cmdMode`

Set command mode for the IoTAgent instance (it can be overriden by the `cmdMode` at group or device level). Possible values are:

* `legacy` (used as default if this setting is not defined): IoTAgent commands will use Context Broker registers
mechanims.
* `notification`: IoTAgent commands will use subscriptions to be notified for Context Broker commands.
* `advancedNotification`: IoTAgent commands will use subscriptions to be notified for Context Broker commands (but in a different way as in `notification` mode)

Have a look to [this document](devel/northboundinteractions.md) for more detail on how this modes work.

### Configuration using environment variables

Some of the configuration parameters can be overriden with environment variables, to ease the use of those parameters
Expand Down Expand Up @@ -517,6 +528,7 @@ overrides.
| IOTA_EXPRESS_LIMIT | `expressLimit` |
| IOTA_STORE_LAST_MEASURE | `storeLastMeasure` |
| IOTA_CB_FLOW_CONTROL | `useCBflowControl` |
| IOTA_CMD_MODE | `cmdMode` |

Note:

Expand Down
10 changes: 7 additions & 3 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ Additionally for commands (which are attributes of type `command`) the following
particular IOTAs documentation for allowed values of this field in each case.
- **contentType**: `content-type` header used when send command by HTTP transport (ignored in other kinds of
transports)
- **headers**: extra customer headers used when send command by HTTP transport (ignored in other kinds of
transports)
Check full detail of these fields in [comand-transformations](https://github.com/telefonicaid/iotagent-json/blob/master/docs/usermanual.md#commands-transformations)
- **headers**: extra customer headers used when send command by HTTP transport (ignored in other kinds of transports)
Check full detail of these fields in
[comand-transformations](https://github.com/telefonicaid/iotagent-json/blob/master/docs/usermanual.md#commands-transformations)

Note that, when information coming from devices, this means measures, are not defined neither in the group, nor in the
device, the IoT agent will store that information into the destination entity using the same attribute name than the
Expand Down Expand Up @@ -1323,6 +1323,8 @@ as `command` in the [config group](#config-group-datamodel) or in the [device pr
attributes are created using `command` as attribute type. Also, you can define the protocol you want the commands to be
sent (HTTP/MQTT) with the `transport` parameter at the provisioning process.

**NOTE**: in `advancedNotification` mode the command is not triggered updating an attribute, but creating a command execution entity. However, this mode has not been implemented yet so details are to be clarified.

For a given device provisioned with a `ping` command defined, any update on this attribute "ping" at the NGSI entity in
the Context Broker will send a command to your device. For instance, to send the `ping` command with value
`Ping request` you could use the following operation in the Context Broker API:
Expand Down Expand Up @@ -1784,6 +1786,7 @@ Config group is represented by a JSON object with the following fields:
| `endpoint` | ✓ | `string` | | Endpoint where the group of device is going to receive commands, if any. |
| `storeLastMeasure` | ✓ | `boolean` | | Store in device last measure received. See more info [in this section](admin.md#storelastmeasure). False by default |
| `useCBflowControl` | ✓ | `boolean` | | Use Context Broker flow control. See more info [in this section](admin.md#useCBflowControl). False by default |
| `cmdMode` | ✓ | `string` | | Command mode that will use iotagent with CB: **legacy**, **notification** and **advancedNotification**. **Legacy** is based on registers. **notification** based on simplified schema of subscriptions. **Legacy** by default. More information on how the different modes work can be found in [the northbound interactions documents](devel/northboundinteractions.md). |

### Config group operations

Expand Down Expand Up @@ -2007,6 +2010,7 @@ the API resource fields and the same fields in the database model.
| `storeLastMeasure` | ✓ | `boolean` | | Store in device last measure received. Useful just for debugging purpose. See more info [in this section](admin.md#storelastmeasure). False by default. |
| `lastMeasure` | ✓ | `object` | | last measure stored on device when `storeLastMeasure` is enabled. See more info [in this section](admin.md#storelastmeasure). This field can be cleared using `{}` in a device update request. In that case, `lastMeasure` is removed from device (until a next measure is received and `lastMesuare` gets created again). |
| `useCBflowControl` | ✓ | `boolean` | | Use Context Broker flow control. See more info [in this section](admin.md#useCBflowControl). False by default. |
| `cmdMode` | ✓ | `string` | | Command mode that will use iotagent with CB: **legacy**, **notification** and **advancedNotification**. **Legacy** is based on registers. **notification** based on simplified schema of subscriptions. **Legacy** by default. More information on how the different modes work can be found in [the northbound interactions documents](devel/northboundinteractions.md). |

### Device operations

Expand Down
Loading