This topic will be my findings on the ease/difficulty of adapting the OpenAg-UI for use by the MVP (Minimal Viable Product). The MVP is a simplified food computer (~$300) based on a Raspberry Pi brain running Python code. The latest version has been written to log data to CouchDB. The hope is that since both the MVP and PFC are using CouchDB, that the UI could be modified to work for both.
Initial impressions are that this will work, in spite of the data differences. While the UI is a large collection of Java Script (built on Node), most of the js is low level functions. It appears to be abstract enough that the key differences are in the /home/pi/openag_ui/dist/openagconfig.json file. This file, and views created in CouchDB appear to be sufficient to hide the MVP differences.
The UI can run as a service within CouchDB, so that each individual MVP could have its own unique set of charts.
At this time the MVP has two differences from the PFC.
1) Data is stored in a table named: mvp_sensor_data (instead of environmental_data)
2) The data file has more attributes, and each value reading is a separate record:
* timestamp (GMT)
* object_name (unique identifier, meaningful or meaningless; ie. "si7021-Top")
* status (default = "Success")
* attribute (temperature, humidity, ...)
* value (as string)
These posts will record what it takes to customize the OpenAg-UI. Initial impressions that this will require:
1) Creating the environment database within CouchDB to match the PFC
2) Build a set of views in mvp_sensor_data with functionality similar to the PFC
3) Modify openagconfig.json
- Change: environmental_data_point (point to mvp_sensor_data database and views)
- Change: chart - create new charts for MVP needs (variables)
Much of what appears in openagconfig.json is also in main.js. I suspect that the build routine moves one to the other (likely json to js); as the process seems to be a building of the dist, then importing the dist into CouchDB to make it a service.