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

[fiware-stackoverflow] Having trouble with the user programers guide

    Details

      Description

      Created question in FIWARE Q/A platform on 08-04-2015 at 10:04
      Please, ANSWER this question AT https://stackoverflow.com/questions/29510204/having-trouble-with-the-user-programers-guide

      Question:
      Having trouble with the user programers guide

      Description:
      I am doing the excercise on this site. I have followed the example exactly and without any problem until I got to Context subscriptions:

      (curl localhost:1026/v1/subscribeContext s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @ | python -mjson.tool) <<EOF
      {
      "entities": [

      { "type": "Room", "isPattern": "false", "id": "Room1" }

      ],
      "attributes": [
      "temperature"
      ],
      "reference": "http://localhost:1028/accumulate",
      "duration": "P1M",
      "notifyConditions": [

      { "type": "ONTIMEINTERVAL", "condValues": [ "PT10S" ] }

      ]
      }
      EOF

      When I type that code, I get the expected answer:

      {
      "subscribeResponse":

      { "duration": "P1M", "subscriptionId": "51c04a21d714fb3b37d7d5a7" }

      }

      But then this sentence confuses me:

      If you look at the accumulator-script.py terminal window, you will see
      that a message resembling the following one is received each 10
      seconds:

      What I do here is enter this command: python accumulator-server.py
      But the output (updated every 10 seconds) I get is: 127.0.0.1 - - [08/Apr/2015 10:52:56] "POST /accumulate HTTP/1.1" 200 -

      Am I missing something here since Im not getting the expected output simmilar like the one mentioned in the tutorial?

      POST http://localhost:1028/accumulate
      Content-Length: 492
      User-Agent: orion/0.9.0
      Host: localhost:1028
      Accept: application/xml, application/json
      Content-Type: application/json

      {
      "subscriptionId" : "51c04a21d714fb3b37d7d5a7",
      "originator" : "localhost",
      "contextResponses" : [
      {
      "contextElement" : {
      "attributes" : [

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

      ],
      "type" : "Room",
      "isPattern" : "false",
      "id" : "Room1"
      },
      "statusCode" :

      { "code" : "200", "reasonPhrase" : "OK" }

      }
      ]
      }

      Am I not running the python script correctly or? Btw I'm new to both python and linux...

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        3h 1 Backlog Manager 27/May/17 3:04 PM
        In Progress In Progress Answered Answered
        2h 59m 1 Backlog Manager 27/May/17 6:04 PM
        Answered Answered Closed Closed
        1d 13h 50m 1 Fernando Lopez 29/May/17 7:54 AM
        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 08-04-2015 at 10:04
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/29510204/having-trouble-with-the-user-programers-guide


        +Question:+
        Having trouble with the user programers guide

        +Description:+
        I am doing the excercise on this site. I have followed the example exactly and without any problem until I got to Context subscriptions:

        (curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        {
            "entities": [
                {
                    "type": "Room",
                    "isPattern": "false",
                    "id": "Room1"
                }
            ],
            "attributes": [
                "temperature"
            ],
            "reference": "http://localhost:1028/accumulate",
            "duration": "P1M",
            "notifyConditions": [
                {
                    "type": "ONTIMEINTERVAL",
                    "condValues": [
                        "PT10S"
                    ]
                }
            ]
        }
        EOF


        When I type that code, I get the expected answer:

        {
            "subscribeResponse": {
                "duration": "P1M",
                "subscriptionId": "51c04a21d714fb3b37d7d5a7"
            }
        }


        But then this sentence confuses me:


          If you look at the accumulator-script.py terminal window, you will see
          that a message resembling the following one is received each 10
          seconds:


        What I do here is enter this command: python accumulator-server.py
        But the output (updated every 10 seconds) I get is: 127.0.0.1 - - [08/Apr/2015 10:52:56] "POST /accumulate HTTP/1.1" 200 -

        Am I missing something here since Im not getting the expected output simmilar like the one mentioned in the tutorial?

        POST http://localhost:1028/accumulate
        Content-Length: 492
        User-Agent: orion/0.9.0
        Host: localhost:1028
        Accept: application/xml, application/json
        Content-Type: application/json

        {
          "subscriptionId" : "51c04a21d714fb3b37d7d5a7",
          "originator" : "localhost",
          "contextResponses" : [
            {
              "contextElement" : {
                "attributes" : [
                  {
                    "name" : "temperature",
                    "type" : "float",
                    "value" : "26.5"
                  }
                ],
                "type" : "Room",
                "isPattern" : "false",
                "id" : "Room1"
              },
              "statusCode" : {
                "code" : "200",
                "reasonPhrase" : "OK"
              }
            }
          ]
        }


        Am I not running the python script correctly or? Btw I'm new to both python and linux...
        Created question in FIWARE Q/A platform on 08-04-2015 at 10:04
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/29510204/having-trouble-with-the-user-programers-guide


        +Question:+
        Having trouble with the user programers guide

        +Description:+
        I am doing the excercise on this site. I have followed the example exactly and without any problem until I got to Context subscriptions:

        (curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool) &lt;&lt;EOF
        {
            "entities": [
                {
                    "type": "Room",
                    "isPattern": "false",
                    "id": "Room1"
                }
            ],
            "attributes": [
                "temperature"
            ],
            "reference": "http://localhost:1028/accumulate",
            "duration": "P1M",
            "notifyConditions": [
                {
                    "type": "ONTIMEINTERVAL",
                    "condValues": [
                        "PT10S"
                    ]
                }
            ]
        }
        EOF


        When I type that code, I get the expected answer:

        {
            "subscribeResponse": {
                "duration": "P1M",
                "subscriptionId": "51c04a21d714fb3b37d7d5a7"
            }
        }


        But then this sentence confuses me:


          If you look at the accumulator-script.py terminal window, you will see
          that a message resembling the following one is received each 10
          seconds:


        What I do here is enter this command: python accumulator-server.py
        But the output (updated every 10 seconds) I get is: 127.0.0.1 - - [08/Apr/2015 10:52:56] "POST /accumulate HTTP/1.1" 200 -

        Am I missing something here since Im not getting the expected output simmilar like the one mentioned in the tutorial?

        POST http://localhost:1028/accumulate
        Content-Length: 492
        User-Agent: orion/0.9.0
        Host: localhost:1028
        Accept: application/xml, application/json
        Content-Type: application/json

        {
          "subscriptionId" : "51c04a21d714fb3b37d7d5a7",
          "originator" : "localhost",
          "contextResponses" : [
            {
              "contextElement" : {
                "attributes" : [
                  {
                    "name" : "temperature",
                    "type" : "float",
                    "value" : "26.5"
                  }
                ],
                "type" : "Room",
                "isPattern" : "false",
                "id" : "Room1"
              },
              "statusCode" : {
                "code" : "200",
                "reasonPhrase" : "OK"
              }
            }
          ]
        }


        Am I not running the python script correctly or? Btw I'm new to both python and linux...
        HD-Chapter Data [ 10838 ]
        fla Fernando Lopez made changes -
        Assignee Fermín Galán [ fermin ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-27 18:05|UPDATED status: transition Answered| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-27 18:05|UPDATED status: transition Answered| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-27 15:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-27 15:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        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 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-27 12:05|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-27 12:05|CREATED monitor | # answers= 1, accepted answer= True
        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: