339 lines
9.8 KiB
Markdown
339 lines
9.8 KiB
Markdown
# THE IDEA
|
|
|
|
TCKRTUIYO: A modern, web-based interface of the current Base Station/Real-Time Unit (RTU) to fit the new 7" capacitive touchscreen display. The RTU is used to monitor and log rainfall and other related sensors at the station periodically, and transmit the logged data to to a server periodically as well, and/or server would request the logged data.
|
|
|
|
Device: Raspberry Pi Zero 2 W and Raspberry Pi 3B, 7 inch capacitive touch screen 1024x600
|
|
|
|
1st Milestone: Design a modern but compact UI that are intuitive and interactive, as well as easy to customize, with minimal dependencies. Fast enough for a low-powered device like the Pi Zero 2 W to run via Chromium Kiosk Mode. A
|
|
|
|
2nd Milestone: The CSV processing and workflow
|
|
|
|
3rd Milestone: The network stack
|
|
|
|
|
|
|
|
There are two types of display for the app:
|
|
|
|
* Using the connected 7 inch display (Main interface) with a 7 inch interface, with Chromium Kiosk Mode showing a special url for example `http://pihostname:8080` - The total size is fixed at 1024x600
|
|
* Full HD interface if a PC viewing the webserver remotely by a specific url (after logged in), for example `http://pihostname:9090/`
|
|
|
|
|
|
|
|
|
|
|
|
***
|
|
|
|
## DASHBOARD/HOME SCREEN:
|
|
|
|
This is the current dashboard/home screen on a small 4 inch screen that needs to be modernized:
|
|
|
|
```
|
|
+--------------------------------------------------------------------+
|
|
| LOGO HH:MM:SS DD-MM-YYYY COMM STATUS: 0ASU/-113dBm(0%) |
|
|
| STATION NO: D007 v4.0.4 (LOG IN) |
|
|
+--------------------------------------------------------------------+
|
|
| RAINFALL | | | |
|
|
| TODAY | 0.0 | mm | |
|
|
| HOURLY | 0.0 | mm | |
|
|
| MAR ACC | 0.0 | mm | |
|
|
| YEARLY ACC | 10.5 | mm | |
|
|
|--------------------------------------------------------------------|
|
|
| |
|
|
| [SOLAR -9999] [BAT 12.05V (HIGH)] [NEXT] [LOG] [RESET] |
|
|
+--------------------------------------------------------------------+
|
|
```
|
|
|
|
Elements:
|
|
|
|
* Logo
|
|
* HH:MM:SS
|
|
* YYYY-MM-DD
|
|
* STATION ID
|
|
* COMM STATUS
|
|
* VERSION
|
|
* LOGGED IN STATUS
|
|
* Dashboard view:
|
|
* Today Rainfall | 0.0 mm
|
|
* Hourly Rainfall | 0.0 mm
|
|
* MAR Acc Rainfall | 12.0 mm
|
|
* Yearly Acc Rainfall | 50.0 mm
|
|
* SOLAR (voltage) | -9999
|
|
* BATTERY (voltage) | 12.14 V (HIGH)
|
|
|
|
***
|
|
|
|
# FEATURES & MENU
|
|
|
|
MAIN MENU:
|
|
|
|
* UTILITY/SETTINGS
|
|
* CALIBRATION
|
|
* FLASH MEMORY
|
|
|
|
***
|
|
|
|
## 1 UTILITY/SETTINGS menu:
|
|
|
|
* Station Info
|
|
* Date / Time setting
|
|
* Mobile Setting
|
|
* ADC Setting
|
|
* Rainfall Setting
|
|
* EVAP Setting
|
|
* GPRS Setting
|
|
* Level Setting
|
|
* SIREN Setting
|
|
* Network Setup
|
|
|
|
***
|
|
|
|
### 1.1 ADC Setting submenu:
|
|
|
|
| Channel | Type | Datum Set | Range Set | Unit |
|
|
| ------- | ------- | --------- | --------- | ----- |
|
|
| 1 | 4-20ma | 0.00 | 10 | Meter |
|
|
| 2 | 4-20ma | 0.00 | 10 | Meter |
|
|
| 3 | 0-10vDC | 0.00 | 10 | Volt |
|
|
| 4 | 0-10vDC | 0.00 | 40 | Volt |
|
|
|
|
* Type is a value reading
|
|
* Datum can be set, to offset the sea level
|
|
* Range is the sensor range, in meters, centimeters or milimeters - can be set
|
|
|
|
***
|
|
|
|
### 1.2 Rainfall Setting submenu:
|
|
|
|
Rainfall ID:
|
|
|
|
| Rainfall -1 ID | 123456RF |
|
|
| -------------- | -------- |
|
|
| Rainfall -2 ID | 0 |
|
|
|
|
Indicator Setting:
|
|
|
|
| Danger Rainfall | 30.0 mm | 60 min |
|
|
| ---------------- | ------- | -------------- |
|
|
| Warning Rainfall | 20.0 mm | 60 min |
|
|
| Start Rainfall | 10.0 mm | 30 min |
|
|
| Indicator | Value | Threshold Time |
|
|
|
|
***
|
|
|
|
### 1.3 Water Level Threshold submenu:
|
|
|
|
Water Level ID:
|
|
|
|
| WL1-ID | |
|
|
| ----------- | - |
|
|
| WL2-ID | 0 |
|
|
| WL3-ID | 0 |
|
|
| SUR FLOW ID | |
|
|
|
|
Indicator Setting:
|
|
|
|
| Danger Level | 6.00 meter |
|
|
| ------------- | ---------- |
|
|
| Warning Level | 5.00 meter |
|
|
| Alert Level | 4.00 meter |
|
|
| Normal Level | 3.00 meter |
|
|
|
|
Buttons: `SAVE` , `DEFAULT` , `BACK`
|
|
|
|
***
|
|
|
|
### 1.4 Network Setting submenu:
|
|
|
|
| Local IP Address | 192.168.1.230 |
|
|
| ----------------- | ----------------- |
|
|
| Subnet Mask | 255.255.255.0 |
|
|
| Gateway | 192.168.1.1 |
|
|
| Local DNS | 192.168.1.1 |
|
|
| MAC | 08:90:90:90:90:90 |
|
|
| Transfer Protocol | FTP |
|
|
|
|
Buttons: `SAVE` , `DEFAULT` , `BACK`
|
|
|
|
***
|
|
|
|
### 1.5 EVAP Setting submenu:
|
|
|
|
| EVAP ID | 0 |
|
|
| ---------------- | ------- |
|
|
| Soil Moisture ID | 0 |
|
|
| W\_Potential ID | 0 |
|
|
| EVAP RESET ON | 0 sec |
|
|
| EVAP RESET OFF | 0 sec |
|
|
| EVAP MAX LEVEL | 0.00 mm |
|
|
| EVAP MIN LEVEL | 0.00 mm |
|
|
| EVAP DAILY RESET | 0.00 mm |
|
|
| SDI-12 AUTO | 0 sec |
|
|
|
|
Buttons: `BACK`
|
|
|
|
***
|
|
|
|
### 1.6 Protocol Setting submenu:
|
|
|
|
| IP Address | User | Password | File Directory | Protocol |
|
|
| ---------- | ---- | -------- | ------------------ | -------- |
|
|
| | | | /myvscada/stationA | FTP |
|
|
| | | | /myvscada/stationA | SCP |
|
|
| | | | /myvscada/stationA | SFTP |
|
|
| | | | stationA | WEBDAV |
|
|
|
|
| SERVER IP | |
|
|
| -------------- | --------- |
|
|
| TCP PORT | |
|
|
| Tideda Hour x1 | 07:00 |
|
|
| Tideda Hour x2 | 17:00 |
|
|
| Latitude | 3.15593 |
|
|
| Longitude | 101.75106 |
|
|
|
|
Notes:
|
|
|
|
* SERVER IP: return 0 if FTP server has not started
|
|
* TCP PORT: return 0 if FTP server has not started
|
|
* Latitude & Longitude is retrived from USB GPS module, but can be set manually
|
|
|
|
Buttons: `BACK`
|
|
|
|
***
|
|
|
|
### 1.7 Mobile Setting submenu:
|
|
|
|
| Master 1 | 0122460822 |
|
|
| ----------- | ---------- |
|
|
| SubMaster 1 | |
|
|
| Master 2 | |
|
|
| SubMaster 2 | |
|
|
|
|
| Engineer 1 | 0139676953 |
|
|
| ----------- | ---------- |
|
|
| Engineer 2 | |
|
|
| Engineer 3 | |
|
|
| Engineer 4 | |
|
|
| Engineer 5 | |
|
|
| Engineer 6 | |
|
|
| Engineer 7 | |
|
|
| Engineer 8 | |
|
|
| Engineer 9 | |
|
|
| Engineer 10 | 0169658279 |
|
|
|
|
| RTU Mobile | |
|
|
| ---------- | - |
|
|
|
|
Note:
|
|
|
|
* This is to view/edit the connected mobile network module
|
|
|
|
Buttons: `Back`
|
|
|
|
***
|
|
|
|
## 2 CALIBRATION menu
|
|
|
|
| Channel | Type | ADC | Datum | Reading |
|
|
| ------- | -------- | --------- | ----- | -------------- |
|
|
| CH 1 | 4-20 ma | 0.000 ma | 0.00 | 9999.000 meter |
|
|
| CH 2 | 4-20 ma | 0.000 ma | 0.00 | 9999.000 meter |
|
|
| CH 3 | 0-10 vDC | 0.006 vDC | 0.00 | 0.000 volt |
|
|
| CH 4 | 0-10 vDC | 0.017 vDC | 0.00 | 0.000 volt |
|
|
|
|
| Total RF1 Tip | 0 |
|
|
| ------------- | ------ |
|
|
| Total RF2 Tip | 0 |
|
|
| RF1 Rainfall | 0.0 mm |
|
|
| RF2 Rainfall | 0.0 mm |
|
|
|
|
Notes:
|
|
|
|
* Only view live readings, and can only reset the readings to get current readings
|
|
|
|
Buttons: `Reset` , `Back`
|
|
|
|
***
|
|
|
|
## 3 FLASH MEMORY
|
|
|
|
| CURRENT VIEW | SP8025\_FTP.txt |
|
|
| ------------ | --------------- |
|
|
|
|
| FILE MANAGER | |
|
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | - |
|
|
| ../
./
SP8020\_FTP.txt
SP8021\_FTP.txt
SP8022\_FTP.txt
**SP8023\_FTP.txt**
SP8024\_FTP.txt
SP8025\_FTP.txt
SP8026\_FTP.txt
SP8027\_FTP.txt | |
|
|
|
|
Notes:
|
|
|
|
* Can navigate up down in the FILE MANAGER column to select a file, and CONTENTS column will automatically show the contents of the selected file
|
|
|
|
Buttons: `RF1 TIDEDA` , `DELETE FILE` , `SAVE` , `Back`
|
|
|
|
***
|
|
|
|
## CSV Flowchart:
|
|
|
|
```mermaid
|
|
flowchart TD
|
|
A[stationA sends CSV file] --> B[myvscada server receives CSV file]
|
|
B --> C[Monitor received folder]
|
|
C --> D[Move CSV file into received folder]
|
|
D --> E[Process CSV file and check for errors]
|
|
|
|
E -->|No errors| F[Move CSV file into processed folder]
|
|
E -->|Errors found| G[Move CSV file into error folder]
|
|
G --> H[Trigger request to retrieve file again]
|
|
H --> A
|
|
|
|
F --> I[Create log report]
|
|
G --> I[Create log report]
|
|
```
|
|
|
|
Flow breakdown:
|
|
|
|
1. **stationA** sends CSV file periodically.
|
|
2. **myvscada server** receives the file.
|
|
3. Server monitors the **received folder**.
|
|
4. File is moved into **received folder**.
|
|
5. File is processed and checked for errors.
|
|
6. If **no errors**, it goes to **processed folder**.
|
|
7. If **errors**, it goes to **error folder**, and the server requests the file again (loop back to step 1).
|
|
8. Finally, a **log report** is created for the whole operation.
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant stationA as stationA (RTU)
|
|
participant server as myvscada Server
|
|
participant received as Received Folder
|
|
participant processed as Processed Folder
|
|
participant error as Error Folder
|
|
participant log as Log Report
|
|
|
|
stationA->>server: Send CSV file (scheduled)
|
|
server->>received: Monitor & detect new CSV
|
|
server->>received: Move CSV file into received folder
|
|
server->>server: Process CSV file & check for errors
|
|
|
|
alt No errors
|
|
server->>processed: Move CSV file into processed folder
|
|
else Errors found
|
|
server->>error: Move CSV file into error folder
|
|
server->>stationA: Request file again (retry loop)
|
|
end
|
|
|
|
server->>log: Create log report of operation
|
|
```
|
|
|
|
What this shows:
|
|
|
|
* **stationA** periodically sends CSV files.
|
|
* **myvscada server** receives and monitors them.
|
|
* Files are moved into the **received folder**.
|
|
* Processing checks for errors.
|
|
* If clean → moved to **processed folder**.
|
|
* If errors → moved to **error folder**, and the server requests the file again (loop back).
|
|
* Finally, a **log report** is generated.
|
|
|
|
This sequence diagram makes the retry loop explicit and shows the chronological order of events.
|
|
|