meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc_urecs:software_interface [2023/10/18 13:51] vordoc_urecs:software_interface [2024/01/10 17:18] (current) – [LoRa Message] fun
Line 27: Line 27:
 ==== Access ==== ==== Access ====
  
-The u.RECS Management API is accessible via the IP-Address or the hostname of the u.RECS. The basic URL of the API has the format ''https://<ip-address>/REST/<system/baseboard/node>'' or ''http://<ip-address>/REST/<system/baseboard/node>''.+The u.RECS Management API is accessible via the IP-Address or the hostname of the u.RECS. The basic URL of the API has the format ''https://[ip-address]/REST/[system/baseboard/node]'' with ''http'' or ''https'', depending on your configuration. Therefore, please check the following URL as an example: 
 + 
 +https://192.168.0.50/REST/system
  
 Accessing the REST API requires HTTP Basic authentication. The password of the admin account can be changed in the Settings page. Accessing the REST API requires HTTP Basic authentication. The password of the admin account can be changed in the Settings page.
Line 74: Line 76:
 |''health'' |Health status of the node (OK, Warning, Critical)|-|String| |''health'' |Health status of the node (OK, Warning, Critical)|-|String|
 |''voltage'' |Supply voltage of the baseboard|V|Double| |''voltage'' |Supply voltage of the baseboard|V|Double|
-|''lastSensorUpdate'' |Timestamp of the last sensor update|ms|Long|+|''lastSensorUpdate'' |Unix-style epoche timestamp of the last sensor update|s|Long|
 |''present'' |Node is plugged in and detected|-|Boolean| |''present'' |Node is plugged in and detected|-|Boolean|
 |''mpciePresent'' |mPCIe card is plugged in and detected|-|Boolean| |''mpciePresent'' |mPCIe card is plugged in and detected|-|Boolean|
Line 102: Line 104:
 ^ Attribute ^ Description ^ Unit ^ Data type ^ ^ Attribute ^ Description ^ Unit ^ Data type ^
 |''id'' |Unique ID for referencing the component|-|String| |''id'' |Unique ID for referencing the component|-|String|
