esp-rainmaker-cli 1.14.0__tar.gz → 1.16.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/PKG-INFO +42 -1
  2. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/esp_rainmaker_cli.egg-info/PKG-INFO +42 -1
  3. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/esp_rainmaker_cli.egg-info/SOURCES.txt +5 -0
  4. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rainmaker/rainmaker.py +58 -0
  5. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rainmaker/version.py +1 -1
  6. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/node.py +60 -3
  7. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/provision.py +11 -3
  8. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/stream.py +126 -1
  9. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/kvs_streaming.py +29 -42
  10. esp_rainmaker_cli-1.16.0/rmaker_lib/local_streaming.py +754 -0
  11. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/node_cache.py +4 -1
  12. esp_rainmaker_cli-1.16.0/rmaker_lib/proto_webrtc_signal.py +53 -0
  13. esp_rainmaker_cli-1.16.0/rmaker_lib/video_recording.py +131 -0
  14. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/security/security2.py +66 -0
  15. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/transport/ble_cli.py +3 -3
  16. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/transport/transport_ble.py +6 -2
  17. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/transport/transport_http.py +18 -1
  18. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/esp_prov.py +2 -2
  19. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/esp_rainmaker_ctrl.py +7 -2
  20. esp_rainmaker_cli-1.16.0/rmaker_tools/rmaker_local_ctrl/esp_rmaker_prov_local_ctrl_pb2.py +52 -0
  21. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/integration.py +114 -21
  22. esp_rainmaker_cli-1.16.0/rmaker_tools/rmaker_local_ctrl/prov_local_ctrl_ext.py +156 -0
  23. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/raw_config.py +22 -6
  24. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/raw_params.py +82 -14
  25. esp_rainmaker_cli-1.16.0/rmaker_tools/rmaker_local_ctrl/rmaker_webrtc_signal_pb2.py +58 -0
  26. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/esp_rainmaker_prov.py +37 -18
  27. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/prov/prov_util.py +5 -3
  28. esp_rainmaker_cli-1.14.0/rmaker_tools/rmaker_local_ctrl/esp_rmaker_prov_local_ctrl_pb2.py +0 -48
  29. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/LICENSE +0 -0
  30. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/README.md +0 -0
  31. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/esp_rainmaker_cli.egg-info/dependency_links.txt +0 -0
  32. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/esp_rainmaker_cli.egg-info/entry_points.txt +0 -0
  33. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/esp_rainmaker_cli.egg-info/requires.txt +0 -0
  34. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/esp_rainmaker_cli.egg-info/top_level.txt +0 -0
  35. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rainmaker/__init__.py +0 -0
  36. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/__init__.py +0 -0
  37. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/automation.py +0 -0
  38. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/browserlogin.py +0 -0
  39. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/cache.py +0 -0
  40. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/cmd_response.py +0 -0
  41. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/group.py +0 -0
  42. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/html/welcome.html +0 -0
  43. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/test.py +0 -0
  44. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_cmd/user.py +0 -0
  45. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/__init__.py +0 -0
  46. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/aws_credentials.py +0 -0
  47. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/cmd_response.py +0 -0
  48. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/configmanager.py +0 -0
  49. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/constants.py +0 -0
  50. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/device.py +0 -0
  51. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/envval.py +0 -0
  52. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/exceptions.py +0 -0
  53. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/local_control.py +0 -0
  54. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/logger.py +0 -0
  55. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/node.py +0 -0
  56. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/profile_manager.py +0 -0
  57. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/profile_utils.py +0 -0
  58. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/schedule_utils.py +0 -0
  59. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/serverconfig.py +0 -0
  60. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/service.py +0 -0
  61. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/session.py +0 -0
  62. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/session_store.py +0 -0
  63. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/simple_local_control.py +0 -0
  64. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_lib/user.py +0 -0
  65. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/__init__.py +0 -0
  66. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/__init__.py +0 -0
  67. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/discovery/__init__.py +0 -0
  68. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/discovery/mdns_discovery.py +0 -0
  69. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/prov/__init__.py +0 -0
  70. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/prov/wifi_ctrl.py +0 -0
  71. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/prov/wifi_prov.py +0 -0
  72. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/prov/wifi_scan.py +0 -0
  73. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/security/__init__.py +0 -0
  74. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/security/security.py +0 -0
  75. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/security/security0.py +0 -0
  76. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/security/security1.py +0 -0
  77. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/security/srp6a.py +0 -0
  78. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/transport/__init__.py +0 -0
  79. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/transport/transport.py +0 -0
  80. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/transport/transport_console.py +0 -0
  81. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/utils/__init__.py +0 -0
  82. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/common/utils/convenience.py +0 -0
  83. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_claim/__init__.py +0 -0
  84. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_claim/claim.py +0 -0
  85. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_claim/claim_config.py +0 -0
  86. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/__init__.py +0 -0
  87. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/constants_pb2.py +0 -0
  88. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/esp_local_ctrl.py +0 -0
  89. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/esp_local_ctrl_pb2.py +0 -0
  90. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/proto/__init__.py +0 -0
  91. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/proto/proto_lc.py +0 -0
  92. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/prov/__init__.py +0 -0
  93. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/prov/custom_prov.py +0 -0
  94. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/prov/wifi_ctrl.py +0 -0
  95. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/sec0_pb2.py +0 -0
  96. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/sec1_pb2.py +0 -0
  97. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/sec2_pb2.py +0 -0
  98. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/security/__init__.py +0 -0
  99. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/session_pb2.py +0 -0
  100. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/transport/__init__.py +0 -0
  101. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_local_ctrl/utils/__init__.py +0 -0
  102. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/__init__.py +0 -0
  103. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/challenge_response.py +0 -0
  104. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/config/__init__.py +0 -0
  105. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/config/custom_cloud_config_pb2.py +0 -0
  106. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/config/esp_rmaker_chal_resp_pb2.py +0 -0
  107. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/config/esp_rmaker_claim_pb2.py +0 -0
  108. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/config/esp_rmaker_user_mapping_pb2.py +0 -0
  109. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/on_network_chal_resp.py +0 -0
  110. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/proto/__init__.py +0 -0
  111. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/protocomm/__init__.py +0 -0
  112. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/protocomm/python/__init__.py +0 -0
  113. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/protocomm/python/constants_pb2.py +0 -0
  114. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/protocomm/python/sec0_pb2.py +0 -0
  115. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/protocomm/python/sec1_pb2.py +0 -0
  116. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/protocomm/python/sec2_pb2.py +0 -0
  117. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/protocomm/python/session_pb2.py +0 -0
  118. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/prov/__init__.py +0 -0
  119. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/prov/user_mapping.py +0 -0
  120. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/security/__init__.py +0 -0
  121. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/transport/__init__.py +0 -0
  122. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/utils/__init__.py +0 -0
  123. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/wifi_provisioning/__init__.py +0 -0
  124. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/wifi_provisioning/python/__init__.py +0 -0
  125. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/wifi_provisioning/python/wifi_config_pb2.py +0 -0
  126. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/wifi_provisioning/python/wifi_constants_pb2.py +0 -0
  127. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/wifi_provisioning/python/wifi_ctrl_pb2.py +0 -0
  128. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/rmaker_tools/rmaker_prov/wifi_provisioning/python/wifi_scan_pb2.py +0 -0
  129. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/server_cert/__init__.py +0 -0
  130. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/server_cert/server_cert.pem +0 -0
  131. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/setup.cfg +0 -0
  132. {esp_rainmaker_cli-1.14.0 → esp_rainmaker_cli-1.16.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esp-rainmaker-cli
3
- Version: 1.14.0
3
+ Version: 1.16.0
4
4
  Summary: A python utility to perform host based claiming
5
5
  Home-page: https://github.com/espressif/esp-rainmaker-cli
6
6
  Author: Espressif Systems
@@ -122,6 +122,47 @@ Changelog
122
122
 
123
123
  All major changes to ESP RainMaker CLI will be documented in this file.
124
124
 
125
+ ## [1.16.0] - 02-Dec-2026
126
+ ### Added
127
+ - Local WebRTC signaling for the `stream` command. The CLI signals directly with the device over the LAN through ESP Local Control, with no cloud dependency:
128
+ - `--local`: use local signaling. The node must expose the `webrtc_signal` endpoint.
129
+ - `--auto`: try local signaling first and fall back to KVS cloud signaling. The fallback also covers a WebRTC connection that fails or times out, and a stream with no video.
130
+ - `--pop`: the Proof of Possession. It is fetched from the cloud when omitted.
131
+ - Protobuf-based signaling protocol (`rmaker_webrtc_signal.proto`) exchanged over a Security 1 or Security 2 local control session.
132
+ - `--host`: device IP or hostname, for a device that mDNS cannot resolve (default: `<node_id>.local`).
133
+ - `--port`: local control port (default: the cached port, else 8080). The RainMaker split camera uses 62080.
134
+ - Security 2 (SRP6a) and RainMaker Neo cameras. The CLI reads the version endpoint (`rmaker_local_ctrl/version` for Neo, `esp_local_ctrl/version` for classic). It then picks the session endpoint and the security version.
135
+ - `--sec_ver`: security version override (0, 1 or 2). Default: the device's `sec_ver`, else the node's `local_control_type`, else 1.
136
+ - `--sec2_username`: SRP6a username. Default: the node's `local_control_username`, else `wifiprov`. `--pop` is the password.
137
+ - `--ep_prefix`: `rmaker_local_ctrl` (Neo) or `esp_local_ctrl` (classic), to skip endpoint detection.
138
+ - The local control options need `--local` or `--auto`. The command stops with an error otherwise.
139
+
140
+ ### Fixed
141
+ - HTTP local control transport (`Transport_HTTP`): the CLI reads the response body on error responses too, and closes the connection on any failure. A stale body could break the next request on a reused connection. This affects provisioning and `getparams`/`setparams` over HTTP, not only `stream`.
142
+ - `stream --output`: the saved video length matches the capture time. WebRTC delivers a variable frame rate, and the writer used a fixed 30 fps. This also fixes the cloud (KVS) save path. `--duration` and the stats `Elapsed` counter start at the first frame.
143
+ - `stream`: the video window opens on macOS. The display check required an X11 `DISPLAY` on macOS too.
144
+
145
+ ## [1.15.0] - 19-Nov-2026
146
+ ### Added
147
+ - BLE provisioning local control options `--filter` and `--frag-size` require firmware built with `esp_rainmaker` 2.2.0 or later.
148
+ - Local control aligned with esp-rainmaker 2.2.0 provisioning endpoints:
149
+ - `getparams --filter '{"params":{"Light":["Power"],"Schedule":true}}'` sends `CmdGetData.ParamsFilter` over BLE provisioning (`--local-raw --transport ble`). The CLI prints a note to stderr when the device returns extra parameters.
150
+ - `setparams --local-raw --transport ble --frag-size` sends `CmdSetData` fragments on `set_params` when `rmaker_extra.cap` contains `set_frag`. The device sets the maximum JSON size and reports it in `RespSetData.MaxLen`.
151
+ - `--ble_adapter` option for the `provision` command to select the HCI adapter used for BLE transport (default: `hci0`). Useful with `vhci_bridge` for emulated devices, e.g. `--ble_adapter hci1`. Linux/BlueZ only.
152
+
153
+ ## [1.14.1] - 05-Jun-2026
154
+ ### Bugfixes
155
+ - Security 2 fixes across provisioning and local control:
156
+ - Provisioning auto-detect now reads `prov.sec_ver` from device capabilities
157
+ (was forcing sec1 on sec2 devices, causing firmware "Security version mismatch")
158
+ - `sec_patch_ver` discovered from device capabilities / `esp_local_ctrl/version`,
159
+ enabling the counter-in-IV scheme on ESP-IDF v5.4+ firmware
160
+ - `--sec2_username` option added to `--local` commands (`getnodeconfig`,
161
+ `getparams`, `setparams`); defaults to `wifiprov`, picks up cached
162
+ `local_control_username` from cloud params; `--pop` used as the SRP6a password
163
+ - QR code `username` / `password` fields now honoured by `provision`
164
+ - `Security2.serialize`/`deserialize` for local-control session resume parity with Security 1
165
+
125
166
  ## [1.14.0] - 24-Apr-2026
126
167
  ### Added
127
168
  - New `group sharing` subcommand for sharing device groups / Matter fabrics between users:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esp-rainmaker-cli
3
- Version: 1.14.0
3
+ Version: 1.16.0
4
4
  Summary: A python utility to perform host based claiming
5
5
  Home-page: https://github.com/espressif/esp-rainmaker-cli
6
6
  Author: Espressif Systems
@@ -122,6 +122,47 @@ Changelog
122
122
 
123
123
  All major changes to ESP RainMaker CLI will be documented in this file.
124
124
 
125
+ ## [1.16.0] - 02-Dec-2026
126
+ ### Added
127
+ - Local WebRTC signaling for the `stream` command. The CLI signals directly with the device over the LAN through ESP Local Control, with no cloud dependency:
128
+ - `--local`: use local signaling. The node must expose the `webrtc_signal` endpoint.
129
+ - `--auto`: try local signaling first and fall back to KVS cloud signaling. The fallback also covers a WebRTC connection that fails or times out, and a stream with no video.
130
+ - `--pop`: the Proof of Possession. It is fetched from the cloud when omitted.
131
+ - Protobuf-based signaling protocol (`rmaker_webrtc_signal.proto`) exchanged over a Security 1 or Security 2 local control session.
132
+ - `--host`: device IP or hostname, for a device that mDNS cannot resolve (default: `<node_id>.local`).
133
+ - `--port`: local control port (default: the cached port, else 8080). The RainMaker split camera uses 62080.
134
+ - Security 2 (SRP6a) and RainMaker Neo cameras. The CLI reads the version endpoint (`rmaker_local_ctrl/version` for Neo, `esp_local_ctrl/version` for classic). It then picks the session endpoint and the security version.
135
+ - `--sec_ver`: security version override (0, 1 or 2). Default: the device's `sec_ver`, else the node's `local_control_type`, else 1.
136
+ - `--sec2_username`: SRP6a username. Default: the node's `local_control_username`, else `wifiprov`. `--pop` is the password.
137
+ - `--ep_prefix`: `rmaker_local_ctrl` (Neo) or `esp_local_ctrl` (classic), to skip endpoint detection.
138
+ - The local control options need `--local` or `--auto`. The command stops with an error otherwise.
139
+
140
+ ### Fixed
141
+ - HTTP local control transport (`Transport_HTTP`): the CLI reads the response body on error responses too, and closes the connection on any failure. A stale body could break the next request on a reused connection. This affects provisioning and `getparams`/`setparams` over HTTP, not only `stream`.
142
+ - `stream --output`: the saved video length matches the capture time. WebRTC delivers a variable frame rate, and the writer used a fixed 30 fps. This also fixes the cloud (KVS) save path. `--duration` and the stats `Elapsed` counter start at the first frame.
143
+ - `stream`: the video window opens on macOS. The display check required an X11 `DISPLAY` on macOS too.
144
+
145
+ ## [1.15.0] - 19-Nov-2026
146
+ ### Added
147
+ - BLE provisioning local control options `--filter` and `--frag-size` require firmware built with `esp_rainmaker` 2.2.0 or later.
148
+ - Local control aligned with esp-rainmaker 2.2.0 provisioning endpoints:
149
+ - `getparams --filter '{"params":{"Light":["Power"],"Schedule":true}}'` sends `CmdGetData.ParamsFilter` over BLE provisioning (`--local-raw --transport ble`). The CLI prints a note to stderr when the device returns extra parameters.
150
+ - `setparams --local-raw --transport ble --frag-size` sends `CmdSetData` fragments on `set_params` when `rmaker_extra.cap` contains `set_frag`. The device sets the maximum JSON size and reports it in `RespSetData.MaxLen`.
151
+ - `--ble_adapter` option for the `provision` command to select the HCI adapter used for BLE transport (default: `hci0`). Useful with `vhci_bridge` for emulated devices, e.g. `--ble_adapter hci1`. Linux/BlueZ only.
152
+
153
+ ## [1.14.1] - 05-Jun-2026
154
+ ### Bugfixes
155
+ - Security 2 fixes across provisioning and local control:
156
+ - Provisioning auto-detect now reads `prov.sec_ver` from device capabilities
157
+ (was forcing sec1 on sec2 devices, causing firmware "Security version mismatch")
158
+ - `sec_patch_ver` discovered from device capabilities / `esp_local_ctrl/version`,
159
+ enabling the counter-in-IV scheme on ESP-IDF v5.4+ firmware
160
+ - `--sec2_username` option added to `--local` commands (`getnodeconfig`,
161
+ `getparams`, `setparams`); defaults to `wifiprov`, picks up cached
162
+ `local_control_username` from cloud params; `--pop` used as the SRP6a password
163
+ - QR code `username` / `password` fields now honoured by `provision`
164
+ - `Security2.serialize`/`deserialize` for local-control session resume parity with Security 1
165
+
125
166
  ## [1.14.0] - 24-Apr-2026
126
167
  ### Added
127
168
  - New `group sharing` subcommand for sharing device groups / Matter fabrics between users:
@@ -32,11 +32,13 @@ rmaker_lib/envval.py
32
32
  rmaker_lib/exceptions.py
33
33
  rmaker_lib/kvs_streaming.py
34
34
  rmaker_lib/local_control.py
35
+ rmaker_lib/local_streaming.py
35
36
  rmaker_lib/logger.py
36
37
  rmaker_lib/node.py
37
38
  rmaker_lib/node_cache.py
38
39
  rmaker_lib/profile_manager.py
39
40
  rmaker_lib/profile_utils.py
41
+ rmaker_lib/proto_webrtc_signal.py
40
42
  rmaker_lib/schedule_utils.py
41
43
  rmaker_lib/serverconfig.py
42
44
  rmaker_lib/service.py
@@ -44,6 +46,7 @@ rmaker_lib/session.py
44
46
  rmaker_lib/session_store.py
45
47
  rmaker_lib/simple_local_control.py
46
48
  rmaker_lib/user.py
49
+ rmaker_lib/video_recording.py
47
50
  rmaker_tools/__init__.py
48
51
  rmaker_tools/common/__init__.py
49
52
  rmaker_tools/common/discovery/__init__.py
@@ -77,8 +80,10 @@ rmaker_tools/rmaker_local_ctrl/esp_prov.py
77
80
  rmaker_tools/rmaker_local_ctrl/esp_rainmaker_ctrl.py
78
81
  rmaker_tools/rmaker_local_ctrl/esp_rmaker_prov_local_ctrl_pb2.py
79
82
  rmaker_tools/rmaker_local_ctrl/integration.py
83
+ rmaker_tools/rmaker_local_ctrl/prov_local_ctrl_ext.py
80
84
  rmaker_tools/rmaker_local_ctrl/raw_config.py
81
85
  rmaker_tools/rmaker_local_ctrl/raw_params.py
86
+ rmaker_tools/rmaker_local_ctrl/rmaker_webrtc_signal_pb2.py
82
87
  rmaker_tools/rmaker_local_ctrl/sec0_pb2.py
83
88
  rmaker_tools/rmaker_local_ctrl/sec1_pb2.py
84
89
  rmaker_tools/rmaker_local_ctrl/sec2_pb2.py
@@ -285,6 +285,10 @@ def main():
285
285
  choices=[0, 1, 2],
286
286
  default=None,
287
287
  help='Security version for local control (default: 1)')
