Configuration Provisioning
Configuration Provisioning enables SmartReader to automatically check for and download configuration updates from a cloud-based provisioning service. This feature allows centralized management of reader configurations, making it easier to deploy and update settings across multiple readers.
Overview
Configuration Provisioning provides:
Automatic Updates: Periodically checks for configuration updates from a provisioning endpoint
Version Management: Compares local and cloud configuration versions to determine if updates are needed
Centralized Management: Manage reader configurations from a single cloud service
Manual Triggers: Manually trigger provisioning checks via REST API
Status Monitoring: Track provisioning status and last check results
How It Works
Background Service: A background service periodically checks the provisioning endpoint for updates
Version Comparison: The service compares the cloud configuration version with the local version
Automatic Update: If a newer version is available, it downloads and applies the configuration
Configuration Reload: The new configuration is saved and the application reloads it
Configuration
Configuration Provisioning is configured in appsettings.json under the Provisioning section:
Configuration Settings
Enabled
boolean
Enable or disable configuration provisioning
false
EndpointUrl
string
URL of the provisioning endpoint
Required
CheckIntervalHours
integer
Hours between automatic checks
24
ApiKey
string
API key for authenticating with provisioning service
Optional
Provisioning Endpoint Requirements
The provisioning endpoint must:
Accept GET requests with a
serialquery parameter containing the reader serial numberReturn JSON configuration in the format expected by SmartReader
Include a
versionfield in the response for version comparisonSupport authentication via API key (if configured)
Example Request:
Example Response:
Manual Provisioning Check
You can manually trigger a provisioning check using the REST API:
Response:
updated: trueindicates that a new configuration was downloaded and appliedupdated: falseindicates that no update was available or the check failed
Provisioning Status
Check the current provisioning status:
Response:
Status Fields
enabled: Whether provisioning is enabled
lastCheckTime: ISO 8601 timestamp of the last check
lastCheckResult: Result of the last check (
Success,Failed, orNoUpdate)localVersion: Current local configuration version
cloudVersion: Latest version available from the cloud
readerSerial: Reader serial number used for provisioning
errorMessage: Error message if the last check failed
Version Comparison
The provisioning service uses semantic versioning to compare configurations. A version is considered newer if:
It has a higher major version number
It has the same major version but a higher minor version
It has the same major and minor versions but a higher patch version
Examples:
1.2.3is newer than1.2.21.3.0is newer than1.2.92.0.0is newer than1.9.9
Automatic Checks
When enabled, the provisioning service automatically checks for updates:
Initial Check: Performed 1 minute after application startup
Periodic Checks: Performed at the interval specified by
CheckIntervalHoursBackground Processing: Checks run in the background without blocking the application
Configuration Update Process
When a newer configuration is found:
The service downloads the configuration from the provisioning endpoint
The configuration is validated
The configuration is saved to
/customer/config/smartreader.jsonThe configuration service reloads the new settings
The configuration is persisted to the database
The application continues running with the new configuration
Note: Configuration updates do not require an application restart. The new configuration is applied immediately.
Reader Serial Number
The provisioning service uses the reader's serial number to identify which configuration to retrieve. The serial number is:
Retrieved from the reader's system configuration
Included as a query parameter in provisioning requests
Used by the provisioning service to return reader-specific configurations
You can retrieve the reader serial number via the provisioning API:
Response:
Error Handling
The provisioning service handles errors gracefully:
Network Errors: Logged and reported in status, but don't stop the service
Invalid Configuration: Validation errors prevent configuration updates
Missing Serial: Provisioning checks are skipped if serial number is unavailable
Service Unavailable: Errors are logged and the service continues to run
Security Considerations
API Key: Use secure API keys for authentication with the provisioning service
HTTPS: Always use HTTPS for provisioning endpoints
Certificate Validation: Ensure proper SSL/TLS certificate validation
Network Security: Use secure networks or VPNs for provisioning connections
Access Control: Restrict access to provisioning endpoints
Best Practices
Enable Only When Needed: Keep provisioning disabled if not using a provisioning service
Set Appropriate Intervals: Balance update frequency with network usage
Monitor Status: Regularly check provisioning status to ensure updates are working
Version Management: Use semantic versioning for configuration versions
Test Before Production: Test provisioning updates in a development environment first
Backup Configurations: Keep backups of working configurations
Log Monitoring: Monitor provisioning logs for errors or issues
Troubleshooting
Provisioning Not Working
Check if Enabled: Verify
Provisioning:Enabledis set totrueVerify Endpoint URL: Ensure the endpoint URL is correct and accessible
Check Serial Number: Verify the reader serial number is available
Review Logs: Check application logs for provisioning errors
Test Manually: Use the manual check endpoint to test provisioning
Configuration Not Updating
Check Versions: Verify the cloud version is newer than the local version
Check Status: Review provisioning status for error messages
Validate Configuration: Ensure the cloud configuration is valid JSON
Check Permissions: Verify file system permissions for configuration directory
Network Issues
Test Connectivity: Verify network connectivity to the provisioning endpoint
Check Firewall: Ensure firewall rules allow outbound HTTPS connections
Verify Proxy: If using a proxy, ensure it's configured correctly
Check DNS: Verify DNS resolution for the provisioning endpoint
API Reference
For complete API documentation, including all endpoints, request/response formats, and error codes, see the REST API documentation.
Related Features
Configuration Overrides - Manual configuration management
Backup/Restore - Configuration backup and restore
REST API - Complete API reference for provisioning endpoints
Last updated