Jump to content

SENSBLUE ATLAS/MQTT Actors: Difference between revisions

No edit summary
No edit summary
 
(18 intermediate revisions by the same user not shown)
Line 7: Line 7:
Eth1: '''93.48.86.253'''
Eth1: '''93.48.86.253'''


user: < not needed>
user: <not needed>


login <not needed>  
login: <not needed>  


=== <big>1. Relay Outputs Actor</big> ===
=== <big>1. Relay Outputs Actor</big> ===
Line 121: Line 121:
</syntaxhighlight>
</syntaxhighlight>


=== <big>2 RTC Actor</big> ===
=== <big>2. RTC Actor</big> ===


==== 2.1 App Interfacing ====
==== 2.1 App Interfacing ====
Line 249: Line 249:
[[File:RTCActor Overview.svg|center|frameless|903x903px]]
[[File:RTCActor Overview.svg|center|frameless|903x903px]]


=== <big>3 System Health Actor</big> ===
=== <big>3. System Health Actor</big> ===


==== 3.1 App Interfacing ====
==== 3.1 App Interfacing ====
Line 3,077: Line 3,077:
'''Network Information Screen'''
'''Network Information Screen'''


* Display an interface with information about the networks of the device
* Displays an interface with information about the networks of the device
* Updated on load
* Updated on load
* No user interaction required
* No user interaction required
Line 3,115: Line 3,115:


==== 5.3 User interaction through MQTT ====
==== 5.3 User interaction through MQTT ====
Enabling interaction with the carousel using the topic tft/runtime/in . Actions available will be public to the user.
Enabling interaction with the carousel using the topic tft/runtime/in.
 
Actions available will be public to the user.


'''Runtime commands'''
'''Runtime commands'''
Line 3,181: Line 3,183:
|Ordered list of screens
|Ordered list of screens
|-
|-
|Start  Index
|startIndex
|Initial active screen (optional,  default = 0)
|Initial active screen (optional,  default = 0)
|}
|}
Line 4,139: Line 4,141:
After STOP, the buzzer is forced to OFF.
After STOP, the buzzer is forced to OFF.


=== 12. Power Monitor actor ===
=== 12. Power Monitor Actor ===


==== 12.1 Overview ====
==== 12.1 Overview ====
Line 4,293: Line 4,295:
- You want to lock to a specific network for stability/testing
- You want to lock to a specific network for stability/testing