288
+ getnodeconfig_parser.add_argument('--sec2_username',
289
+ type=str,
290
+ default=None,
291
+ help='SRP6a username for Security 2 local control. Defaults to the username cached from cloud params, else \'wifiprov\'. --pop is used as the password.')
288
292
  getnodeconfig_parser.add_argument('--local-raw',
289
293
  action='store_true',
290
294
  help='Use local control via raw endpoints (get_config with fragmentation) instead of esp_local_ctrl')
@@ -355,6 +359,10 @@ def main():
355
359
  choices=[0, 1, 2],
356
360
  default=None,
357
361
  help='Security version for local control (default: 1)')
362
+ setparams_parser.add_argument('--sec2_username',
363
+ type=str,
364
+ default=None,
365
+ help='SRP6a username for Security 2 local control. Defaults to the username cached from cloud params, else \'wifiprov\'. --pop is used as the password.')
358
366
  setparams_parser.add_argument('--local-raw',
359
367
  action='store_true',
360
368
  help='Use local control via raw endpoints (get_params/set_params) instead of esp_local_ctrl')
@@ -362,6 +370,13 @@ def main():
362
370
  type=str,
363
371
  help='Device name for BLE transport (e.g., PROV_aaf824). Required when using --transport ble')
364
372
 
373
+ setparams_parser.add_argument('--frag-size',
374
+ type=int,
375
+ default=None,
376
+ dest='frag_size',
377
+ help='Send the JSON through BLE set_params as protobuf fragments (1 to 200 bytes per chunk). '
378
+ 'Requires rmaker_extra.cap to include set_frag. '
379
+ 'Without this option the JSON is sent in one body to set_params.')
365
380
  setparams_parser.add_argument('--auto',
366
381
  action='store_true',
367
382
  help='Try local control first, fall back to cloud if local fails')
