Migration Guide — From 0.20.x to 0.21.03¶
This guide explains how to migrate existing applications from DaaS-IoT 0.20.x to version 0.21.03.
The focus is on concrete code-level changes, based on real examples, and on behavioral differences that directly affect application logic.
Overview¶
Version 0.21.03 introduces several breaking changes affecting:
- Event handler interfaces
- DDO construction and handling
- Identifier and timestamp management
- Runtime responsibilities
Applications built for 0.20.x must be adapted to function correctly on 0.21.03.
1. Event Handler API Changes¶
What Changed¶
Event callback method names have been standardized.
Before (0.20.x)¶
def dinAcceptedEvent(self, din):
...
def ddoReceivedEvent(self, payload_size, typeset, din):
...
After (0.21.03)¶
def dinAccepted(self, din):
...
def ddoReceived(self, payload_size, typeset, din):
...
Impact¶
- Old handler method names are no longer invoked
- Applications must rename event callbacks to match the new API
2. DDO Origin and Timestamp Handling¶
What Changed¶
In version 0.21.03:
- DDO origin is automatically assigned by the runtime
- Applications can no longer manually set the origin or timestamp
Before (0.20.x)¶
ddo = pydaasiot.DDO()
ddo.setOrigin(origin_din)
ddo.setTypeset(typeset)
After (0.21.03)¶
ddo = pydaasiot.DDO()
ddo.setTypeset(typeset)
Impact¶
- Calls to
setOrigin()must be removed - Timestamp handling is no longer exposed at application level
- This guarantees consistency with synchronization and routing
3. Payload Handling Changes¶
What Changed¶
Payload extraction is now handled through the runtime rather than directly through the DDO object.
Before (0.20.x)¶
raw = ddo.payload_text()
After (0.21.03)¶
payload = node.ddoPayloadAsString(ddo)
Impact¶
- Direct payload access methods on the DDO object should no longer be used
- Runtime-managed access ensures safe decoding and consistency
4. Node Initialization and Configuration¶
What Changed¶
- Configuration files are now optional
- Nodes can be initialized with minimal parameters
Before (0.20.x)¶
node = pydaasiot.DaasWrapper(config_path, handler)
After (0.21.03)¶
node = pydaasiot.DaasWrapper(None, handler)
Impact¶
- Existing configuration files may need to be reviewed
- Applications relying on stored configuration must verify compatibility
5. DDO Construction and Sending¶
What Stayed the Same¶
The basic workflow for sending a DDO remains unchanged:
ddo = pydaasiot.DDO()
ddo.setTypeset(typeset)
ddo.allocatePayload(len(payload))
ddo.appendPayloadData(payload)
node.push(target_din, ddo)
What Changed¶
- No origin or timestamp assignment
- Payload-less DDOs are now supported
6. Runtime Execution Model¶
What Stayed the Same¶
The core execution model remains:
node.doPerform(pydaasiot.performs_mode_t.PERFORM_CORE_THREAD)
New Considerations¶
- Synchronization is now mandatory before bidirectional communication
- Some operations (e.g. locate) require active core execution
Applications using a threadless core must ensure periodic execution.
7. Known Migration Pitfalls¶
-
Old event names not triggered
Ensure all event callbacks use the updated naming. -
Manual origin or timestamp assignment
These calls must be removed. -
Self-targeted messaging
Sending DDOs to the local node DIN is not supported in 0.21.03. -
Discovery timing on low-end devices
Initial discovery may require retries.
Summary Checklist¶
Before running on 0.21.03, verify that your application:
- Uses updated event handler method names
- Does not manually set DDO origin or timestamp
- Uses runtime helpers for payload extraction
- Handles mandatory synchronization implicitly
- Does not rely on self-targeted messaging
Warning
This migration is mandatory. Applications built for 0.20.x will not work correctly on version 0.21.03 without the changes described above.