CXSMW Command — SMS White List
Enables or disables incoming SMS filtering through a whitelist of authorized phone numbers.
What is it for?
🔐 Main use cases:
- 🛡️ Protect device against unauthorized SMS commands
- 📱 Restrict control to specific numbers
- 🏢 Centralized fleet control
- 🔒 Security in production environments
When the White List is enabled, only SMS from numbers registered in destinations SM0-SM4 will be processed.
Features
| Feature | Value |
|---|---|
| States | 0 = Disabled, 1 = Enabled |
| Number list | SM0 - SM4 (5 numbers maximum) |
| Persistence | NVS (survives reboots) |
| Available since | Firmware v1.9.08 |
Commands
| Operation | Syntax | Description |
|---|---|---|
| Configure | SCXSMWE | Enables/disables White List |
| Query | SCXSMW | Reads current state |
| Response | RCXSMWE | Confirmation with state |
Parameters
| Parameter | Description | Values |
|---|---|---|
E | White List state | 0 = Disabled, 1 = Enabled |
Examples
Enable White List
>SCXSMW1<
// Response: RCXSMW1
// Device will only accept SMS from numbers in SM0-SM4Disable White List
>SCXSMW0<
// Response: RCXSMW0
// Device will accept SMS from any numberQuery state
>SCXSMW<
// Response: RCXSMW1 (enabled) or RCXSMW0 (disabled)Authorized Numbers Configuration
The White List uses numbers configured in SMS destinations (SM0-SM4):
// Configure authorized numbers
>SSM0+5491112345678< // Number 1: Monitoring center
>SSM1+5491187654321< // Number 2: Supervisor
// Verify configuration
>QSM0<
// Response: RSM0+5491112345678
// Clear number (send empty)
>SSM2<
// Response: RSM2Available indexes
| Index | NVS Key | Recommended use |
|---|---|---|
| SM0 | SMS0 | Monitoring center |
| SM1 | SMS1 | Main supervisor |
| SM2 | SMS2 | Secondary supervisor |
| SM3 | SMS3 | Emergency |
| SM4 | SMS4 | Backup |
Internal Operation
When an SMS arrives and the White List is enabled:
QPW Exception: If the SMS doesn’t come from an authorized number but the first command is >QPW... (password), the SMS will still be processed. This allows access recovery in case of losing authorized numbers.
Partial matching
Validation uses substring search (strstr), allowing partial matches:
| Number in SM0 | SMS from | Result |
|---|---|---|
12345678 | +5491112345678 | ✅ MATCH |
12345678 | +5491198765432 | ❌ NO MATCH |
It’s recommended to use complete international format with country code for better precision and avoid false positives.
Use Cases
Fleet with centralized control
// 1. Configure monitoring center number
>SSM0+5491140001234<
// 2. Configure supervisor number
>SSM1+5491140005678<
// 3. Enable White List
>SCXSMW1<
// Result: Only the center and supervisor can send SMS commandsTemporarily disable for diagnostics
// Disable for testing
>SCXSMW0<
// Perform tests from any number...
// Re-enable
>SCXSMW1<Verify complete configuration
// Verify White List state
>SCXSMW<
// Response: RCXSMW1
// Verify authorized numbers
>QSM0<
// Response: RSM0+5491140001234
>QSM1<
// Response: RSM1+5491140005678
>QSM2<
// Response: RSM2 (empty)Security Considerations
Recommendations
| Recommendation | Description |
|---|---|
| ✅ Enable in production | Protects against unauthorized SMS commands |
| ✅ Use international format | Include country code to avoid false positives |
| ✅ Verify numbers | Before enabling, confirm SM0-SM4 |
| ✅ Configuration backup | Numbers are stored in NVS |
Potential risks
| Risk | Mitigation |
|---|---|
| Empty White List | No SMS will be processed if enabled without numbers |
| Incorrect numbers | Verify with QSM before enabling |
| False partial match | Use complete numbers with country code |
Important! If you enable the White List without configured numbers, no SMS will be processed.
Troubleshooting
| Problem | Probable cause | Solution |
|---|---|---|
| SMS not processed | White List enabled without numbers | Add numbers to SM0-SM4 or disable with >SCXSMW0< |
| SMS ignored from known number | Different number format | Verify exact format with >QSMx< |
| Responses don’t arrive | Incorrect SMS destination | Configure SM0-SM4 correctly |
Compatibility
See Also
- SM Command — SMS destinations configuration
- CXSMS Command — SMS retry configuration