@@ -398,6 +413,13 @@ def main():
398
413
  choices=[0, 1, 2],
399
414
  default=None,
400
415
  help='Security version for local control (default: 1)')
416
+ getparams_parser.add_argument('--sec2_username',
417
+ type=str,
418
+ default=None,
419
+ help='SRP6a username for Security 2 local control. Defaults to the username cached from cloud params, else \'wifiprov\'. --pop is used as the password.')
420
+ getparams_parser.add_argument('--filter',
421
+ help='Parameter filter for --local-raw --transport ble. '
422
+ 'JSON: {"params":{"Light":["Power"],"Schedule":true}}')
401
423
  getparams_parser.add_argument('--local-raw',
402
424
  action='store_true',
403
425
  help='Use local control via raw endpoints (get_params/set_params) instead of esp_local_ctrl')
@@ -552,6 +574,12 @@ def main():
552
574
  help='Metadata as JSON string to attach during node mapping\n'
553
575
  '(e.g., \'{"serial_no": "abc123", "region": "us"}\')')
554
576
 
577
+ provision_parser.add_argument('--ble_adapter',
578
+ type=str,
579
+ default='hci0',
580
+ help='HCI adapter to use for BLE transport (default: hci0).\n'
581
+ 'Useful with vhci_bridge for emulated devices, e.g. --ble_adapter hci1')
582
+
555
583
  add_profile_argument(provision_parser)
556
584
  provision_parser.set_defaults(func=provision)
557
585
 
@@ -1261,6 +1289,36 @@ def main():
1261
1289
  stream_parser.add_argument('--stats-only',
1262
1290
  action='store_true',
1263
1291
  help='Show statistics only, no video display')
1292
+ stream_parser.add_argument('--local',
1293
+ action='store_true',
1294
+ help='Use local signaling over LAN (instead of KVS cloud)')
1295
+ stream_parser.add_argument('--auto',
1296
+ action='store_true',
1297
+ help='Try local signaling first, fall back to cloud')
1298
+ stream_parser.add_argument('--pop',
1299
+ help='Proof of Possession for local control (auto-fetched if omitted)')
1300
+ stream_parser.add_argument('--port',
1301
+ type=int,
1302
+ help='Local control port (default: the cached port, else 8080)')
1303
+ stream_parser.add_argument('--host',
1304
+ help='Device IP or hostname for local signaling (default: <node_id>.local)')
1305
+ stream_parser.add_argument('--sec_ver',
1306
+ dest='sec_ver',
1307
+ type=int,
1308
+ choices=[0, 1, 2],
1309
+ help='Local control security version (default: from the device version endpoint, '
1310
+ 'else the node\'s local_control_type, else 1)')
1311
+ stream_parser.add_argument('--sec2_username',
1312
+ dest='sec2_username',
1313
+ metavar='<username>',
1314
+ help='SRP6a username for Security 2 (default: the node\'s local_control_username, '
1315
+ 'else \'wifiprov\'). --pop is the password.')
1316
+ stream_parser.add_argument('--ep_prefix',
1317
+ dest='ep_prefix',
1318
+ choices=['rmaker_local_ctrl', 'esp_local_ctrl'],
1319
+ help='Local control session/version endpoint prefix: rmaker_local_ctrl '
1320
+ '(RainMaker Neo) or esp_local_ctrl (RainMaker classic). '
1321
+ 'Default: detected from the version endpoint')
1264
1322
  add_profile_argument(stream_parser)