====== '''Auto Selection''' ======
====== Auto Selection ======
'''Req-Topic''': modem/config/in<syntaxhighlight lang="json" line="1">
'''Req-Topic''': modem/config/in<syntaxhighlight lang="json" line="1">
{
{
Line 4,857: Line 4,859:
</syntaxhighlight>
</syntaxhighlight>


===== '''Reply parameters''' =====
===== Reply parameters =====
{| class="wikitable"
{| class="wikitable"
|'''Parameter'''
|'''Parameter'''
Line 5,488: Line 5,490:
===== Configure CANopen Nodes =====
===== Configure CANopen Nodes =====
Req-Topic: <code>canopenRM8007/config/in</code>
Req-Topic: <code>canopenRM8007/config/in</code>


Stores CANopen defaults and logical node configuration inside the actor.<syntaxhighlight lang="json" line="1">
Stores CANopen defaults and logical node configuration inside the actor.<syntaxhighlight lang="json" line="1">
Line 5,658: Line 5,658:
* As an alternative to the <code>nodes</code> object, any other key of <code>taskParams</code> whose value is an object containing <code>node_id</code> is also stored as a logical node. These two requests are equivalent:
* As an alternative to the <code>nodes</code> object, any other key of <code>taskParams</code> whose value is an object containing <code>node_id</code> is also stored as a logical node. These two requests are equivalent:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{ "task": { "alias": "CONFIG_CANOPEN", "taskParams": { "nodes": { "motor_1": { "node_id": 5 } } } } }
{
{ "task": { "alias": "CONFIG_CANOPEN", "taskParams": { "motor_1": { "node_id": 5 } } } }
  "task": {
    "alias": "CONFIG_CANOPEN",
    "taskParams": {
      "nodes": {
        "motor_1": {
          "node_id": 5
        }
      }
    }
  }
}
{
  "task": {
    "alias": "CONFIG_CANOPEN",
    "taskParams": {
      "motor_1": {
        "node_id": 5
      }
    }
  }
}
</syntaxhighlight>
</syntaxhighlight>


Line 7,416: Line 7,436:
Normally, the TPDO should be configured first using <code>CONFIG_POSITION_TPDO</code>.
Normally, the TPDO should be configured first using <code>CONFIG_POSITION_TPDO</code>.


Only one continuous loop can run at a time; see Continuous Reading: Task Exclusivity.
Only one continuous loop can run at a time; see [[SENSBLUE ATLAS/MQTT Actors#Continuous Reading: Task Exclusivity|'''''<u>Continuous Reading: Task Exclusivity</u>''''']].


Only the "no node reference at all" case is validated '''before''' the acknowledgement. An unknown <code>node</code> name, or a <code>steps_per_rev</code> that cannot be resolved, is detected only '''after''' the acknowledgement was already published with <code>success: true</code> and <code>running: true</code>. The loop then terminates immediately and '''nothing else is ever published''' - no error message and no samples. If samples do not start arriving, check the node name and <code>steps_per_rev</code>.
Only the "no node reference at all" case is validated '''before''' the acknowledgement. An unknown <code>node</code> name, or a <code>steps_per_rev</code> that cannot be resolved, is detected only '''after''' the acknowledgement was already published with <code>success: true</code> and <code>running: true</code>. The loop then terminates immediately and '''nothing else is ever published''' - no error message and no samples. If samples do not start arriving, check the node name and <code>steps_per_rev</code>.
Line 7,972: Line 7,992:
|Yes*
|Yes*
|<code>5</code>
|<code>5</code>
|Numeric CANopen node ID. See Node Reference.
|Numeric CANopen node ID. See [[SENSBLUE ATLAS/MQTT Actors#Node Reference (Yes*)|'''''<u>Node Reference</u>''''']].
|-
|-
|<code>task.taskParams.nodeId</code>
|<code>task.taskParams.nodeId</code>
Line 8,034: Line 8,054:


===== Receive PDO =====
===== Receive PDO =====
Waits for a single TPDO frame from the node and returns its '''raw bytes''', with no decoding. Useful to inspect a PDO mapping. For a decoded position, use Continuous PDO Reading.
Waits for a single TPDO frame from the node and returns its '''raw bytes''', with no decoding. Useful to inspect a PDO mapping. For a decoded position, use [[SENSBLUE ATLAS/MQTT Actors#Continuous PDO Reading|'''''<u>Continuous PDO Reading</u>''''']].


The COB-ID listened to is <code>0x180</code>, <code>0x280</code>, <code>0x380</code> or <code>0x480</code> for <code>pdo_num</code> <code>1..4</code>, plus the node ID.
The COB-ID listened to is <code>0x180</code>, <code>0x280</code>, <code>0x380</code> or <code>0x480</code> for <code>pdo_num</code> <code>1..4</code>, plus the node ID.
Line 8,098: Line 8,118:
|Yes*
|Yes*
|<code>5</code>
|<code>5</code>
|See Node Reference.
|See [[SENSBLUE ATLAS/MQTT Actors#Node Reference (Yes*)|'''''<u>Node Reference</u>''''']].
|-
|-
|<code>task.taskParams.nodeId</code>
|<code>task.taskParams.nodeId</code>
Line 8,179: Line 8,199:
   }
   }
}
}
</syntaxhighlight>In practice, only the timeout case currently produces a usable reply. See Known Limitations.
</syntaxhighlight>In practice, only the timeout case currently produces a usable reply. See [[SENSBLUE ATLAS/MQTT Actors#Known Limitations|'''''<u>Known Limitations</u>''''']].
 
<br>
Req-Topic: <code>canopenRM8007/runtime/in</code><syntaxhighlight lang="json">
Req-Topic: <code>canopenRM8007/runtime/in</code><syntaxhighlight lang="json">
{
{
Line 8,254: Line 8,274:
|Yes*
|Yes*
|<code>5</code>
|<code>5</code>
|See Node Reference.
|See [[SENSBLUE ATLAS/MQTT Actors#Node Reference (Yes*)|'''''<u>Node Reference</u>''''']].
|-
|-
|<code>task.taskParams.nodeId</code>
|<code>task.taskParams.nodeId</code>
Line 8,396: Line 8,416:
|Yes*
|Yes*
|<code>5</code>
|<code>5</code>
|See Node Reference.
|See [[SENSBLUE ATLAS/MQTT Actors#Node Reference (Yes*)|'''''<u>Node Reference</u>''''']].
|-
|-
|<code>task.taskParams.nodeId</code>
|<code>task.taskParams.nodeId</code>
Line 8,612: Line 8,632:
|}
|}


=== 15 SMS Actor ===
=== 15. SMS Actor ===


==== 15.1 Overview ====
==== 15.1 Overview ====
Line 9,198: Line 9,218:
On an unexpected exception, every handler returns <code>{ "success": false, "error": "<exception text>" }</code> instead of its usual fields.
On an unexpected exception, every handler returns <code>{ "success": false, "error": "<exception text>" }</code> instead of its usual fields.


==== 15.6 Interpreting the Results ====
==== 15.5 Interpreting the Results ====


===== a) <code>success: false</code> on SMS_RECEIVED =====
===== a) <code>success: false</code> on SMS_RECEIVED =====
Line 9,249: Line 9,269:
<code>set_ssh</code> runs <code>systemctl start|stop</code> on both <code>ssh.socket</code> and <code>ssh.service</code>, confirmed on-device via <code>systemctl list-units | grep -i ssh</code>. On this image, <code>ssh.service</code> is <code>TriggeredBy: ssh.socket</code> and both are enabled independently — stopping only <code>ssh.service</code> leaves <code>ssh.socket</code> listening on :22, and it socket-activates a fresh <code>sshd</code> on the next connection attempt, so SSH would stay reachable despite <code>SSH:Off</code> reporting success. Some distros name the service unit <code>sshd</code> instead; reconfirm both unit names if targeting a different image.
<code>set_ssh</code> runs <code>systemctl start|stop</code> on both <code>ssh.socket</code> and <code>ssh.service</code>, confirmed on-device via <code>systemctl list-units | grep -i ssh</code>. On this image, <code>ssh.service</code> is <code>TriggeredBy: ssh.socket</code> and both are enabled independently — stopping only <code>ssh.service</code> leaves <code>ssh.socket</code> listening on :22, and it socket-activates a fresh <code>sshd</code> on the next connection attempt, so SSH would stay reachable despite <code>SSH:Off</code> reporting success. Some distros name the service unit <code>sshd</code> instead; reconfirm both unit names if targeting a different image.


==== 15.7 Boot Behaviour ====
==== 15.6 Boot Behaviour ====
On every boot, the actor:
On every boot, the actor:


Line 9,257: Line 9,277:
There is no periodic check — all processing after boot is triggered by modem D-Bus signals.
There is no periodic check — all processing after boot is triggered by modem D-Bus signals.


==== 15.8 Known Limitations ====
==== 15.7 Known Limitations ====
Behaviour that is easy to rely on by mistake, listed so integrations do not.
Behaviour that is easy to rely on by mistake, listed so integrations do not.
{| class="wikitable"
{| class="wikitable"
Line 9,309: Line 9,329:
|}
|}


==== 15.9 Notes ====
==== 15.8 Notes ====
* The SMS Actor keeps no persistent state across restarts (no EEPROM, file, or database). In-memory bookkeeping only tracks SMS already seen/being processed, to avoid double-handling from overlapping D-Bus signals.
* The SMS Actor keeps no persistent state across restarts (no EEPROM, file, or database). In-memory bookkeeping only tracks SMS already seen/being processed, to avoid double-handling from overlapping D-Bus signals.
* Message deletion after processing is enabled by default; this can be disabled via configuration if a full SMS audit trail is needed on the modem/SIM itself (subject to SIM storage limits).
* Message deletion after processing is enabled by default; this can be disabled via configuration if a full SMS audit trail is needed on the modem/SIM itself (subject to SIM storage limits).
* There is currently no sender allow-list or authentication on inbound SMS commands — any device holding the SIM number can trigger any of the commands above by sending the matching text.
* There is currently no sender allow-list or authentication on inbound SMS commands — any device holding the SIM number can trigger any of the commands above by sending the matching text.
* <code>set_digital_output</code>/<code>set_relay</code> are the only commands that depend on another actor process (<code>busi2c-3</code>/<code>busi2c-1</code>) being up and reachable over MQTT; all other commands run entirely within the SMS actor's own process.
* <code>set_digital_output</code>/<code>set_relay</code> are the only commands that depend on another actor process (<code>busi2c-3</code>/<code>busi2c-1</code>) being up and reachable over MQTT; all other commands run entirely within the SMS actor's own process.