Access Keys:
Skip to content (Access Key - 0)
 

HTTP Commands - Get Parameters

Guillaume Simon

On Mar 29, 2012 22:19

Hello

Thanks for your project. It's a very good job and i want to test it with my home automation installation.

I try to send HTTP commands on my Zwave Box to pilot lights. But when i add "?" in my url, i receive from the controller an error that the character is invalid.

What's wrong ?

Thanks in advance

Guillaume

 
Labels:
Participants: Marcus Redeker , pe zanstra , Guillaume Simon
  1. Mar 31, 2012

    Guillaume Simon says:

    I have do some tests. It's not the "?" the illegal char but the space. I have t...

    I have do some tests.
    It's not the "?" the illegal char but the space.

    I have this URL to pilot lights in the house : http://10.20.1.51/cgi-bin/domo.cgi?cmd=OFF%20A12

    I have try with the space, and with the encoding %20. Not working.

    Any idea ?
    Thanks

    1. Mar 31, 2012

      Marcus Redeker says:

      How is the URL written in the controller.xml file?

      How is the URL written in the controller.xml file?

      1. Apr 01, 2012

        Guillaume Simon says:

        <command id="100" protocol="http"> <property name="url" value="ht...

        <command id="100" protocol="http">
        <property name="url" value="http://10.20.1.51/cgi-bin/domo.cgi?cmd=ON A12" />
        <property name="name" value="Meuble TV ON" />
        </command>

        and here the log :

        java.lang.IllegalArgumentException: Illegal character in query at index 41: http://10.20.1.51/cgi-bin/domo.cgi?cmd=ON A12
        at java.net.URI.create(URI.java:859)
        at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:69)
        at org.openremote.controller.protocol.http.HttpGetCommand.requestURL(HttpGetCommand.java:171)
        at org.openremote.controller.protocol.http.HttpGetCommand.send(HttpGetCommand.java:136)
        at org.openremote.controller.service.impl.ControlCommandServiceImpl.trigger(ControlCommandServiceImpl.java:95)
        at org.openremote.controller.rest.ControlCommandRESTServlet.handleRequest(ControlCommandRESTServlet.java:77)
        at org.openremote.controller.rest.RESTAPI.doPost(RESTAPI.java:125)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.openremote.controller.rest.support.json.JSONCallbackFilter.doFilter(JSONCallbackFilter.java:63)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:354)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
        Caused by: java.net.URISyntaxException: Illegal character in query at index 41: http://10.20.1.51/cgi-bin/domo.cgi?cmd=ON A12
        at java.net.URI$Parser.fail(URI.java:2829)
        at java.net.URI$Parser.checkChars(URI.java:3002)
        at java.net.URI$Parser.parseHierarchical(URI.java:3092)
        at java.net.URI$Parser.parse(URI.java:3034)
        at java.net.URI.<init>(URI.java:595)
        at java.net.URI.create(URI.java:857)

        1. Apr 01, 2012

          Marcus Redeker says:

          Ok, thanks. Looks like the "blank" is the problem and we need to add a rewrite i...

          Ok, thanks.
          Looks like the "blank" is the problem and we need to add a rewrite in HttpGetCommand.
          I will take a look at that.

          1. Apr 03, 2012

            Marcus Redeker says:

            The HttpGetCommand needs an URI and that needs to have URL parameter to be encod...

            The HttpGetCommand needs an URI and that needs to have URL parameter to be encoded.
            I am using a differen URI constructor now which encodes the parameter.
            Please replace the 2 attached files at this location "openremote-controller/webapps/controller/WEB-INF/classes/org/openremote/controller/protocol/http" and give it a try.
            HttpGetCommandBuilder.class
            HttpGetCommand.class

  2. Apr 03, 2012

    Marcus Redeker says:

    Guillaume, besides me looking into the HttpGetCommand, maybe you are interested...

    Guillaume,

    besides me looking into the HttpGetCommand, maybe you are interested in beta testig our zwave support? Hopefully in the next 1-2 weeks, we will have a version that can be tested. What zwave device are you using in the moment? Do you have a USB zwave stick? I am currently using the AEON Z-Stick S2 for my tests.

    --Marcus

    1. Apr 18, 2012

      pe zanstra says:

      Marcus, I am interested to look into this as soon as I have my Z-stick (AEON) an...

      Marcus,
      I am interested to look into this as soon as I have my Z-stick (AEON) and Z-Wave switch. As soon as I get the grips on this I intend to get myself one of these Danfoss Living connect devices.
      Pieter

      Edit: Got the Danfoss Living Connect in the meantime.

      1. Apr 06, 2012

        Marcus Redeker says:

        Just let me know when you are ready and we can organize something. --Marcus

        Just let me know when you are ready and we can organize something.
        --Marcus

        1. Apr 06, 2012

          Guillaume Simon says:

          Hi there I'm using now a Zibase from Zodianet. I can pilot this trough TCP, UDP...

          Hi there

          I'm using now a Zibase from Zodianet. I can pilot this trough TCP, UDP or HTTP commands.

          Regards

          1. Apr 06, 2012

            Marcus Redeker says:

            Our upcoming zwave integration is based on the zwave serial protocol which needs...

            Our upcoming zwave integration is based on the zwave serial protocol which needs a zwave stick to communicate with the devices.

        2. Apr 06, 2012

          pe zanstra says:

          I suggest you to start a new thread for these testing purposes. (as a new user I...

          I suggest you to start a new thread for these testing purposes. (as a new user I found it difficult to cope with changes of topic within threads)

          1. Apr 06, 2012

            Marcus Redeker says:

            I will do an "official call for testers" and start a new thread when we are read...

            I will do an "official call for testers" and start a new thread when we are ready.

        3. Apr 09, 2012

          pe zanstra says:

          I have received the Z-stick and a plug adaptor (Duwi ZS 3500). I did a few exper...

          I have received the Z-stick and a plug adaptor (Duwi ZS 3500). I did a few experiments with installing and controlling the devices in ZWave.me (http://en.z-wave.me/). That is a nice environment to get acquainted with ZWave devices for a novice like me.
          So I am ready whenever you are. Don't hurry, I have enough to play and read in the meantime.

          1. Apr 09, 2012

            Marcus Redeker says:

            Ok, I will post upcoming information on Z-Wave testing here: http://www.openremo...

            Ok, I will post upcoming information on Z-Wave testing here: http://www.openremote.org/display/forums/Z-Wave+support+beta+testing

      2. Apr 19, 2012

        Marcus Redeker says:

        On Tuesday I spoke to Danfoss at the Light&Building fair in Frankfurt and th...

        On Tuesday I spoke to Danfoss at the Light&Building fair in Frankfurt and they want to help
        I will most likely get one device from them and some Z-Wave API documentation.

        1. Apr 19, 2012

          pe zanstra says:

          Hope they are really willing to invest time in helping you out. The guys from Ho...

          Hope they are really willing to invest time in helping you out. The guys from Homeseer have rather negative experiences (http://board.homeseer.com/showpost.php?p=985785&postcount=33). The remainder of that thread is also worthwhile to peruse.
          I do not want to scare you off. The Danfoss Radiator Valve Controller is an important device for energy conservation. I see quotes of possible energy savings in the range of 10-30% by smart heating-zone control.

    2. Apr 27, 2012

      pe zanstra says:

      Any news on availability of zwave beta for test

      Any news on availability of zwave beta for test

      1. Apr 27, 2012

        Marcus Redeker says:

        I will answer here: http://www.openremote.org/display/forums/Z-Wave+support+beta...
Adaptavist Theme Builder Powered by Atlassian Confluence