1265
1323
  stream_parser.set_defaults(func=stream_video)
1266
1324
 
@@ -5,4 +5,4 @@
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  # This file contains the version information for the ESP RainMaker CLI
8
- VERSION = "1.14.0"
8
+ VERSION = "1.16.0"
@@ -78,6 +78,9 @@ def _build_local_options_with_cache(vars_dict, node_cache=None, session_store=No
78
78
  sec_ver = raw_sec_ver if raw_sec_ver is not None else 1
79
79
  nodeid = vars_dict.get('nodeid', '')
80
80
 
81
+ user_sec2_username = vars_dict.get('sec2_username') # None => not supplied
82
+ sec2_username = user_sec2_username
83
+
81
84
  if node_cache and not pop:
82
85
  capability = node_cache.get_local_control_capability(nodeid)
83
86
  if capability:
@@ -99,6 +102,9 @@ def _build_local_options_with_cache(vars_dict, node_cache=None, session_store=No
99
102
  log.debug(f"Using cached POP for node {nodeid}")
100
103
  if lc_info.get('sec_ver') is not None and not explicit_sec_ver:
101
104
  sec_ver = lc_info['sec_ver']
105
+ if sec2_username is None and lc_info.get('username'):
106
+ sec2_username = lc_info['username']
107
+ log.debug(f"Using cached sec2 username for node {nodeid}")
102
108
 
103
109
  if not pop and not explicit_sec_ver:
104
110
  try:
@@ -114,17 +120,27 @@ def _build_local_options_with_cache(vars_dict, node_cache=None, session_store=No
114
120
  pop = lc_info.get('pop', '')
115
121
  if lc_info.get('sec_ver') is not None:
116
122
  sec_ver = lc_info['sec_ver']
123
+ if sec2_username is None and lc_info.get('username'):
124
+ sec2_username = lc_info['username']
117
125
  log.debug(f"Resolved POP from cloud for node {nodeid}")
118
126
  except Exception as e:
119
127
  log.debug(f"Failed to auto-resolve POP from cloud: {e}")
120
128
 
129
+ if not sec2_username:
130
+ sec2_username = 'wifiprov'
131
+ if sec_ver == 2:
132
+ print(f"Using default Security 2 username '{sec2_username}'")
133
+
121
134
  local_options = {
122
135
  'pop': pop,
123
136
  'transport': vars_dict.get('transport', 'http'),
124
137
  'port': vars_dict.get('port', 8080),
125
138
  'sec_ver': sec_ver,
139
+ 'sec2_username': sec2_username,
126
140
  'local_raw': vars_dict.get('local_raw', False),
127
141
  'device_name': vars_dict.get('device_name', None),
142
+ 'params_filter': vars_dict.get('filter'),
143
+ 'frag_size': vars_dict.get('frag_size'),
128
144
  'node_cache': node_cache,
129
145
  'session_store': session_store,
130
146
  'explicit_sec_ver': explicit_sec_ver,
@@ -1259,6 +1275,7 @@ def get_node_config(vars=None):
1259
1275
  'transport': vars.get('transport', 'ble'),
1260
1276
  'port': vars.get('port', 8080),
1261
1277
  'sec_ver': vars.get('sec_ver') if vars.get('sec_ver') is not None else 1,
1278
+ 'sec2_username': vars.get('sec2_username', 'wifiprov') or 'wifiprov',
1262
1279
  'device_name': vars.get('device_name', None),
1263
1280
  'timestamp': timestamp
1264
1281
  }
@@ -1312,7 +1329,8 @@ def get_node_config(vars=None):
1312
1329
  'pop': vars.get('pop', ''),
1313
1330
  'transport': vars.get('transport', 'http'),
1314
1331
  'port': vars.get('port', 8080),
1315
- 'sec_ver': vars.get('sec_ver') if vars.get('sec_ver') is not None else 1
1332
+ 'sec_ver': vars.get('sec_ver') if vars.get('sec_ver') is not None else 1,
1333
+ 'sec2_username': vars.get('sec2_username', 'wifiprov') or 'wifiprov',
1316
1334
  }
1317
1335
 
1318
1336
  node_config = run_local_control_operation(
@@ -1326,7 +1344,8 @@ def get_node_config(vars=None):
1326
1344
  'pop': vars.get('pop', ''),
1327
1345
  'transport': vars.get('transport', 'http'),
1328
1346
  'port': vars.get('port', 8080),
1329
- 'sec_ver': vars.get('sec_ver') if vars.get('sec_ver') is not None else 0
1347
+ 'sec_ver': vars.get('sec_ver') if vars.get('sec_ver') is not None else 0,
1348
+ 'sec2_username': vars.get('sec2_username', 'wifiprov') or 'wifiprov',
1330
1349
  }
1331
1350
 
1332
1351
  log.info("Using simplified local control (security level 0)")
@@ -1461,6 +1480,14 @@ def set_params(vars=None):
1461
1480
  :rtype: None
1462
1481
  """
1463
1482
 
1483
+ if vars and vars.get('frag_size') is not None:
1484
+ if int(vars['frag_size']) < 1:
1485
+ print('Error: --frag-size must be at least 1.')
1486
+ return
1487
+ if not vars.get('local_raw') or vars.get('transport') != 'ble' or vars.get('auto'):
1488
+ print('Error: --frag-size requires --local-raw --transport ble and cannot be used with --auto.')
1489
+ return
1490
+
1464
1491
  data = None
1465
1492
  if vars['data']:
1466
1493
  data = json.loads(vars['data'])
@@ -1478,6 +1505,12 @@ def set_params(vars=None):
1478
1505
  auto_vars = dict(vars)
1479
1506
  auto_vars['nodeid'] = node_id
1480
1507
  result = _try_local_operation(auto_vars, 'set_params', data)
1508
+ if isinstance(result, dict) and result.get('fatal'):
1509
+ print(result.get('message') or 'Local control failed.')
1510
+ return
1511
+ if isinstance(result, dict) and result.get('status') not in (None, 'success'):
1512
+ all_succeeded = False
1513
+ break
1481
1514
  if result is None or result is False:
1482
1515
  all_succeeded = False
1483
1516
  break
@@ -1567,8 +1600,10 @@ def set_params(vars=None):
1567
1600
  'transport': vars.get('transport', 'http'),
1568
1601
  'port': vars.get('port', 8080),
1569
1602
  'sec_ver': vars.get('sec_ver') if vars.get('sec_ver') is not None else 0,
1603
+ 'sec2_username': vars.get('sec2_username', 'wifiprov') or 'wifiprov',
1570
1604
  'local_raw': vars.get('local_raw', False),
1571
- 'device_name': vars.get('device_name', None)
1605
+ 'device_name': vars.get('device_name', None),
1606
+ 'frag_size': vars.get('frag_size'),
1572
1607
  }
1573
1608
 
1574
1609
  log.info("Using simplified local control (security level 0)")
@@ -1677,6 +1712,21 @@ def get_params(vars=None):
1677
1712
  :return: None on Success
1678
1713
  :rtype: None
1679
1714
  """
1715
+ if vars and vars.get('filter') is not None:
1716
+ from rmaker_tools.rmaker_local_ctrl.prov_local_ctrl_ext import prepare_params_filter
1717
+ if not vars.get('local_raw') or vars.get('transport') != 'ble' or vars.get('auto'):
1718
+ print('Error: --filter requires --local-raw --transport ble and cannot be used with --auto.')
1719
+ return
1720
+ if vars.get('init') or vars.get('proxy_report'):
1721
+ print('Error: --filter cannot be used with --init or --proxy-report.')
1722
+ return
1723
+ try:
1724
+ vars = dict(vars)
1725
+ vars['filter'] = prepare_params_filter(vars['filter'])
1726
+ except ValueError as exc:
1727
+ print(f'Error: {exc}')
1728
+ return
1729
+
1680
1730
  try:
1681
1731
  params = None
1682
1732
  proxy_report = vars.get('proxy_report', False) if vars else False
@@ -1753,8 +1803,10 @@ def get_params(vars=None):
1753
1803
  'transport': vars.get('transport', 'http'),
1754
1804
  'port': vars.get('port', 8080),
1755
1805
  'sec_ver': vars.get('sec_ver') if vars.get('sec_ver') is not None else 1,
1806
+ 'sec2_username': vars.get('sec2_username', 'wifiprov') or 'wifiprov',
1756
1807
  'local_raw': vars.get('local_raw', False),
1757
1808
  'device_name': vars.get('device_name', None),
1809
+ 'params_filter': vars.get('filter'),
1758
1810
  'timestamp': timestamp if not (proxy_report and vars.get('local_raw', False) and not timestamp_explicitly_provided) else timestamp,
1759
1811
  'proxy_report': proxy_report
1760
1812
  }
@@ -1779,8 +1831,10 @@ def get_params(vars=None):
1779
1831
  'transport': vars.get('transport', 'http'),
1780
1832
  'port': vars.get('port', 8080),
1781
1833
  'sec_ver': vars.get('sec_ver') if vars.get('sec_ver') is not None else 0,
1834
+ 'sec2_username': vars.get('sec2_username', 'wifiprov') or 'wifiprov',
1782
1835
  'local_raw': vars.get('local_raw', False),
1783
1836
  'device_name': vars.get('device_name', None),
1837
+ 'params_filter': vars.get('filter'),
1784
1838
  'timestamp': timestamp if not (proxy_report and vars.get('local_raw', False) and not timestamp_explicitly_provided) else timestamp,
1785
1839
  'proxy_report': proxy_report
1786
1840
  }
