[Fiware-lab-help] Fwd: Fiware cphues error

ahmad essam ahmad.elsayfy at gmail.com
Wed Mar 15 19:29:43 CET 2017


---------- Forwarded message ----------
From: ahmad essam <ahmad.elsayfy at gmail.com>
Date: Wed, Mar 15, 2017 at 8:22 PM
Subject: Fiware cphues error
To: jira-help-desk at jira.fiware.org


hello

since using  fiware cephues  i follow  the Document i  send  the
configration file which is

{
        "host":"http://localhost:8080",
"in":[
    {
      "id":"Lab.*",
      "type":"Lab",
      "isPattern": true,
      "attributes":[
        { "name":"motion", "type":"double","metadata": [
            { "name":"unit", "type":"string" }
          ] }
    , { "name":"priority", "type":"double","metadata": [
            { "name":"unit", "type":"string" }
          ] },

{ "name":"controller", "type":"string"}],

      "providers":[
        "http://localhost:8081"
      ]
    }
  ],

"out":[
    {
      "id":"ControllerX",
      "type":"Controller",
      "attributes":[

    {  "name":"switch", "type":"command"
          ,"metadata": [
            { "name":"unit", "type":"string" }
          ]
       }
,
          {  "name":"number", "type":"double"
          ,"metadata": [
            { "name":"unit", "type":"string" }
          ]  }

]

,

      "brokers":[
        {
          "url":"http://147.27.60.58:1026",
          "serviceName": "try1",
          "servicePath": "/try1",
          "authToken": "token"
        }
      ]
    }
  ],
"statements":[

    " INSERT INTO Controller  SELECT controller as id  , 'ON' as switch,
(CASE  WHEN (C is null AND motion = 1) THEN 1 WHEN (C is null AND motion =
3) THEN 0 WHEN (C is not null AND motion = 1) THEN C.number+1 WHEN (motion
= 0 AND C.number >= 1) THEN C.number-1 ELSE C.number END) as number FROM
Lab as  L unidirectional LEFT OUTER JOIN
Controller.std:groupwin(id).std:lastevent()
as C ON controller=C.id  GROUP BY controller HAVING (priority = 0 AND
motion = 1) or (priority = 1) or (priority = 0 AND motion = 3 AND C.number
> 0)   "
,


" INSERT INTO Controller  SELECT controller as id  ,C.switch as switch,
C.number-1  as number  FROM  Lab as  L unidirectional LEFT OUTER JOIN
Controller.std:groupwin(id).std:lastevent() as C ON controller=C.id  GROUP
BY controller  HAVING motion = 0 AND C.number > 1 AND (priority=0) "

 ,

 " INSERT INTO Controller  SELECT controller as id ,  'OFF'  as switch
,(CASE WHEN (motion = 0 AND C.number >= 1) THEN C.number-1 WHEN (motion=1
AND C is null) THEN 1 WHEN (C is null AND motion = 3) THEN 0 WHEN (motion =
1 AND C is not null) THEN C.number+1 ELSE C.number END) as number FROM  Lab
as L unidirectional LEFT OUTER JOIN Controller.std:groupwin(id).std:lastevent()
as C ON controller=C.id GROUP BY controller HAVING (priority = 0 AND
C.number = 1 AND motion = 0 ) or (priority = 2)  or (priority = 0 AND
motion = 3 AND C.number = 0)
"

    ]
}

and  its  successfuly  sent with  status code 200

but  when sending update

(curl 194.177.207.78:8081/v1/updateContext/ -s -S --header 'Content-Type:
application/json' \
 --header 'Accept: application/json' -d @- | python -mjson.tool ) <<EOF

    { "contextElements": [
            {
                "type": "Lab",
                "isPattern": "false",
                "id": "FCI-Lab",
                "attributes": [
                       {
                        "name": "motion",
                        "type": "double",
                        "value": 1
                    },

                                        {
                        "name": "priority",
                        "type": "double",
                        "value": 0
                    },

                       {
                        "name": "controller",
                        "type": "string",
                        "value": "Controller12"
                    }
                ]
            }
        ],
        "updateAction": "UPDATE"
    }
EOF

I cant find  entity  in  context brocker
when checking  Cepheus-cep logs  i  got

2017-03-15 18:04:45.871  INFO 1059 --- [http-nio-8080-exec-8]
c.o.cepheus.cep.EsperEventProcessor      : EventIn: Event{type='Lab',
values={cont$
2017-03-15 18:04:45.872  INFO 1059 --- [http-nio-8080-exec-8]
c.orange.cepheus.cep.EventSinkListener   : EventOut: Controller /
number_unit:null$
2017-03-15 18:04:45.888  WARN 1059 --- [I/O dispatcher 2]
o.s.web.client.AsyncRestTemplate
: Async POST request for "http://147.27.60.58$
2017-03-15 18:04:45.888  WARN 1059 --- [I/O dispatcher 2]
c.orange.cepheus.cep.EventSinkListener   : UpdateContext failed for
http://147.27.60.5$
2017-03-15 18:08:53.941  INFO 1059 --- [http-nio-8080-exec-10]
c.o.cepheus.cep.EsperEventProcessor      : EventIn: Event{type='Lab',
values={con$
2017-03-15 18:08:53.943  INFO 1059 --- [http-nio-8080-exec-10]
c.orange.cepheus.cep.EventSinkListener   : EventOut: Controller /
number_unit:nul$
2017-03-15 18:08:53.962  WARN 1059 --- [I/O dispatcher 2]
o.s.web.client.AsyncRestTemplate
: Async POST request for "http://147.27.60.58$
2017-03-15 18:08:53.962  WARN 1059 --- [I/O dispatcher 2]
c.orange.cepheus.cep.EventSinkListener   : UpdateContext failed for
http://147.27.60.5$

017-03-15 18:09:05.417  WARN 1059 --- [I/O dispatcher 2]
o.s.web.client.AsyncRestTemplate
: Async POST request for "http://147.27.60.58$
$7.60.58:1026: org.springframework.web.client.HttpClientErrorException: 415
Unsupported Media Type
2017-03-15 18:09:39.377  INFO 1059 --- [taskScheduler-1]
c.o.cepheus.cep.SubscriptionManager
: Launch of the periodic subscription task at $
2017-03-15 18:14:39.378  INFO 1059 --- [taskScheduler-1]
c.o.cepheus.cep.SubscriptionManager
: Launch of the periodic subscription task at $

what  shall i  do  we  really need  help as  fast as possible
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-lab-help/attachments/20170315/00793ff1/attachment.html>


More information about the Fiware-lab-help mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy