Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Slider0007 committed Oct 23, 2024
1 parent 39f7fe2 commit 30132a4
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 24 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AI-on-the-Edge device [SL Fork]
# AI-on-the-Edge Device [SLFork]
<img src="images/icon/watermeter.svg" width="80px">

Artificial intelligence is everywhere, from speech to image recognition. While most AI systems rely on powerful processors or cloud computing, **edge computing** brings AI closer to the end user by utilizing the capabilities of modern processors.
Expand Down Expand Up @@ -64,6 +64,8 @@ There are multiple options to install the firmware and the SD card content.
Officially released firmware packages can be downloaded from [releases](https://github.com/slider0007/AI-on-the-edge-device/releases) page.<br>
A possibly already available development version (upcoming release version) can be previewed [here](https://github.com/Slider0007/AI-on-the-edge-device/pulls?q=is%3Aopen+is%3Apr+label%3A%22autorelease%3A+pending%22).

⚠️ **Please do not use the source files directly from the repository, not even for the preparation of the SD card!** Use only files related to the download sources mentioned here (official precompiled release packages or test versions). Otherwise, full functionality cannot be guaranteed.<br>

### Option 1: Web Installer (Only For Released Versions)

Follow the instructions listed at [Web Installer](https://slider0007.github.io/AI-on-the-edge-device/) page.<br>
Expand Down
4 changes: 2 additions & 2 deletions docs/API/REST/process_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ The following data are available:
| `timestamp_processed` | Sequence name + Timestamp of last processed cycle per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible<br>- Time of image taken | `main`: `2024-02-02T11:01:29+0100`
| `timestamp_fallbackvalue` | Sequence name + Timestamp of fallback value per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible<br>- Time of image taken | `main`: `2024-02-02T11:01:29+0100`
| `actual_value` | Actual value per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible | `main`:`146.540`
| `fallback_value` | Fallback value<br>(Latest valid result) per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible <br>- Possible special states:<br>`Deactivated`: No fallback value usage <br>`Outdated`: Fallback value too old <br>`Not Determinable`: Age of value not determinable | `main`:`146.540`
| `fallback_value` | Fallback value (last valid result) per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible <br>- Possible special states:<br>`Deactivated`: No fallback value usage <br>`Outdated`: Fallback value too old <br>`Not Determinable`: Age of value not determinable | `main`:`146.540`
| `raw_value` | Raw value <br>(Value before any post-processing) per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible | `main`:`146.539`
| `value_status` | Value Status per sequence<br><br>Notes:<br>- Output of multiple sequences possible <br>- Possible states:<br>`000 Valid`: Valid, no deviation <br>`W01 W01 Empty data`: No data available <br>`E90 No data to substitute N`: No valid data to substitude N's (only class-11 models) <br>`E91 Rate negative`: Small negative rate, use fallback value as actual value (info) <br>`E92 Rate too high (<)`: Negative rate larger than specified max rate (error) <br>`E93 Rate too high (>)`: Positive rate larger than specified max rate (error) | `main`:`000 Valid`
| `value_status` | Value Status per sequence<br><br>Notes:<br>- Output of multiple sequences possible <br>- Possible states:<br>`000 Valid`: Valid, no deviation <br>`W01 Empty data`: No data available <br>`E90 No data to substitute N`: No valid data to substitude N's (only class-11 models) <br>`E91 Rate negative`: Small negative rate, use fallback value as actual value (info) <br>`E92 Rate too high (<)`: Negative rate larger than specified max rate (error) <br>`E93 Rate too high (>)`: Positive rate larger than specified max rate (error) | `main`:`000 Valid`
| `rate_per_minute` | Rate per minute per sequence<br>(Delta between actual and last valid processed value (Fallback Value) + additionally normalized to a minute)<br><br>Notes:<br>- Tab separated listing<br>- Output of multiple sequences possible | `main`:`0.0000`
| `rate_per_interval` | Rate per interval per serquence<br>(Delta between actual and last valid processed value (Fallback Value))<br><br>Notes:<br>- Output of multiple sequences possible | `main`:`0.0000`
| `process_status` | Process Status<br><br>Possible States:<br>- `Processing (Automatic)`: Timer-controlled automatic processing<br>- `Processing (Triggered Only)`: Manual triggered processing only<br>- `Not Processing / Not Ready`: Initializing / Initialization failed | `Processing (Automatic)`
Expand Down
52 changes: 32 additions & 20 deletions docs/API/Webhook/_OVERVIEW.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## Overview: Webhook API
### Event-driven push service to an HTTP / HTTPS URL endpoint
### Data push service to a webhook

Number sequence results and related camera image are pushed to an HTTP / HTTPS URL endpoint.
Number sequence data / results and related camera image are pushed to a HTTP / HTTPS URL endpoint.

### Message typtes
### Message types
#### 1. Data message

Provides process related actual data and results in JSON syntax.
Provides number sequence related actual data and results in JSON syntax.

HTTP message configuration:
- URL: Content of parameter `URI`
Expand All @@ -19,15 +19,15 @@ The following data are published:

| JSON Property | Description | Output
|:-------------------------------------|:---------------------------------------------------|:-----------------------
| `time_processed_utc` | Timestamp of last processed cycle<br><br>Notes:<br>- Output of multiple sequences possible<br>- Time of image taken (UTC) | `1729341437`
| `timestamp_processed` | Timestamp of last processed cycle per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible<br>- Time of image taken (incl. timezone) | `2024-10-19T14:37:17+0200`
| `time_processed_utc` | Timestamp of last processed cycle<br><br>Notes:<br>- Time of image taken (UTC) | `1729341437`
| `timestamp_processed` | Timestamp of last processed cycle<br><br>Notes:<br>- Time of image taken (incl. timezone) | `2024-10-19T14:37:17+0200`
| `sequence_name` | Sequence Name | `main`
| `value_status` | Value Status per sequence<br><br>Notes:<br>- Output of multiple sequences possible <br>- Possible states:<br>`000 Valid`: Valid, no deviation <br>`W01 W01 Empty data`: No data available <br>`E90 No data to substitute N`: No valid data to substitude N's (only class-11 models) <br>`E91 Rate negative`: Small negative rate, use fallback value as actual value (info) <br>`E92 Rate too high (<)`: Negative rate larger than specified max rate (error) <br>`E93 Rate too high (>)`: Positive rate larger than specified max rate (error) | `000 Valid`
| `actual_value` | Actual value per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible | `146.540`
| `fallback_value` | Fallback value<br>(Latest valid result) per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible <br>- Possible special states:<br>`Deactivated`: No fallback value usage <br>`Outdated`: Fallback value too old <br>`Not Determinable`: Age of value not determinable | `146.540`
| `raw_value` | Raw value <br>(Value before any post-processing) per seqeunce<br><br>Notes:<br>- Output of multiple sequences possible | `146.539`
| `rate_per_minute` | Rate per minute per sequence<br>(Delta between actual and last valid processed value (Fallback Value) + additionally normalized to a minute)<br><br>Notes:<br>- Tab separated listing<br>- Output of multiple sequences possible | `0.0000`
| `rate_per_interval` | Rate per interval per serquence<br>(Delta between actual and last valid processed value (Fallback Value))<br><br>Notes:<br>- Output of multiple sequences possible | `0.0000`
| `value_status` | Value Status<br><br>Notes:<br>- Possible states:<br>`000 Valid`: Valid, no deviation <br>`W01 Empty data`: No data available <br>`E90 No data to substitute N`: No valid data to substitude N's (only class-11 models) <br>`E91 Rate negative`: Small negative rate, use fallback value as actual value (info) <br>`E92 Rate too high (<)`: Negative rate larger than specified max rate (error) <br>`E93 Rate too high (>)`: Positive rate larger than specified max rate (error) | `000 Valid`
| `actual_value` | Actual value | `146.540`
| `fallback_value` | Fallback value (last valid result)<br><br>Notes:<br>- Possible special states:<br>`Deactivated`: No fallback value usage <br>`Outdated`: Fallback value too old <br>`Not Determinable`: Age of value not determinable | `146.540`
| `raw_value` | Raw value <br>(Value before any post-processing) per seqeunce | `146.539`
| `rate_per_minute` | Rate per minute per sequence<br>(Delta between actual and last valid processed value (Fallback Value) + additionally normalized to a minute) | `0.0000`
| `rate_per_interval` | Rate per interval per serquence<br>(Delta between actual and last valid processed value (Fallback Value)) | `0.0000`

Example - Message body in JSON syntax:
```
Expand All @@ -42,6 +42,17 @@ Example - Message body in JSON syntax:
"raw_value": "00530.00984",
"rate_per_min": "0.001240",
"rate_per_interval": "0.00062"
},
{
"time_processed_utc": "1729341437",
"timestamp_processed": "2024-10-19T14:37:17+0200",
"sequence_name": "sequence2",
"value_status": "000 Valid",
"actual_value": "530.01984",
"fallback_value": "530.01984",
"raw_value": "00530.01984",
"rate_per_min": "0.001440",
"rate_per_interval": "0.00075"
}
]
```
Expand Down Expand Up @@ -97,14 +108,14 @@ if ($method === 'POST') {

foreach ($dataArray as $data) {
$csvRow = [
$data['timestamp'],
$data['sequenceName'],
$data['valueStatus']
$data['actualValue'],
$data['fallbackValue'],
$data['rawValue'],
$data['ratePerMin'],
$data['ratePerInterval'],
$data['timestamp_processed'],
$data['sequence_name'],
$data['raw_value'],
$data['actual_value'],
$data['fallback_value'],
$data['rate_per_min'],
$data['rate_per_interval'],
$data['value_status']
];
fputcsv($csvHandle, $csvRow);
}
Expand All @@ -115,6 +126,7 @@ if ($method === 'POST') {
echo json_encode(['status' => 'success', 'message' => 'Data written to CSV file']);
} elseif ($method === 'PUT') {
// Handle PUT request: Save image
// With provided timestamp parameter (?timestamp='unix epoch time') unique image filename can be created and/or linked to data
$imageFilePath = 'uploaded_image.jpg';

$imageData = file_get_contents('php://input');
Expand Down
2 changes: 1 addition & 1 deletion docs/Installation/DeviceProvisioning/Manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A SD card is mandatory to operate the device because of internal device memory i
⚠️ Make sure, SD card is formated properly (FAT or FAT32 file system).<br>

Use firmware package `AI-on-the-edge-device__{Board Type}__*.zip` for installation process.<br>
⚠️ Do not use github source files, use only release related zip package. Otherwise functionality cannot be fully guaranteed or is limited!<br>
⚠️ **Please do not use the source files directly from the repository, not even for the preparation of the SD card!** Use only files related to official precompiled release packages or test versions. Otherwise, full functionality cannot be guaranteed.<br>

##### Option 1: Manual SD Card Installation
- Copy complete `config` and `html` folder of `AI-on-the-edge-device__{Board Type}__*.zip` to SD card root folder
Expand Down

0 comments on commit 30132a4

Please sign in to comment.