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

FIWARE.Question.Tech.IoT.IDAS.Create entity in a service using IDAS and ContextBroker

    Details

      Description

      Created question in FIWARE Q/A platform on 23-04-2015 at 18:04
      Please, ANSWER this question AT http://stackoverflow.com/questions/29829266/create-entity-in-a-service-using-idas-and-contextbroker

      Question:
      Create entity in a service using IDAS and ContextBroker

      Description:
      So I'm having some problems connection virtual devices to the contextBroker and i thing it's because of the Fiware-Service. I don't want to use the OpenIoT (even though that didn't worked for me either). I didn't manage to find any documentation about service creation and maybe i'm creating it wrong.

      I did Python CreateService bus_auto 4jggokgpepnvsb2uv4s40d59ovand i'm not sure it returns me 201. I updated the config.ini file to work on MY service but when i send the observations it doesn't change the value of the entity on the contextBroker

      I'm now running it in

      My config.ini file:

      [user]

      1. Please, configure here your username at FIWARE Cloud and a valid Oauth2.0 TOKEN for your user (you can use get_token.py to obtain a valid TOKEN).
        username=
        token=NULL

      [contextbroker]
      host=127.0.0.1
      port=1026
      OAuth=no

      1. Here you need to specify the ContextBroker database you are querying.
      2. Leave it blank if you want the general database or the IDAS service if you are looking for IoT devices connected by you.
        fiware_service=bus_auto

      [idas]
      host=130.206.80.40
      adminport=5371
      ul20port=5371
      OAuth=no

      1. Here you need to configure the IDAS service your devices will be sending data to.
      2. By default the OpenIoT service is provided.
        fiware-service=bus_auto
        fiware-service-path=/
        apikey=4jggokgpepnvsb2uv4s40d59ov

      [local]
      #Choose here your System type. Examples: RaspberryPI, MACOSX, Linux, ...
      host_type=CentOS

      1. Here please add a unique identifier for you. Suggestion: the 3 lower hexa bytes of your Ethernet MAC. E.g. 79:ed:af
      2. Also you may use your e-mail address.
        host_id=db:00:ff

      I'm using the python script GetEntity.py:

      python2.7 GetEntity.py bus_auto_2

      I also tried using a python script that i created:

      import json
      import urllib
      import urllib2

      BASE_URL = 'http://127.0.0.1:1026'
      QUERY_URL = BASE_URL+'/v1/queryContext'

      HEADERS = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
      }

      QUERY_EXAMPLE = {
      "entities": [

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

      ]
      }

      def post(url, data):
      """"""
      req = urllib2.Request(url, data, HEADERS)
      f = urllib2.urlopen(req)
      result = json.loads(f.read())
      f.close()
      return result

      if _name_ == "_main_":
      print post(UPDATE_URL, json.dumps(UPDATE_EXAMPLE))
      print post(QUERY_URL, json.dumps(QUERY_EXAMPLE))

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-25 12:05|CREATED monitor | # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-25 12:05|CREATED monitor | # answers= 2, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-25 15:05|UPDATED status: transition Answer| # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-25 15:05|UPDATED status: transition Answer| # answers= 2, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-25 18:05|UPDATED status: transition Answered| # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-25 18:05|UPDATED status: transition Answered| # answers= 2, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-29 09:05|UPDATED status: transition Finish| # answers= 2, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-29 09:05|UPDATED status: transition Finish| # answers= 2, accepted answer= True

          People

          • Assignee:
            ralli Carlos Ralli Ucendo
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: