@@ -51,15 +51,13 @@ Complete endpoint documentation for the controller firmware.
5151 - [ Modbus Read] ( #post-apimodbusread )
52525 . [ Identity & Security] ( #identity--security )
5353 - [ Crypto Info] ( #get-apicrypto )
54+ - [ Initialize (Sign Wallet)] ( #post-apicrypto )
5455 - [ Sign Message] ( #post-apicryptosign )
5556 - [ Device Name] ( #get-apiname )
56- 6 . [ OTA Updates] ( #ota-updates )
57- - [ Start Update] ( #post-apiotaupdate )
58- - [ Update Status] ( #get-apiotastatus )
59- 7 . [ Utilities] ( #utilities )
57+ 6 . [ Utilities] ( #utilities )
6058 - [ Debug Info] ( #get-apidebug )
6159 - [ Echo] ( #post-apiecho )
62- 8 . [ Reference] ( #reference )
60+ 7 . [ Reference] ( #reference )
6361 - [ Status Codes] ( #status-codes )
6462 - [ Examples] ( #examples )
6563 - [ Notes] ( #notes )
@@ -195,10 +193,7 @@ Get WiFi status and scan results.
195193** Response** (200):
196194``` json
197195{
198- "ssids" : [
199- { "ssid" : " Network1" , "rssi" : -60 , "auth" : " WPA2" },
200- { "ssid" : " Network2" , "rssi" : -80 , "auth" : " OPEN" }
201- ],
196+ "ssids" : [" Network1" , " Network2" ],
202197 "connected" : " Network1"
203198}
204199```
@@ -1164,77 +1159,59 @@ Get device identity information.
11641159}
11651160```
11661161
1167- ### POST /api/crypto/sign
1162+ ### POST /api/crypto
11681163
1169- Sign a message with the device's private key .
1164+ Sign the device ID concatenated with a wallet address. Used to prove device identity during initialization .
11701165
11711166** Request** :
11721167``` json
11731168{
1174- "message" : " optional-message-content" ,
1175- "timestamp" : " optional-timestamp"
1169+ "wallet" : " 0xYourWalletAddress"
11761170}
11771171```
11781172
11791173** Response** (200):
11801174``` json
11811175{
1182- "sign " : " 3045022100... " ,
1183- "message " : " optional-message-content|nonce|timestamp|serial "
1176+ "idAndWallet " : " abc123def456:0xYourWalletAddress " ,
1177+ "signature " : " 3045022100... "
11841178}
11851179```
11861180
11871181** Errors** :
1188- - 400 - Pipe character (` | ` ) in message or timestamp
1189-
1190- ### GET /api/name
1191-
1192- Get device name (ID).
1193-
1194- ** Response** (200):
1195- ``` json
1196- {
1197- "name" : " abc123def456"
1198- }
1199- ```
1200-
1201- ---
1202-
1203- ## OTA Updates
1182+ - 400 - Missing ` wallet ` field
12041183
1205- ### POST /api/ota/update
1184+ ### POST /api/crypto/sign
12061185
1207- Start an OTA firmware update. The update runs asynchronously in the background .
1186+ Sign a message with the device's private key .
12081187
12091188** Request** :
12101189``` json
12111190{
1212- "url" : " https://example.com/firmware.bin"
1191+ "message" : " optional-message-content" ,
1192+ "timestamp" : " optional-timestamp"
12131193}
12141194```
12151195
1216- ** Response** (202 ):
1196+ ** Response** (200 ):
12171197``` json
12181198{
1219- "status " : " accepted " ,
1220- "message" : " OTA update started "
1199+ "sign " : " 3045022100... " ,
1200+ "message" : " optional-message-content|nonce|timestamp|serial "
12211201}
12221202```
12231203
12241204** Errors** :
1225- - 400 - Missing or invalid ` url `
1226- - 409 - Update already in progress
1227- - 500 - Failed to start OTA
1205+ - 400 - Pipe character (` | ` ) in message or timestamp
12281206
1229- ### GET /api/ota/status
1207+ ### GET /api/name
12301208
1231- Query the current OTA update status and progress .
1209+ Get device name (ID) .
12321210
12331211** Response** (200):
12341212``` json
12351213{
1236- "status" : " in_progress" ,
1237- "progress" : 45
1214+ "name" : " abc123def456"
12381215}
12391216```
12401217
0 commit comments