@@ -1817,6 +1871,9 @@ def get_params(vars=None):
1817
1871
  if params is None:
1818
1872
  log.error('Node status not updated.')
1819
1873
  return
1874
+ if isinstance(params, dict) and params.get('fatal') is True and params.get('status') == 'error':
1875
+ print(f"Error: {params['message']}")
1876
+ return
1820
1877
 
1821
1878
  # If proxy_report is enabled and we got a signed response, POST it to proxy API
1822
1879
  if proxy_report:
@@ -117,8 +117,15 @@ def provision(vars=None):
117
117
  raise ValueError("Proof of possession (pop) may be required depending on security scheme. "
118
118
  "Use --pop, provide via --qrcode, or specify --sec_ver to skip pop requirement "
119
119
  "(Security 0 and 2 don't require pop).")
120
- sec2_username = vars.get('sec2_username', '')
121
- sec2_password = vars.get('sec2_password', '')
120
+
121
+ # sec2 credentials: explicit options override QR code values.
122
+ # QR code fields: 'username' and 'password' (sec2 SRP6a credentials).
123
+ sec2_username = (vars.get('sec2_username')
124
+ or qrcode_data.get('username')
125
+ or '')
126
+ sec2_password = (vars.get('sec2_password')
127
+ or qrcode_data.get('password')
128
+ or '')
122
129
  ssid = vars.get('ssid')
