Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 84 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ other information that should be provided before the tool is installed.
- [SIL (Software-in-the-Loop) Host Build](#sil-software-in-the-loop-host-build)
- [Prerequisites](#prerequisites)
- [Compile and Run](#compile-and-run)
- [Yocto Image Build (Raspberry Pi Target)](#yocto-image-build-raspberry-pi-target)
- [minihildesk GUI Client](#minihildesk-gui-client)
- [Prerequisites](#prerequisites-1)
- [Compile and Run](#compile-and-run-1)
- [Yocto Image Build (Raspberry Pi Target)](#yocto-image-build-raspberry-pi-target)
- [Prerequisites](#prerequisites-2)
- [Compile target image](#compile-target-image)
- [Flashing the Image to SD Card](#flashing-the-image-to-sd-card)
- [Option A: Using `bmaptool` (Recommended - Fast & Direct)](#option-a-using-bmaptool-recommended---fast--direct)
Expand All @@ -28,6 +31,10 @@ other information that should be provided before the tool is installed.
- [JSON-RPC 2.0 API Specification](#json-rpc-20-api-specification)
- [`set_relay`](#set_relay)
- [`get_relays`](#get_relays)
- [`start_timer`](#start_timer)
- [`start_pulse`](#start_pulse)
- [`start_blink`](#start_blink)
- [`get_relay_status`](#get_relay_status)
- [Docs](#docs)
- [Copyright and licence](#copyright-and-licence)

Expand Down Expand Up @@ -65,6 +72,35 @@ The daemon will boot in SIL mode and print:

---

### minihildesk GUI Client

**minihildesk** is a premium GTKmm-based C++ desktop GUI client designed to connect to the `minihild` server (either running on a Raspberry Pi target or locally in SIL mock mode).

It features:
- A connection bar supporting standard TCP connection, **SSL/TLS secure connection**, and **Mutual TLS (mTLS) client verification**.
- A grid of 8 Relay Control Cards displaying status via glowing LED indicators and active green borders.
- Multi-mode relay control per channel: **Toggle** (manual switch), **Timer** (seconds spin-input), **Pulse** (milliseconds spin-input up to 100,000 ms), and **Blink** (ON/OFF ms inputs and cycle count).
- Automatic hardware safety auto-off logic: switching modes on an active channel immediately turns the relay OFF on the server before entering the new mode.
- A monospace green log terminal at the bottom showcasing outgoing and incoming JSON-RPC traffic.

#### Prerequisites
Install the GTKmm-4.0 development headers, OpenSSL, and JSON library:
```bash
sudo apt-get install libgtkmm-4.0-dev libssl-dev nlohmann-json3-dev
```

#### Compile and Run
```bash
# Configure and compile using CMake
cmake -B sw/minihildesk/build -S sw/minihildesk
cmake --build sw/minihildesk/build

# Start the desktop GUI app
./sw/minihildesk/build/minihildesk
```

---

### Yocto Image Build (Raspberry Pi Target)

MiniHIL packages `minihild` into a custom Yocto Linux image (`minihil-image`) using `meta-raspberrypi` and Poky.
Expand Down Expand Up @@ -143,7 +179,7 @@ bzcat sw/build-minihil/tmp/deploy/images/raspberrypi3-64/minihil-image-raspberry
You can send JSON-RPC text frames (terminated by `\n`) to port `9000`.

#### `set_relay`
Energize or de-energize a relay channel (1 to 8):
Energize or de-energize a relay channel manually (1 to 8):
- **Request**:
```json
{"jsonrpc": "2.0", "method": "set_relay", "params": {"relay_id": 3, "state": true}, "id": 1}
Expand All @@ -154,7 +190,7 @@ Energize or de-energize a relay channel (1 to 8):
```

#### `get_relays`
Query states of all 8 relay channels:
Query immediate physical states of all 8 relay channels:
- **Request**:
```json
{"jsonrpc": "2.0", "method": "get_relays", "id": 2}
Expand All @@ -164,6 +200,50 @@ Query states of all 8 relay channels:
{"jsonrpc": "2.0", "result": {"1": false, "2": false, "3": true, "4": false, "5": false, "6": false, "7": false, "8": false}, "id": 2}
```

#### `start_timer`
Keep a relay active for a specific duration in seconds:
- **Request**:
```json
{"jsonrpc": "2.0", "method": "start_timer", "params": {"relay_id": 2, "seconds": 10}, "id": 3}
```
- **Response**:
```json
{"jsonrpc": "2.0", "result": {"relay_id": 2, "seconds": 10, "success": true}, "id": 3}
```

#### `start_pulse`
Generate a single momentary pulse in milliseconds (up to 100,000 ms):
- **Request**:
```json
{"jsonrpc": "2.0", "method": "start_pulse", "params": {"relay_id": 3, "duration_ms": 5000}, "id": 4}
```
- **Response**:
```json
{"jsonrpc": "2.0", "result": {"relay_id": 3, "duration_ms": 5000, "success": true}, "id": 4}
```

#### `start_blink`
Repeatedly cycle relay state ON and OFF:
- **Request**:
```json
{"jsonrpc": "2.0", "method": "start_blink", "params": {"relay_id": 4, "on_ms": 1000, "off_ms": 1000, "count": 5}, "id": 5}
```
- **Response**:
```json
{"jsonrpc": "2.0", "result": {"relay_id": 4, "on_ms": 1000, "off_ms": 1000, "count": 5, "success": true}, "id": 5}
```

#### `get_relay_status`
Query detailed diagnostic status and remaining time for a single channel:
- **Request**:
```json
{"jsonrpc": "2.0", "method": "get_relay_status", "params": {"relay_id": 2}, "id": 6}
```
- **Response**:
```json
{"jsonrpc": "2.0", "result": {"relay_id": 2, "status": "Channel 2: ON (Timer, rem: 8s)"}, "id": 6}
```

### Docs

[![Documentation Status](https://readthedocs.org/projects/minihil/badge/?version=latest)](https://minihil.readthedocs.io/projects/minihil/en/latest/?badge=latest)
Expand All @@ -182,4 +262,4 @@ Copyright (C) 2020 - 2026 by [electux.github.io/minihil](https://electux.github.

Lets help and support Raspberry PI && GNOME.

<img src="https://raw.githubusercontent.com/electux/minihil/master/docs/foundations.png" alt="Raspberry Pi & GNOME Foundations" width="681" height="100">
<img src="https://raw.githubusercontent.com/electux/minihil/master/docs/foundations.png" alt="Foundations">
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/index.doctree
Binary file not shown.
101 changes: 97 additions & 4 deletions docs/build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,38 @@ Compile and Run
The daemon will boot in SIL mode and print:
``[SilRelayController] Software-in-the-Loop simulation initialized.``

minihildesk GUI Client
----------------------

**minihildesk** is a premium GTKmm-based C++ desktop GUI client designed to connect to the ``minihild`` server (either running on a Raspberry Pi target or locally in SIL mock mode).

It features:

* A connection bar supporting standard TCP connection, **SSL/TLS secure connection**, and **Mutual TLS (mTLS) client verification**.
* A grid of 8 Relay Control Cards displaying status via glowing LED indicators and active green borders.
* Multi-mode relay control per channel: **Toggle** (manual switch), **Timer** (seconds spin-input), **Pulse** (milliseconds spin-input up to 100,000 ms), and **Blink** (ON/OFF ms inputs and cycle count).
* Automatic hardware safety auto-off logic: switching modes on an active channel immediately turns the relay OFF on the server before entering the new mode.
* A monospace green log terminal at the bottom showcasing outgoing and incoming JSON-RPC traffic.

Prerequisites
~~~~~~~~~~~~~
Install the GTKmm-4.0 development headers, OpenSSL, and JSON library:

.. code-block:: bash

sudo apt-get install libgtkmm-4.0-dev libssl-dev nlohmann-json3-dev

Compile and Run
~~~~~~~~~~~~~~~
.. code-block:: bash

# Configure and compile using CMake
cmake -B sw/minihildesk/build -S sw/minihildesk
cmake --build sw/minihildesk/build

# Start the desktop GUI app
./sw/minihildesk/build/minihildesk

Yocto Image Build (Raspberry Pi Target)
---------------------------------------

Expand Down Expand Up @@ -113,6 +145,70 @@ Query states of all 8 relay channels:

{"jsonrpc": "2.0", "result": {"1": false, "2": false, "3": true, "4": false, "5": false, "6": false, "7": false, "8": false}, "id": 2}

start_timer
~~~~~~~~~~~
Keep a relay active for a specific duration in seconds:

* **Request**:

.. code-block:: json

{"jsonrpc": "2.0", "method": "start_timer", "params": {"relay_id": 2, "seconds": 10}, "id": 3}

* **Response**:

.. code-block:: json

{"jsonrpc": "2.0", "result": {"relay_id": 2, "seconds": 10, "success": true}, "id": 3}

start_pulse
~~~~~~~~~~~
Generate a single momentary pulse in milliseconds (up to 100,000 ms):

* **Request**:

.. code-block:: json

{"jsonrpc": "2.0", "method": "start_pulse", "params": {"relay_id": 3, "duration_ms": 5000}, "id": 4}

* **Response**:

.. code-block:: json

{"jsonrpc": "2.0", "result": {"relay_id": 3, "duration_ms": 5000, "success": true}, "id": 4}

start_blink
~~~~~~~~~~~
Repeatedly cycle relay state ON and OFF:

* **Request**:

.. code-block:: json

{"jsonrpc": "2.0", "method": "start_blink", "params": {"relay_id": 4, "on_ms": 1000, "off_ms": 1000, "count": 5}, "id": 5}

* **Response**:

.. code-block:: json

{"jsonrpc": "2.0", "result": {"relay_id": 4, "on_ms": 1000, "off_ms": 1000, "count": 5, "success": true}, "id": 5}

get_relay_status
~~~~~~~~~~~~~~~~
Query detailed diagnostic status and remaining time for a single channel:

* **Request**:

.. code-block:: json

{"jsonrpc": "2.0", "method": "get_relay_status", "params": {"relay_id": 2}, "id": 6}

* **Response**:

.. code-block:: json

{"jsonrpc": "2.0", "result": {"relay_id": 2, "status": "Channel 2: ON (Timer, rem: 8s)"}, "id": 6}

Copyright and licence
----------------------

Expand All @@ -127,7 +223,4 @@ Copyright and licence
Copyright (C) 2020 - 2026 by `electux.github.io/minihil <https://electux.github.io/minihil>`_

.. image:: https://raw.githubusercontent.com/electux/minihil/master/docs/foundations.png
:alt: Raspberry Pi & GNOME Foundations
:width: 681px
:height: 100px

:alt: Foundations
Loading
Loading