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

[fiware-stackoverflow] Fiware Error 400 on sending observations from public IDAS to orion context broker

    Details

      Description

      Created question in FIWARE Q/A platform on 04-11-2016 at 18:11
      Please, ANSWER this question AT http://stackoverflow.com/questions/40428336/fiware-error-400-on-sending-observations-from-public-idas-to-orion-context-broke

      Question:
      Fiware Error 400 on sending observations from public IDAS to orion context broker

      Description:
      we have used the figway to register devices in the global IDAS instance and we wanted to send observations which should be recieved by the IDAS and then sent to the context broker.
      Actually we faced a problem on the step of sending observations as we have firstly registered a device on the IDAS by executing RegisterDevice.py script and it was registered successfully But when we started executing sendObservation.py and provided it with the right parameter we received 400 error code for no reason . Here are the steps we've don explained accurately below:

      1- Firstly we configured the Config.ini properly this way

      [user]

      "#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 TOKE$"

      username=mostafa.h_2014@hotmail.com

      token=gsMVRbQP8oDnZLXCqPp5Xiv9zrc8l

      "#f7mk8B018wIWoFSpdyYsAX7gcbAHtj"

      [contextbroker]

      host=147.27.60.58

      port=1026

      OAuth=no

      "# Here you need to specify the ContextBroker database you are querying."

      "# 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

      fiware-service-path=/

      [idas]

      host=130.206.80.43

      adminport=4061

      ul20port=7896

      OAuth=no

      "# Here you need to configure the IDAS service your devices will be sending data to."

      "# By default the OpenIoT service is provided."

      "#fiware-service=OpenIoT"

      fiware-service=openiot

      fiware-service-path=/

      "#apikey=4jggokgpepnvsb2uv4s40d59ov"

      apikey=4jggokgpepnvsb2uv4s40d59ov
      [local]

      "#Choose here your System type. Examples: RaspberryPI, MACOSX, Linux, ..."

      host_type=RasspberryPI

      "# Here please add a unique identifier for you. Suggestion: the 3 lower hexa
      bytes of your Ethernet MAC. E.g. 79:ed:af"

      "# Also you may use your e-mail address."

      host_id=mostafa.h_2014@hotmail.com

      Chat Conversation End

      here we run sendObservation.py with providing the measurement manually

      pi@raspberrypi:~/fiware-figway/python-IDAS4/Sensors_UL20 $ python

      SendObservation.py NexusPro103 'temp|17'

      ...

      and this is the response we get

      • Status Code: 400
      • Response: {"name":"UNSUPPORTED_TYPE","message":"The request content didn't have the expected type [text/plain ]"}

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2016-11-04 21:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2016-11-04 21:05|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        ralli Carlos Ralli Ucendo added a comment -

        Hi,

        Those scripts are not updated to the new versions of the API. Unfortunaltely we have not produced those scripts for the new release. However, it is pretty simple to check the new APIs of the components at the FIWARE wiki and then adapat the python scripts on your own (hint: check the curl examples provided at the readthedocs documentation).

        Cheers,

        Show
        ralli Carlos Ralli Ucendo added a comment - Hi, Those scripts are not updated to the new versions of the API. Unfortunaltely we have not produced those scripts for the new release. However, it is pretty simple to check the new APIs of the components at the FIWARE wiki and then adapat the python scripts on your own (hint: check the curl examples provided at the readthedocs documentation). Cheers,

          People

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

            Dates

            • Created:
              Updated:
              Resolved: