So the principle of asking the questioner about his motivations rather than automatically giving him a 1:1 answer to the question asked does work.....
What you say is not possible, because the OpenBeken firmware does not use the partition in question in any way. To be more precise, in the firmware code itself this partition is not read let alone decoded, and this is necessary to use it, as it is AES encoded.
All OpenBeken (the firmware for the WiFi module) does is offer to read the flash memory of a given offset and size, which the Web App then uses to make a mechanism for downloading this partition, which then only
is decoded in the BK7231GUIFlashTool on Windows, in C# :
.
Furthermore, the TuyaMCU OBK driver was made from 0 before we knew about this partition, so there is no way to interact with it either....
TLDR: This partition is not used by the OBK firmware at all, only Flasher on Windows knows how to decode it.
Now that we have that covered, attention can now be turned to the actual problem we want to solve:
tomik67 wrote: The motivation is that I suddenly get an entry like this in the logs...:
Info:TuyaMCU:Received: 55 AA 03 2B 00 00 2D
Info:TuyaMCU:ProcessIncoming[v=3]: cmd 43 (NetworkStatus) len 7
Info:TuyaMCU:ProcessIncoming: (test for S09 calendar/IR device) received TUYA_CMD_NETWORK_STATUS 0x2B
.
.
This packet is defined as 0x2B (decimal 43):
.
Its support has been added for the S09 device. This is the package where the device asks the WiFi module for the network status:
.
This is not a problem by any means, but it is worth remembering that if OBK natively assumes that the status reported is "connected to the cloud" only how MQTT is connected. If there is no MQTT, it only reports connected to the router. You can change this behaviour by setting tuyaMcu_defWiFiState to 0x04.
Let me remind you of the argument values:
.
The same from Tuya's documentation:
Quote: .
Get the current network status .
Network status | | Description | . Status value |
Status 1 | Pairing in EZ mode. (For Wi-Fi and Bluetooth LE combo module: Bluetooth is also in pairing mode.) | 0x00 |
Status 2 | | Pairing in AP mode. (For Wi-Fi and Bluetooth LE combo module: Bluetooth is also in pairing mode.) | 0x01 |
Status 3 | The Wi-Fi network is set up, but the device is not connected to the router. | 0x02 |
Status 4 | The Wi-Fi network is set up, and the device is connected to the router. | 0x03 |
Status 5 | The device is connected to the cloud. | 0x04 |
0x04
Status 6 | Tuya's network module is in low power mode. | 0x05 |
Status 7 | EZ mode and AP mode coexist. (For Wi-Fi and Bluetooth LE combo module: Bluetooth is also in pairing mode.) | 0x06 |
.
The MCU sends the following command.
Field | | Bytes | . Description |
| Header | 2 | 0x55aa |
Version | 1 | 0x03 |
| Command | 1 | 0x2B |
Date length | 2 | 0x0000 | .
Date | Date | None | None |
| Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
.
For example, 55 aa 03 2b 00 00 2d
The module returns the following command. .
Field | | Bytes | . Description |
| Header | 2 | 0x55aa |
| Version | 1 | 0x00 |
Command | 1 | 0x2B |
Date length | 2 | . 0x0001 |
Date |
| 1 | |
0x00: Pairing in EZ mode. |
| 0x01: Pairing in AP mode. |
| 0x02: The Wi-Fi network is set up, but the device is not connected to the router. |
| 0x03: The Wi-Fi network is set up, and the device is connected to the router. |
| 0x04: The device is connected to the router and the cloud. |
| 0x05: The device is in low power mode. |
| 0x06: EZ mode and AP mode coexist. |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
.
.
Now, it would be rather pertinent to consider what specific device you have and what is the problem with it that you are looking for the culprit in the GetNetworkStatus (0x2B) query?