-|''rcuId'' |Unique ID of the RECS<sup>(r)</sup>%%|%%Box Computing Unit hosting the baseboard|-|String+|''inputVoltage'' |Voltage of the input power |Volt|Double| 
-|''rcuPosition'' |Position of the baseboard inside the RECS<sup>(r)</sup>%%|%%Box Computing Unit|-|Integer+|''boardVoltage1V0'' |Voltage of the internal 1.0V power rail |V|Double
-|''infrastructurePower'' |Power usage of the infrastructure components on the baseboard|W|Double| +|''boardVoltage1V2'' |Voltage of the internal 1.2V power rail |V|Double| 
-|''lastSensorUpdate'' |Timestamp of the last sensor update|ms|Long+|''boardVoltage1V5'' |Voltage of the internal 1.5V power rail |V|Double| 
-|''baseboardType'' |Type of the baseboard (CXP, APLS)|-|String+|''boardVoltage1V8'' |Voltage of the internal 1.8V power rail |V|Double| 
-|''nodeId'' |List of ID****s of the nodes installed on the baseboard|-|String+|''boardVoltage2V5'' |Voltage of the internal 2.5V power rail |V|Double| 
-|''temperatures'' |List of temperatures measured on the backplane|°C|Double+|''boardVoltage5V0'' |Voltage of the internal 5.0V power rail |V|Double| 
- +|''totalPowerUsage'' |Total power usage of the whole u.RECS, measured at the power plug |W|Double| 
-In accordance to the component baseboard the API offers baseboardList which returns multiple instances of baseboard.+|''usbPowerUsage'' |Power usage of the whole USB hub and external USB ports |W|Double
 +|''mPciePowerUsage'' |Power usage of the mPCIe card |W|Double| 
 +|''m2PowerUsage'' |Power usage of the top M.2 card |W|Double| 
 +|''ethSwitchPowerUsage'' |Power usage of the Ethernet switch |W|Double| 
 +|''poePowerUsagePort1'' |PoE power output at Eth Port 1 |W|Double| 
 +|''poePowerUsagePort2'' |PoE power output at Eth Port 2 |W|Double
 +|''regulatorsTemperature'' |Temperature of the main power regulators |°C|Integer| 
 +|''ambientTemperature'' |Ambient temperature |°C|Integer| 
 +|''fanSpeed'' |Set fan speed (0-100) |-|%
 +|''systemFan1Rpm'' |Rotational speed of system fan 1 |RPM|Integer| 
 +|''systemFan2Rpm'' |Rotational speed of system fan 1 |RPM|Integer| 
 +|''loraJoined'' |u.RECS successfully joined/connected to the TTN, which needs to be done after every reboot |-|Boolean| 
 +|''loraJoinEui'' |u.RECS LoRa Join EUI, always 0 for now |-|Integer | 
 +|''loraDevEui'' |u.RECS specific LoRa Dev EUI |-|Integer | 
 +|''loraAppKey'' |u.RECS specific, random generated LoRa App Key |-|Integer | 
 +|''loraVendorID'' |christmann specific LoRa vendor ID, FFFF for now |-|Hex | 
 +|''loraVendorProfileID'' |christmann u.RECS LoRa vendor profile ID, always 0001 |-|Hex 
 +|''loraRssi'' |Measured signal strength of the last recevied message (incl. join responses) |dBm|Integer 
 +|''poeDetectionStatusPort1'' |Raw status of the PoE detection status of Eth Port 1, please see [[doc_urecs:software_interface#poe_status_decoder|PoE status decoder]] on how to decode the status|-|Integer | 
 +|''poeDetectionStatusPort2'' |Raw status of the PoE detection status of Eth Port 2, please see [[doc_urecs:software_interface#poe_status_decoder|PoE status decoder]] on how to decode the status|-|Integer | 
 +|''firmwareVersion'' |Actual running firmware version |-|Hex |
  
 ==== System ==== ==== System ====
 +
 +The output of the ''/REST/system'' API call returns a combined output of ''/REST/node'' and ''/REST/baseboard'', which eases the monitoring of the whole system with one call.
  
 Example XML: Example XML:
Line 167: Line 191:
  
 The LoRaWAN interface allows up and downlink connections to an application server. The LoRaWAN interface allows up and downlink connections to an application server.
-Packets can be scheduled and collected by interfacing the Management REST API+Payload can be scheduled and collected by interfacing the Management REST API.
  
 ^ Attribute ^ Description ^ HTTP method ^ ^ Attribute ^ Description ^ HTTP method ^
-|''/lorawan/queue'' |Responds with incoming LoRaWAN packets linked to the API key in the request body XML|POST| +|''/lorawan/uplink/{fport}'' |Schedules uplink packet to the application endpoint for the specified fport|POST
-|''/lorawan/queue'' |Schedules uplink packet to the application server defined in the management interface XML|GET+|''/lorawan/downlink/{fport}'' |Responds with incoming downlink LoRaWAN messages for the specified fport|GET|
-|''/lorawan/manage'' |Manages LoRa PHY settings XML|GET|+
  
-Example XML queue GET / POST:+Example HTTP Body on GET request:
  
-<code xml><lorawan apikey="..."+<code xml><lorawan> 
-<packetbody>lora packet content in base64</packetbody>+  <payload>{custom lorawan payload}</payload> 
 +  <time>{timestamp}</time>
 </lorawan></code> </lorawan></code>
  
-Example XML manage:+Example HTTP Body on POST request:
  
-<code xml><lorawan masterkey="..."+<code xml><lorawan> 
-<band>eu</band> +  <payload>{custom lorawan payload}</payload>
-<txpwr>14</txpwr> +
-<txsf>7</txsf> +
-<rx2wsf>9</rx2wsf>+
 </lorawan></code> </lorawan></code>
  
-In order to remotely manage the RECS power status via LoRaWAN, the Application Server must send the downlink command payload in following format:+==== FPort ====
  
-<code xml> +The Frame Port (fport) separates different communication parties on the API, and functions as an identifyer for the message sender reciever. 
-<l masterkey=""> +When using the REST API, you are free to choose a value between 2 - 223. 
-  <power>1</power> +FPort 1 is reserved for the management controller.
-<l> +
-</code> +
- +
-The master and API keys are managed in the RECS web interface.+
  
 === Errors === === Errors ===
Line 205: Line 222:
 ==== LoRa Message ==== ==== LoRa Message ====
  
-The u.RECS supports to upstream LoRa messages to [[https://www.thethingsnetwork.org/|The Things Network (TTN)]]. The following table gives the LoRa message meaning of version 0.+The u.RECS supports upstream and downstream LoRa messages to [[https://www.thethingsnetwork.org/|The Things Network (TTN)]]. The following table gives the LoRa message meaning of version 0. 
 + 
 +All system related management communication (excluding the REST API) uses **FPort 1**.  
 + 
 +Upstream message payload layout:
  
 ^ Byte(s) ^ Description ^ Unit ^ Data type ^ ^ Byte(s) ^ Description ^ Unit ^ Data type ^
Line 225: Line 246:
 |26    | PoE Status Port 1 | - (see below) | Byte | |26    | PoE Status Port 1 | - (see below) | Byte |
 |27    | PoE Status Port 2 | - (see below) | Byte | |27    | PoE Status Port 2 | - (see below) | Byte |
 +
 +The u.RECS supports basic control functions over LoRaWAN.
 +Downstream message payloads:
 +
 +**Change power state for node:**
 +^ Byte(s) ^ Description ^ Unit ^ Data type ^
 +|0   | Lora Message-Version | - | Byte |
 +|1   | Node ID | - | Byte |
 +|2   | LoRa Command (0x01 = ON, 0x02 = OFF, 0x03 = RESET) | - | Byte |
 +
 +
 +
 +
 +
 +==== PoE status decoder ====
  
 Here is some C-Code to decode the PoE Status: Here is some C-Code to decode the PoE Status: