Let me clarify the complete OTA job triggering mechanism in wiot-ea, as there are three components that must align correctly.
OTA Job Mapping Configuration:
Your event filter needs to match not just the event name but also include the version field mapping. Update your job mapping configuration:
{
"eventFilter": "event == 'firmware_available'",
"versionMapping": "version",
"deviceIdMapping": "deviceId"
}
The versionMapping tells the OTA system which field in your event contains the firmware version to execute. Without this, the system can’t match the event to the correct job template.
Event Filter Configuration:
In wiot-ea, event filters support advanced matching. Your current filter might be too simple. Use this enhanced filter:
event == "firmware_available" AND version EXISTS AND deviceId EXISTS
This ensures all required fields are present before attempting job execution.
Device Permissions:
You need both permissions enabled at the device type level:
- OTA Operations: Allows devices to receive firmware update commands
- OTA Execution: Allows device events to trigger automatic job execution
The key distinction: OTA Operations is for passive updates (platform-initiated), while OTA Execution is for active updates (device-initiated). Enable both in Device Type Settings → Permissions → Firmware Management.
Additionally, there’s a manual refresh workaround if you need immediate execution: After the device event arrives, go to the OTA dashboard, select your job template, and click “Refresh Targets”. This forces the system to re-evaluate which devices should receive the update based on recent events. This is useful for debugging but shouldn’t be necessary once the automatic triggering is configured correctly.
After enabling OTA Execution permission and updating your event filter with version mapping, restart the OTA service (Dashboard → Services → OTA Manager → Restart). Then send a new firmware_available event from your device and monitor the job execution logs for successful triggering.