Repository navigation
3.10.0
Changed
- History over local connections. For a TimeGraph, EventLog or Map with
storage_enable(), the device now only answers history requests that come from the Dash server. The Dash server is the app's source of truth for that history: answered over TCP, the app took the device's history as complete and didn't fetch older data from the server. Live updates still go to every connection. deviceSetupin the CFG now lists the device's connections (TCPfor a TCPConnection,MQTTfor a DashConnection,BLE), then the settings the Dash app can change. The options are upper case, as the app writes them, and the Dash login option isDASH(wasdashio). Adding a connection changes the CFG, so work out cfgRev fromget_cfg_hash()after adding the device's connections. The examples do this; expect cfgRev to go up once on their next start.- DashConnection reconnects with a growing wait after a refused login, up to 15 minutes, and doesn't try to connect without a username and password. Before, it retried about every second.
New
DashStore: local storage, and store and forward to the Dash server.Device(..., store=dashio.DashStore("device.db"))keeps the data of the device's TimeGraph, EventLog and Map controls in an sqlite database, with limits on the number of entries and their age. History requests are answered from it, including data from before a restart. When the device connects to the Dash server, it sends the server the data it missed, with the DashIO firmware's store and forward (SDU) protocol.- Devices that only connect now and then, e.g. on LTE to save power:
DashConnection(auto_connect=False),connect()anddisconnect(). During a planned disconnect, device messages are dropped rather than sent as a backlog when the connection is made; requests to the server, such as STE, are kept.device.set_store_sync_callback()is called when each sync with the Dash server ends, so the device can disconnect.device.store_and_forward = Truelets the Dash app turn on store and forward (SAF) for the device on the Dash server.
dashio.CaptionModeanddashio.DeviceViewStyleare exported.
Examples
Examples/intermittent_connection.py: a data logger that connects to the Dash server on a schedule and disconnects when its store has synced. The Dash app provisions it over TCP on the local network: its name, the Dash login, and the connection and record intervals.- The greenhouse keeps its history in a DashStore (
greenhouse.db).
See Documentation.md, in particular Local Storage.