Announcement

Collapse
No announcement yet.

XPort Edge: Web API response does not recognize Line Protocol in the correct state

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • igough
    replied
    Ahh, that makes sense. I have tried it and that allows the Web API to recognize it as the correct state. Thank you very much.

    Leave a comment:


  • mariano
    replied
    If you change the Line Protocol from the CLI running on the Line, then the change is not immediate. This is to allow you to either make other changes, or to type "write" in order to save the change to flash (otherwise no permanent change of the protocol would be possible from the CLI).

    So the CLI is still running on the Line, which means that you can't use the WebAPI. If you exit from the CLI (have the MCU send: exit\rexit\rexit\r after changing the protocol), then the Line status will be "None", and you should be able to use the WebAPI to send/receive data.

    Leave a comment:


  • XPort Edge: Web API response does not recognize Line Protocol in the correct state

    I am trying to use the Web API to send commands to an MPU on the serial side. The MPU configures the Line 1 as 115200 8N1 and sets its protocol from CLI to None. The Edge web page shows the Line 1 protocol as None. Accessing the Line config via the Web API shows that it too believes that the line protocol is None.
    Code:
    $ curl --digest -u admin:PASSWORD http://192.168.71.215/export/config -X POST -d "optionalGroupList=Line"
    <?xml version="1.0" standalone="yes"?>
    <!-- Automatically generated XML -->
    <!DOCTYPE configrecord [
       <!ELEMENT configrecord (configgroup+)>
       <!ELEMENT configgroup (configitem+)>
       <!ELEMENT configitem (value+)>
       <!ELEMENT value (#PCDATA)>
       <!ATTLIST configrecord version CDATA #IMPLIED>
       <!ATTLIST configgroup name CDATA #IMPLIED>
       <!ATTLIST configgroup instance CDATA #IMPLIED>
       <!ATTLIST configitem name CDATA #IMPLIED>
       <!ATTLIST configitem instance CDATA #IMPLIED>
       <!ATTLIST value name CDATA #IMPLIED>
    ]>
    <configrecord version = "0.1.0.1">
       <configgroup name = "Line" instance = "1">
          <configitem name = "Name">
             <value></value>
          </configitem>
          <configitem name = "Interface">
             <value>RS232</value>
          </configitem>
          <configitem name = "State">
             <value>Enabled</value>
          </configitem>
          <configitem name = "Protocol">
             <value>None</value>
          </configitem>
          <configitem name = "Baud Rate">
             <value>115200 bits per second</value>
          </configitem>
          <configitem name = "Parity">
             <value>None</value>
          </configitem>
          <configitem name = "Data Bits">
             <value>8</value>
          </configitem>
          <configitem name = "Stop Bits">
             <value>1</value>
          </configitem>
          <configitem name = "Flow Control">
             <value>Software</value>
          </configitem>
          <configitem name = "Xon Char">
             <value>&lt;control&gt;Q</value>
          </configitem>
          <configitem name = "Xoff Char">
             <value>&lt;control&gt;S</value>
          </configitem>
          <configitem name = "Gap Timer">
             <value>&lt;Four Character Periods&gt;</value>
          </configitem>
          <configitem name = "Threshold">
             <value>56 bytes</value>
          </configitem>
          <configitem name = "Push">
             <value></value>
          </configitem>
       </configgroup>
    ...
    And yet, if I attempt to transmit text to the serial port using the Web API, it complains that the Line interface must be None. I suspect this is a poor error message and the actual problem is elsewhere, but without the proper feedback I don't know where to look next.

    Code:
    $ curl --digest -u admin:PASSWORD -X POST -d "group=Line&optionalGroupInstance=1&optionalItem=Transmitter&action=Transmit set %2Fucsp%2Fpower 1" http://192.168.71.215/action/status
    <?xml version="1.0" standalone="yes"?>
    <!-- Automatically generated XML -->
    <!DOCTYPE function [
       <!ELEMENT function (return)>
       <!ELEMENT return (result,message+)>
       <!ELEMENT result (#PCDATA)>
       <!ELEMENT message (#PCDATA)>
       <!ATTLIST function version CDATA #IMPLIED>
    ]>
    <function version = "0.1.0.0">
       <return>
          <message>ERROR: Line Protocol must be &quot;None&quot;.</message>
          <result>Failed</result>
       </return>
    </function>
Working...
X