Campaign Timing
# Campaign Timing Campaign times vary depending on how they are scheduled and their protocol type. Using the anchors on the right, skip to the section based on the protocol a device is using. ## Campaign time windows for OMA-DM FOTA devices (V1 API) The ThingSpace Schedule Campaign API allows the user to schedule an "on-demand" update or for a day in the future. On-demand campaigns usually commence within 90 minutes of when they are scheduled, to allow all the pre-validation checks to occur. At that point the campaign is changed to “In progress” status. The OMA-DM server batches campaigns and sends “push notifications” out to devices at 1 am, 5 am, 9 am, 1 pm, 5 pm, 9 pm Eastern Time. Assuming the device is powered and connected to the network when “campaign begins”, the device should begin applying the firmware update immediately. If the device is not powered on or connected to the network, the device will be notified whenever it connects to the network. The next time the device connects, it will be notified for upgrade and the campaign will begin. If that campaign fails, it will be queued up again indefinitely. Use the [Get Device information API](https://thingspace.verizon.com/documentation/api-documentation.html#/http/premium-apis/software-management/software-management-v1/api-reference-v1/get-the-device-information-list) to monitor the specific reported firmware version on a device or the [List Firmware Upgrade Details API](https://thingspace.verizon.com/documentation/api-documentation.html#/http/premium-apis/software-management/software-management-v1/api-reference-v1/get-device-firmware-upgrade-history) throughout the campaign lifecycle (start date to end date). ## Campaign time windows for HTTP(S) FOTA devices (V2 API) Devices using HTTP(S) for FOTA device management do not respond to “push” messages to start a campaign, but rather, devices check-in during periodic intervals as specified by the device OEM. To accommodate a campaign with variable start times, the Schedule Campaign API requires a start and end date. For example, the start date could be on a Sunday at 12:00 AM UTC and the end date could be on a Saturday at 11:59:59 PM UTC. When the device checks-in during that window, it will download and apply any new eligible firmware/software updates available. A set of optional parameters allow you to specify more discrete times within the start and end dates in the event that the device should only receive the update during those times. For example, if the device is a smart light that should not be updated during the evening, a time window can specify not only that the campaign runs from Sunday-Saturday, but that it must only happen during the late morning hours. The Schedule Campaign API also offers an optional parameter that allows you to specify a discrete time window when the device should download the update, and a different time window when the device should apply the update. This is dependent on device support of this feature. ## Campaign times for LWM2M FOTA devices (V3 API) Using the ThingSpace Software Management V3 FOTA API is an entirely different scheduling experience for LWM2M. Firmware update time considers user input, device availability, network availability and retry attempts. Like the V1 and V2 API’s, the campaign requires a list of devices and target firmware. The V3 API requires an end date. It also allows for time-windows in case the application should only be upgraded a particular time of day (for example in the morning, afternoon, evening, etc) The ThingSpace Create Campaign API allows the user to schedule an "on-demand" update or a day in the future. On-demand updates usually occur within 30 minutes once they are scheduled, to allow all the pre-validation checks to occur. An example schedule for a LWM2M on-demand campaign Once the campaign is scheduled, the devices will receive a push notification. ThingSpace will check the reachability periodically, report them through ThingSpace and attempt to update the device as soon as it connects to the network. The ThingSpace portal utilizes the V3 APIs to schedule LWM2M campaigns. V1 and V3 campaigns can both be monitored in the portal. A set of optional parameters allow you to specify more discrete times within the start and end dates in the event that the device should only receive the update during those times. For example, if the device is a smart light that should not be updated during the evening, a time window can specify not only that the campaign runs from Sunday-Saturday, but that it must only happen during the late morning hours. Refer to the [Get Device Status in a Campaign | ThingSpace (verizon.com)](/docs/premium-apis/software-management/software-management-v2/api-endpoints/software-management-reports-v2/getcampaigndevicestatus) to get specific status including the next attempt projected timing.