- Update Pi remotely
- Connects to AWS IoT
- Update locally
- Add components
- 7 days of historical data
- Interfaces are built to describe basic functionality
- Separate interface implementations are written for local vs remote interaction
- Two artifacts are built, one with remote classes and the other with local classes
- Tables between remote and local need to by synced, don't know how to do this yet.
- SerialRepository needs to add entries into the serial table in order to attach components
- CoopStateProvider needs to fetch from a local source instead of AWS IoT
Database updates dont remotely are sent in a topic and the same change is mirrored locally. All config is derived via the database, both remotely and locally. When opting into a premium subscription, local data can be synced to the remote server through the usage of presigned s3 urls: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html
Premium Data Flow
-
User creates an entity remotely (e.g. component, configuration, etc)
-
Remote server saves it to MySQL
-
Remote server pushes it to Pi
-
Pi saves it to MySQl
-
Pi collects metric data
-
Pi saves it to MySQL
-
Pi checks it if has a connection to remote
-
Pi pushes it remotely
-
Remote saves it to MySQL
Free Data Flow
-
User creates an entity locally (e.g. component, configuration, etc)
-
Pi saves it to MySQL
-
Pi collects metric data
-
Pi saves it to MySQL
-
Pi checks if it has a connection to remote
-
Pi does nothing
Free to Premium Data Flow
- User opts into premium service
- Pi is granted access to subscribe to MQTT
- Pi asks for an updates
- Pi is given a presigned S3 URL
- Pi dumps all local information to the presigned S3 URL
- Pi tells remote that it's finished syncing
- Remote synces the presigned S3 url to MySQL
- Sync is finished