Skip to content

Releases: hmckay20/Pig_Team_API

Final Release

Choose a tag to compare

@adahlman2 adahlman2 released this 11 May 03:18
fe584f2

Project Vision:

Our vision for the Swine Monitoring System is to complete a cost-effective system for animal farms, running on a resource-efficient Linux-based platform. It includes a Python-based image capture program, a robust data communication module, and interactive APIs which optimize intra-system communication.

Overview:

This is the final release of the API. This release has been cleaned and prepared for the sponsors.

Release 5

Choose a tag to compare

@adahlman2 adahlman2 released this 03 May 20:48

Project Vision:

Our vision for the Swine Monitoring System is to complete a cost-effective system for animal farms, running on a resource-efficient Linux-based platform. It includes a Python-based image capture program, a robust data communication module, and interactive APIs which optimize intra-system communication.

Overview:

This release of the Biological Systems Engineering team includes major updates to the File Upload API and API Python script (API_Python.py found in the PythonScript folder). The SendLogToServer API is also included in this release, which was requested by sponsors after Release 4.1. These new and updated features are detailed below. The APIs use the Laravel framework, PHP, and Python scripts to take data, system information, and communications logs from the communications hub and securely send it across to the main server.

Deliverables:

Our deliverables include the following:

SendLogToServer API:
This API is used to take the data_sent_log table on local machines and send that to the server. The data_sent_log works with the File Upload API to ensure that maintainers of the system and the API know when a day's data has been successfully updated to the server.

API Python Script:
Additionally, the Python script which runs these APIs on a timer has been updated. The bulk of these updates includes validation and checking logic for the File Upload API. In previous releases, this logic was located in the .php side of the API. The script now uses date from the local feeder_data_new table to create a .zip file, and passes that file into the File Upload API, which then updates the server data. An significant amount of logic ensures that no data is transmitted out of order. If it is found that the server has not received data from a previous date, the script will retrieve that days data and populate the server with it before continuing to the current date. This is done recursively, so if data has not been updated for multiple days, the script will find the most recent day and then populate all days sequentially until reaching the present day. Other cases are handles as well, including some of the following:

  • This is the first time running the script with a new system or data_sent_log table
  • Connection to the server cannot be made
  • Server is down for a period of time
  • Server is down, and then comes up again (including if this sequence happens multiple times)
  • A gap in data on the server exists
  • Local/server data_sent_log table finds that no records have ever been updated
  • A connection to the server fails to be made

If a connection to the server fails, the script will retry in thirty (30) minute intervals, until it fails for the fifth time. Afterwards, it shall try again. If this is the case, the data is still updated if a connection to the server is made again.

Additionally, if the data_sent_log table is empty (which could happen when setting it up for the first time), then the script may prompt the user to enter a date, and then will proceed to update the server from that date on forward.

File Upload API:
The size of the API has been significantly reduced by including fault management, validation, and error handling logic in the API Python script instead. This API is now responsible for updating the server's feeder_data_new table based on the local feeder_data_new information. The API takes in a .zip file of data in the form of SQL statements, sends the data to the server's feeder_data_new_incremental table, and then uses that table to update the server's feeder_data_new table.

Release 4.1

Choose a tag to compare

@adahlman2 adahlman2 released this 29 Apr 03:41

Project Vision:

Our vision for the Swine Monitoring System is to complete a cost-effective system for animal farms, running on a resource-efficient Linux-based platform. It includes a Python-based image capture program, a robust data communication module, and interactive APIs which optimize intra-system communication.

Overview:

This release of the Biological Systems Engineering team includes updates to previous APIs based on sponsor feedback. The Hourly Status API, Capture Status API, Communications Log API, and File Upload API are all included in this release. The File Upload API is a new API that has been developed since Release 3, and shall be detailed below. These APIs use the Laravel framework, PHP, and Python scripts to take data, system information, and communications logs from the communications hub and securely send it across to the main server.

Deliverables:

Our deliverables include the following:

Hourly Status API:
No updates have been made the Hourly Status logic since last release.

Capture Status API:
This API now should correctly send data to the server in the expected format.

Log API:
This API now should correctly send data to the server in the expected format.

File Upload API:
This API is used to incrementally send data from the local system to the server, so that the feeder_data_new table can be populated with new data collected from the previous day. This API, when ran, uses the feeder_data_new_incremental table to populate the feeder_data_new table from the server, update the feeder_data_ids table with the respective information based on data collected that day, and then update the data_sent_log table, which tracks whether data from each day has been sent to the server or not. Data validation techniques are included, such as validation to ensure that there is new data to be submitted, checks to ensure that the data is the data in the local feeder_data_new table, and a validation that checks if the feeder_data_new_incremental table is empty, and if so, it populates the table with the data that it should have based on the data collected that day and stored locally in the feeder_data_new table.

API Python Script:
Additionally, a Python script which runs these APIs on a timer is used to control when they are to run.

Release 3

Choose a tag to compare

@adahlman2 adahlman2 released this 21 Mar 20:09

Project Vision:

Our vision for the Swine Monitoring System is to complete a cost-effective system for animal farms, running on a resource-efficient Linux-based platform. It includes a Python-based image capture program, a robust data communication module, and interactive APIs which optimize intra-system communication.

Overview:

This release of the Biological Systems Engineering team includes three different APIs designed to communicate between different parts of the swine monitoring system, mainly between the communications hub and the server. These APIs use the Laravel framework, PHP, and Python scripts to take data, system information, and communications logs from the communications hub and securely send it across to the main server.

Deliverables:

Our deliverables include the following:

Hourly_ Status API:
This Hourly Status API shall run every hour, and delivers system information to the server. This information includes a timestamp, the total RFID reads of the day, the number of reads for every reader, memory usage, storage usage, and finally disk station use.

Capture Status API:
The Capture Status API takes a .zip file and moves the components to a disk station.

Log API:
The Log API takes a .zip file with a log file inside and sends the communications.log file to the server.