Jump to content

SENSBLUE ATLAS/Datasheet: Difference between revisions

No edit summary
No edit summary
Line 948: Line 948:


[[File:Peripherals health.svg|center|frameless|792x792px]]
[[File:Peripherals health.svg|center|frameless|792x792px]]
===== 27.3.1 Example =====
'''For busi2c-0:'''
Reply topic: '''systemHealth/busi2c-0/runtime/out'''
Payload:<syntaxhighlight lang="json">
{
  "id": 1770378753024,
  "origin": "system-health-busi2c-0",
  "task": {
    "taskResult": {
      "ADC": {
        "status": "ERROR",
        "description": "IRQ Retrying",
        "last_report": 1770378753006,
        "stats": {
          "AI1": {
            "samples": 563154,
            "retries": 760548,
            "discards": 253313
          },
          "AI2": {
            "samples": 563154,
            "retries": 760475,
            "discards": 253314
          },
          "AI3": {
            "samples": 563154,
            "retries": 760528,
            "discards": 253313
          },
          "AI4": {
            "samples": 563154,
            "retries": 760549,
            "discards": 253312
          }
        }
      },
      "DAC": {
        "status": "OK",
        "description": "Running....",
        "last_report": 1770378752576,
        "stats": {
          "AO1": {
            "samples": 240755,
            "retries": 0,
            "discards": 0
          },
          "AO2": {
            "samples": 240755,
            "retries": 0,
            "discards": 0
          }
        }
      },
      "RTC": {
        "status": "OK",
        "description": "",
        "last_report": 1770378752094,
        "stats": {
          "samples": 248710,
          "retries": 0,
          "discards": 0
        }
      },
      "TEMP": {
        "status": "OK",
        "description": "",
        "last_report": 1770378752579,
        "stats": {
          "samples": 240754,
          "retries": 0,
          "discards": 0
        }
      }
    }
  }
}
</syntaxhighlight>'''For busi2c-1:'''
Reply topic: '''systemHealth/busi2c-1/runtime/out'''
Payload:<syntaxhighlight lang="json">
{
  "id": 1770382405107,
  "origin": "system-health-busi2c-1",
  "task": {
    "taskResult": {
      "JOYSTICK": {
        "status": "OK",
        "description": "Running....",
        "last_report": 1770382405050,
        "stats": {
          "read_all": {
            "samples": 410154,
            "retries": 0,
            "discards": 0
          },
          "read_raw": {
            "samples": 0,
            "retries": 0,
            "discards": 0
          },
          "buttons": {
            "JDOWN": {
              "reads": 410154,
              "last_state": "pressed"
            },
            "JRIGHT": {
              "reads": 410154,
              "last_state": "pressed"
            },
            "JUP": {
              "reads": 410154,
              "last_state": "pressed"
            },
            "JLEFT": {
              "reads": 410154,
              "last_state": "pressed"
            },
            "JCENTER": {
              "reads": 410154,
              "last_state": "pressed"
            }
          }
        }
      },
      "RELAYS": {
        "status": "OK",
        "description": "Relay Output MQTT connected",
        "last_report": 1770298859099,
        "stats": {
          "read_all": {
            "samples": 0,
            "retries": 0,
            "discards": 0
          },
          "set": {
            "samples": 0,
            "retries": 0,
            "discards": 0
          },
          "set_many": {
            "samples": 0,
            "retries": 0,
            "discards": 0
          },
          "raw_read_all": {
            "samples": 0,
            "retries": 0,
            "discards": 0
          }
        },
        "outputs": {
          "DO1": {
            "writes": 0,
            "last_state": "unknown"
          },
          "DO2": {
            "writes": 0,
            "last_state": "unknown"
          }
        }
      },
      "DI": {
        "status": "OK",
        "description": "Running",
        "last_report": 1770382404832,
        "stats": {
          "read_all": {
            "samples": 181758,
            "retries": 0,
            "discards": 0
          },
          "read_raw": {
            "samples": 0,
            "retries": 0,
            "discards": 0
          },
          "inputs": {
            "DI1": {
              "reads": 181758,
              "last_state": "low"
            },
            "DI2": {
              "reads": 181758,
              "last_state": "low"
            },
            "DI3": {
              "reads": 181758,
              "last_state": "low"
            },
            "DI4": {
              "reads": 181758,
              "last_state": "low"
            }
          }
        }
      }
    }
  }
}
</syntaxhighlight>
=== 28. TempSensor Actor ===
==== 28.1 App Interfacing ====
User App interface and functionalities exposed to the open part of the MQTT broker. Simplified interface to configure and obtain peripherals data. Connecting to the broker for this Area requires no credencials.
===== 28.1.1 Set temperature sensor configurations =====
Req-Topic: tempSensor/config/in
ALERT:
* activate: true(active)/false
* templow: alert temperature lower limit
* tempHigh: alert temperature upper limit
<syntaxhighlight lang="json">
{
  "id": "<TIMESTAMP>",
  "origin": "APP",
  "task": {
    "taskParams": {
      "ALERT": {
        "activate": true,
        "tempLow": 0,
        "tempHigh": 80
      }
    }
  }
}
</syntaxhighlight>Reply-Topic: tempSensor/config/out<syntaxhighlight lang="json">
{
  "id": "<TIMESTAMP>",
  "origin": "APP",
  "task": {
    "taskResult": {
      "success": true,
      "ALERT": {
        "activate": true,
        "tempLow": 0,
        "tempHigh": 80
      }
    }
  }
}
</syntaxhighlight>
===== 28.1.2 Read temperature sensor configurations =====
Req-Topic: tempSensor/config/in
ALERT:
* activate: true(active)/false
LIMITS:
* templow: alert temperature lower limit
* tempHigh: alert temperature upper limit
<syntaxhighlight lang="json">
{
  "id": "<TIMESTAMP>",
  "origin": "APP",
  "task": {
    "action": "READ"
  }
}
</syntaxhighlight>Reply-Topic: tempSensor/config/out<syntaxhighlight lang="json">
{
  "id": "<TIMESTAMP>",
  "origin": "APP",
  "task": {
    "taskResult": {
      "success": true,
      "ALERT": {
        "activate": true,
        "tempLow": 0,
        "tempHigh": 80
      }
    }
  }
}
</syntaxhighlight>
===== 28.1.3 Read temperature and alert status =====
* unit: Temperature unit of measure
* alert: true (triggered) or false
Req-Topic: tempSensor/runtime/in<syntaxhighlight lang="json">
{
  "id": "<TIMESTAMP>",
  "origin": "APP",
  "task": {
    "action": "READ"
  }
}
</syntaxhighlight>Reply-Topic: tempSensor/runtime/out<syntaxhighlight lang="json">
{
  "id": "<TIMESTAMP>",
  "origin": "APP",
  "task": {
    "taskResult": {
      "success": true,
      "data": {
        "temperature": <_FLOAT_>,
        "unit": "C",
        "alert": true
      }
    }
  }
}
</syntaxhighlight>
=== 29. TFT Actor ===
==== 29.1 App Interfacing ====
User App interface and functionalities exposed to the open part of the MQTT broker. Simplified interface to control and interact with the TFT display, or frontal panel LCD screen. Connecting to the broker for this Area requires no credentials.
==== 29.2 TFT Display Actor ====
  The TFT Actor is responsible for:
* Rendering static and informative screens on the TFT display
* Reacting to joystick input (LEFT/ RIGHT/ CENTER/ UP/ DOWN)
* Managing screen navigation and user confirmation flows
* Providing feedback to the application via MQTT
===== 29.2.1 Screen Carousel Concept =====
The TFT actor maintains an '''ordered list of screens''' (carousel).
* Screens are navigated using the joystick:
- LEFT --> Previous screen
- RIGHT --> Next screen
* The carousel wraps around:
- LEFT on first screen --> last screen
- RIGHT on last screen --> first screen
===== 29.2.2 Screen Types =====
The TFT actor supports the following screen types:
'''a.) Image Screen'''
* Displays a static JPEG image
* Default screen shown at boot
* No user interaction required
'''b.) Network Information Screen'''
* Display a interface with information about the networks of the device
* Updated on load
* No user interaction required
===== 29.2.3 Joystick Navigation Logic =====
'''Carousel Navigation:'''
{| class="wikitable"
|'''Joystick  Input'''
|'''Action'''
|-
|LEFT
|Previous screen
|-
|RIGHT
|Next screen
|-
|DOWN
|Refresh current screen
|}
===== 29.2.4 Boot Behavior =====
At system boot:
# TFT actor initializes the display
# Last available carousel is loaded
# First screen is rendered
# Joystick subscriptions are activated
# Actor waits for runtime commands
===== 29.2.5 Design Notes & Constraints =====
* TFT actor does not expose joystick state
* Joystick actor remains independent
* TFT actor internally consumes joystick events
* Carousel state is local to the TFT actor
* Screen rendering is synchronous; input handling is asynchronous
* Confirmation screens always require explicit CENTER press
==== 29.3 User interaction through MQTT ====
Enabling interaction with the carousel using the topic tft/runtime/in . Actions available will be public to the user.
'''Runtime commands'''
'''Go to screen'''
Req-Topic: tft/runtime/in<syntaxhighlight lang="json">
{
  "id": "<TIMESTAMP>",
  "origin": "APP",
  "task": {
    "action": "SET_CAROUSEL",
    "params": {
      "index": 2
    }
  }
}
</syntaxhighlight>Reply-Topic: tft/runtime/out<syntaxhighlight lang="json">
{
  "id": "<TIMESTAMP>",
  "origin": "tft",
  "task": {
    "taskResult": {
      "success": true,
      "index": 2
    }
  }
}
</syntaxhighlight>'''Set TFT Screen Carousel'''
Req-Topic: tft/runtime/in<syntaxhighlight lang="json">
{
  "id": "TIMESTAMP",
  "origin": "APP",
  "task": {
    "action": "SET_CAROUSEL",
    "params": {
      "startIndex": 0,
      "screens": [
        {
          "type": "image",
          "image": "default.jpg"
        },
        {
          "type": "image",
          "image": "status.jpg"
        },
        {
          "type": "confirm",
          "question": "Do you want to continue?"
        }
      ]
    }
  }
}
</syntaxhighlight>'''Parameters:'''
{| class="wikitable"
|'''Field'''
|'''Description'''
|-
|screens
|Ordered list of screens
|-
|Start  lndex
|Initial active screen (optional,  default = 0)
|}
'''Reply'''
Reply-Topic: '''tft/runtime/out''' <syntaxhighlight lang="json">
{
  "id": "TIMESTAMP",
  "origin": "tft",
  "task": {
    "taskResult": {
      "success": true,
      "activeIndex": 0,
      "totalScreens": 3
    }
  }
}
</syntaxhighlight>
=== 30. Analoglnputs Actor ===