123
130
  passphrase = vars.get('passphrase')
124
131
  no_wifi = vars.get('no_wifi', False)
@@ -237,7 +244,8 @@ def provision(vars=None):
237
244
  no_wifi=no_wifi,
238
245
  disable_chal_resp=disable_chal_resp,
239
246
  tags=mapping_tags,
240
- metadata=mapping_metadata
247
+ metadata=mapping_metadata,
248
+ ble_adapter=vars.get('ble_adapter', 'hci0')
241
249
  )
242
250
  except RuntimeError as claim_err:
243
251
  # Handle claim requirement error specifically
@@ -132,9 +132,106 @@ def _stream_via_kvs(vars, node_id, save_path, duration, stats_only, region_overr
132
132
  print(f"Warning: Video file was not saved. No frames were received or recording failed.")
133
133
 
134
134
 
135
+ def _cached_local_control_info(vars, node_id):
136
+ """Return the cached local control info (pop, sec_ver, username) for node_id, if any."""
137
+ try:
138
+ from rmaker_cmd.node import _get_cache_objects
139
+ node_cache, _ = _get_cache_objects(vars or {})
140
+ if node_cache:
141
+ return node_cache.get_local_control_info(node_id) or {}
142
+ except Exception as e:
143
+ log.debug(f"Local control info cache lookup failed: {e}")
144
+ return {}
145
+
146
+
147
+ def _stream_via_local(vars, node_id, save_path, duration, stats_only, pop=None, port=None, host=None,
148
+ sec_ver=None, username=None, ep_prefix=None):
149
+ """Stream video using local signaling over local control."""
150
+ from rmaker_lib.local_streaming import start_local_streaming
151
+
152
+ # Security hints from the node's cloud params (local_control_type and
153
+ # local_control_username). The device version endpoint takes precedence
154
+ # over hint_sec_ver. Explicit sec_ver and username take precedence over both.
155
+ lc_info = _cached_local_control_info(vars, node_id)
156
+ hint_sec_ver = lc_info.get('sec_ver')
157
+ hint_username = lc_info.get('username')
158
+
159
+ # Resolve PoP using cache hierarchy: capability cache → local_control_info cache → cloud API
160
+ if not pop:
161
+ try:
162
+ from rmaker_cmd.node import _get_cache_objects, _build_local_options_with_cache
163
+ node_cache, session_store = _get_cache_objects(vars or {})
164
+ local_opts = _build_local_options_with_cache(
165
+ {**(vars or {}), 'nodeid': node_id},
166
+ node_cache=node_cache, session_store=session_store
167
+ )
168
+ if local_opts:
169
+ pop = local_opts.get('pop', '')
170
+ if port is None:
171
+ port = local_opts.get('port')
172
+ if pop:
173
+ log.info(f"Resolved PoP for {node_id} (cache or cloud)")
174
+ # The lookup above may have filled the cache from cloud params.
175
+ lc_info = _cached_local_control_info(vars, node_id)
176
+ hint_sec_ver = lc_info.get('sec_ver', hint_sec_ver)
177
+ hint_username = lc_info.get('username', hint_username)
178
+ except Exception as e:
179
+ log.debug(f"Cache-based PoP resolution failed: {e}")
180
+
181
+ # Fallback: fetch PoP directly from cloud if still missing
182
+ if not pop:
183
+ try:
184
+ from rmaker_lib.local_streaming import _fetch_local_control_info_from_cloud
185
+ s = get_session_with_profile(vars or {})
186
+ cloud_info = _fetch_local_control_info_from_cloud(node_id, s) or {}
187
+ pop = cloud_info.get('pop')
188
+ hint_sec_ver = cloud_info.get('sec_ver', hint_sec_ver)
189
+ hint_username = cloud_info.get('username', hint_username)
190
+ except Exception as e:
191
+ log.warning(f"Could not auto-fetch PoP: {e}")
192
+
193
+ print(f"\nStarting video stream from node {node_id} (local signaling)...")
194
+ if save_path:
195
+ print(f"Saving video to: {save_path}")
196
+ if stats_only:
197
+ print("Statistics mode enabled")
198
+ print()
199
+
200
+ show_video_param = False if stats_only else None
201
+
202
+ asyncio.run(start_local_streaming(
203
+ node_id=node_id,
204
+ pop=pop,
205
+ show_video=show_video_param,
206
+ save_path=save_path,
207
+ duration=duration,
208
+ stats_only=stats_only,
209
+ port=port or 8080,
210
+ host=host,
211
+ sec_ver=sec_ver,
212
+ username=username or hint_username,
213
+ ep_prefix=ep_prefix,
214
+ hint_sec_ver=hint_sec_ver,
215
+ ))
216
+
217
+ # Post-stream summary for saved video
218
+ if save_path:
219
+ import os
220
+ if os.path.isfile(save_path) and os.path.getsize(save_path) > 0:
221
+ size_mb = os.path.getsize(save_path) / (1024 * 1024)
222
+ print(f"Video saved: {save_path} ({size_mb:.1f} MB)")
223
+ else:
224
+ print(f"Warning: Video file was not saved. No frames were received or recording failed.")
225
+
226
+
135
227
  def stream_video(vars=None):
136
228
  """
137
- Stream video from a camera device using WebRTC via KVS cloud signaling.
229
+ Stream video from a camera device using WebRTC.
230
+
231
+ Supports two signaling modes:
232
+ - Cloud (default): Uses KVS signaling via AWS
233
+ - Local (--local): Uses local control HTTP for signaling on LAN
234
+ - Auto (--auto): Tries local first, falls back to cloud
138
235
 
139
236
  :param vars: Parameters dict from argparse
140
237
  :type vars: dict | None
@@ -149,6 +246,19 @@ def stream_video(vars=None):
149
246
  region_override = vars.get('region')
150
247
  duration = vars.get('duration')
151
248
  stats_only = vars.get('stats_only', False)
249
+ use_local = vars.get('local', False)
250
+ use_auto = vars.get('auto', False)
251
+ pop = vars.get('pop')
252
+
253
+ # Local control options only apply to local signaling
254
+ if not (use_local or use_auto):
255
+ local_only = [opt for opt, key in (('--pop', 'pop'), ('--port', 'port'), ('--host', 'host'),
256
+ ('--sec_ver', 'sec_ver'), ('--sec2_username', 'sec2_username'),
257
+ ('--ep_prefix', 'ep_prefix'))
258
+ if vars.get(key) is not None]
259
+ if local_only:
260
+ print(f"Error: {', '.join(local_only)} requires --local or --auto.")
261
+ return
152
262
 
153
263
  # Validate duration
154
264
  if duration is not None:
@@ -174,7 +284,22 @@ def stream_video(vars=None):
174
284
  return
175
285
 
176
286
  try:
287
+ if use_local or use_auto:
288
+ try:
289
+ _stream_via_local(vars, node_id, save_path, duration, stats_only, pop=pop,
290
+ port=vars.get('port'), host=vars.get('host'),
291
+ sec_ver=vars.get('sec_ver'),
292
+ username=vars.get('sec2_username'),
293
+ ep_prefix=vars.get('ep_prefix'))
294
+ return
295
+ except Exception as e:
296
+ if use_auto:
297
+ print(f"Local streaming failed ({e}), falling back to cloud signaling...")
298
+ else:
299
+ raise
300
+
177
301
  _stream_via_kvs(vars, node_id, save_path, duration, stats_only, region_override)
302
+
178
303
  except KeyboardInterrupt:
179
304
  print("\nStream interrupted by user")
180
305
  except ImportError as e: