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

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2h 59m 1 Backlog Manager 23/May/17 3:04 AM
        In Progress In Progress Answered Answered
        3h 1 Backlog Manager 23/May/17 6:04 AM
        Answered Answered Closed Closed
        6d 1h 36m 1 Fernando Lopez 29/May/17 7:41 AM

          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: