Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-9152

[fiware-stackoverflow] No JSON object could be decoded- orion context broker

    Details

      Description

      Created question in FIWARE Q/A platform on 14-04-2015 at 15:04
      Please, ANSWER this question AT https://stackoverflow.com/questions/29628587/no-json-object-could-be-decoded-orion-context-broker

      Question:
      No JSON object could be decoded- orion context broker

      Description:
      I am trying out orion context broker comunication on two CentOS 6.6 machines. On the target machine I did:

      ./accumulator-server.py 1028 /accumulate mywebpage.lan on

      And on my local machine I did:

      [DevF12@localhost ~]$ (curl mywebpage.lan:1028/v1/updateContext s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @ | python -mjson.tool ) <<EOF
      > {
      > "contextElements": [
      > {
      > "type": "Room",
      > "isPattern": "false",
      > "id": "Room2",
      > "attributes": [
      >

      { > "name": "temperature", > "type": "float", > "value": "777" > }

      ,
      >

      { > "name": "pressure", > "type": "integer", > "value": "711" > }

      > ]
      > }
      > ],
      > "updateAction": "APPEND"
      > }
      > EOF

      The result on the target machine is:

      POST http://mywebpage.lan:1028/v1/updateContext
      Content-Length: 456
      User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
      Host: mywebpage.lan:1028
      Accept: application/json
      Content-Type: application/json

      { "contextElements": [ { "type": "Room", "isPattern": "false", "id": "Room2", "attributes": [

      { "name": "temperature", "type": "float", "value": "777" }

      ,

      { "name": "pressure", "type": "integer", "value": "711" }

      ] } ], "updateAction": "APPEND"}=======================================

      192.168.1.11 - - [14/Apr/2015 15:07:36] "POST /v1/updateContext HTTP/1.1" 200 -

      And the message I get from the local machine is:

      No JSON object could be decoded

      So, what does this all mean?

      1. Is the 200 code saying that it is successfully creating Room2?

      2. Why am I getting the could not decode JSON then?

      3. All of this brings up another question, does this mean that the weather station described in my previous post also has to run on CentOS in order to send context broker messages?

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        fla Fernando Lopez made changes -
        HD-Enabler Orion [ 10875 ]
        Description
        Created question in FIWARE Q/A platform on 14-04-2015 at 15:04
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/29628587/no-json-object-could-be-decoded-orion-context-broker


        +Question:+
        No JSON object could be decoded- orion context broker

        +Description:+
        I am trying out orion context broker comunication on two CentOS 6.6 machines. On the target machine I did:

        ./accumulator-server.py 1028 /accumulate mywebpage.lan on


        And on my local machine I did:

        [DevF12@localhost ~]$ (curl mywebpage.lan:1028/v1/updateContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool ) &lt;&lt;EOF
        &gt; {
        &gt; "contextElements": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room2",
        &gt; "attributes": [
        &gt; {
        &gt; "name": "temperature",
        &gt; "type": "float",
        &gt; "value": "777"
        &gt; },
        &gt; {
        &gt; "name": "pressure",
        &gt; "type": "integer",
        &gt; "value": "711"
        &gt; }
        &gt; ]
        &gt; }
        &gt; ],
        &gt; "updateAction": "APPEND"
        &gt; }
        &gt; EOF


        The result on the target machine is:

        POST http://mywebpage.lan:1028/v1/updateContext
        Content-Length: 456
        User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
        Host: mywebpage.lan:1028
        Accept: application/json
        Content-Type: application/json

        { "contextElements": [ { "type": "Room", "isPattern": "false", "id": "Room2", "attributes": [ { "name": "temperature", "type": "float", "value": "777" }, { "name": "pressure", "type": "integer", "value": "711" } ] } ], "updateAction": "APPEND"}=======================================

        192.168.1.11 - - [14/Apr/2015 15:07:36] "POST /v1/updateContext HTTP/1.1" 200 -


        And the message I get from the local machine is:

        No JSON object could be decoded


        So, what does this all mean?

        1. Is the 200 code saying that it is successfully creating Room2?

        2. Why am I getting the could not decode JSON then?

        3. All of this brings up another question, does this mean that the weather station described in my previous post also has to run on CentOS in order to send context broker messages?
        Created question in FIWARE Q/A platform on 14-04-2015 at 15:04
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/29628587/no-json-object-could-be-decoded-orion-context-broker


        +Question:+
        No JSON object could be decoded- orion context broker

        +Description:+
        I am trying out orion context broker comunication on two CentOS 6.6 machines. On the target machine I did:

        ./accumulator-server.py 1028 /accumulate mywebpage.lan on


        And on my local machine I did:

        [DevF12@localhost ~]$ (curl mywebpage.lan:1028/v1/updateContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool ) &lt;&lt;EOF
        &gt; {
        &gt; "contextElements": [
        &gt; {
        &gt; "type": "Room",
        &gt; "isPattern": "false",
        &gt; "id": "Room2",
        &gt; "attributes": [
        &gt; {
        &gt; "name": "temperature",
        &gt; "type": "float",
        &gt; "value": "777"
        &gt; },
        &gt; {
        &gt; "name": "pressure",
        &gt; "type": "integer",
        &gt; "value": "711"
        &gt; }
        &gt; ]
        &gt; }
        &gt; ],
        &gt; "updateAction": "APPEND"
        &gt; }
        &gt; EOF


        The result on the target machine is:

        POST http://mywebpage.lan:1028/v1/updateContext
        Content-Length: 456
        User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
        Host: mywebpage.lan:1028
        Accept: application/json
        Content-Type: application/json

        { "contextElements": [ { "type": "Room", "isPattern": "false", "id": "Room2", "attributes": [ { "name": "temperature", "type": "float", "value": "777" }, { "name": "pressure", "type": "integer", "value": "711" } ] } ], "updateAction": "APPEND"}=======================================

        192.168.1.11 - - [14/Apr/2015 15:07:36] "POST /v1/updateContext HTTP/1.1" 200 -


        And the message I get from the local machine is:

        No JSON object could be decoded


        So, what does this all mean?

        1. Is the 200 code saying that it is successfully creating Room2?

        2. Why am I getting the could not decode JSON then?

        3. All of this brings up another question, does this mean that the weather station described in my previous post also has to run on CentOS in order to send context broker messages?
        HD-Chapter Data [ 10838 ]
        fla Fernando Lopez made changes -
        Assignee Fermín Galán [ fermin ]
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: