27 lines
1.3 KiB
Plaintext
27 lines
1.3 KiB
Plaintext
Summary: MQTT Commands in Device Mode
|
|
|
|
Question: "When using the Device mode, are all of the MQTT commands being sent?"
|
|
|
|
Answer: Yes, all MQTT commands are being sent when using Device mode.
|
|
|
|
The code analysis shows that when using the --Device parameter:
|
|
|
|
1. The process_single_device method is called, which identifies the device and determines if it's a "normal" device or an "unknown" device (matching unknown_device_patterns).
|
|
|
|
2. For normal devices:
|
|
- MQTT commands are sent through the get_device_details method
|
|
- All MQTT settings are configured: Host, Port, User, Password, Topic, FullTopic
|
|
- Console parameters including Retain settings and rules are also configured
|
|
- Commands have retry logic with up to 3 attempts
|
|
- Command failures are tracked and reported
|
|
|
|
3. For unknown devices:
|
|
- MQTT commands are sent through the configure_unknown_device method
|
|
- All the same MQTT settings are configured
|
|
- Console parameters are also configured
|
|
- The device is rebooted at the end to save the configuration
|
|
- Commands do not have retry logic
|
|
|
|
The different handling between normal and unknown devices is by design, as unknown devices are being initially configured while normal devices are being verified/updated.
|
|
|
|
No code changes are needed as all MQTT commands are being properly sent in Device mode. |