You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONFIGURATION.md
+37-26Lines changed: 37 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,21 @@
4
4
5
5
Configuration is loaded at startup in the following priority order:
6
6
7
-
1.**SD Card**: `config.json` file on the SD card
8
-
2.**Default**: Built-in default configuration if SD file not found
7
+
1.**SD Card**: `config.json` file on the SD card (primary storage)
8
+
2.**EEPROM Backup**: Configuration restored from EEPROM if SD card fails
9
+
3.**Default**: Built-in default configuration if both SD and EEPROM unavailable
10
+
11
+
The system automatically creates EEPROM backups when configurations are successfully loaded from SD card or applied via cloud functions. When EEPROM backup is used, the configuration is automatically restored to the SD card.
9
12
10
13
#### Updating Configuration
11
14
12
15
Configuration can be updated through:
13
16
14
17
1.**Cloud Function**: `updateConfig` Particle function
15
-
-copy the intended config.json and paste it as and argument into updateConfig
16
-
-If successful, the device will restart without returning any value.
17
-
-verify that the first metadata packet after reset matches your configuration
18
-
-See below for other types of responses.
18
+
-Configuration is always saved to EEPROM backup for reliability
19
+
-SD card is updated when possible, but function succeeds if EEPROM update works
20
+
-Device will restart automatically on successful configuration update
21
+
-Verify success by checking metadata packet includes new configuration UIDs
19
22
3.**SD Card**: Replace `config.json` file and restart system
20
23
21
24
#### updateConfig Function Details
@@ -50,15 +53,12 @@ The function returns specific error codes when configuration updates fail:
50
53
51
54
| Error Code | Description | Troubleshooting |
52
55
|------------|-------------|-----------------|
53
-
|`0`| Success - Configuration removed from SD card ||
54
-
|`1`| Success - Configuration updated, system restarting ||
55
-
|`-1`| Failed to remove configuration from SD card ||
56
-
|`-2`| Invalid configuration format - Missing 'config' element ||
57
-
|`-3`| Invalid configuration format - Missing 'system' element ||
58
-
|`-4`| Invalid configuration format - Missing 'sensors' element ||
59
-
|`-5`| Failed to write test file to SD card ||
60
-
|`-6`| Failed to remove current configuration from SD card ||
61
-
|`-7`| Failed to write new configuration to SD card ||
56
+
|`0`| Success - Configuration removed from SD card and EEPROM ||
57
+
|`1`| Success - Configuration updated and saved to EEPROM, system restarting | May show SD card warnings but still succeeds |
58
+
|`-2`| Invalid configuration format - Missing 'config' element | Check JSON structure |
59
+
|`-3`| Invalid configuration format - Missing 'system' element | Ensure 'system' section exists |
60
+
|`-4`| Invalid configuration format - Missing 'sensors' element | Ensure 'sensors' section exists |
61
+
|`-8`| Failed to parse configuration - Invalid JSON or values | Check JSON syntax and parameter ranges |
62
62
63
63
##### Configuration Validation Rules
64
64
@@ -70,13 +70,14 @@ The system performs several validation checks:
70
70
- Must contain "sensors" section within config (checked by string search)
71
71
- All whitespace, newlines, carriage returns, and tabs are automatically stripped
72
72
73
-
2.**SD Card Validation**
74
-
- SD card must be accessible for writing
75
-
- System tests write capability before attempting configuration update
76
-
- Current configuration must be removable before writing new configuration
73
+
2.**Configuration Processing**
74
+
- Configuration is parsed and applied first (automatically saves to EEPROM backup)
75
+
- SD card is updated when possible, but failures don't prevent success
76
+
- System succeeds if configuration parsing works, regardless of SD card status
77
+
- Warning messages indicate SD card issues but don't cause operation failure
77
78
78
79
3.**Special Commands**
79
-
- Use "remove" as the configuration string to delete config.json and revert to defaults
80
+
- Use "remove" as the configuration string to delete config.json and clear EEPROM backup
0 commit comments