Jump to content

Welcome, Guest!

Be a part of CinemaVision today! Once registered and logged in, you will have access to public chat and your own private messenger, you can view and contribute guides, collaborate on the forums, review downloads, give reputation to your fellow members, contribute content and so much more. Registering is quick and completely free, so what are you waiting for?
   Sign In    Sign Up

Become a RedCarpet Club Member Today!

   Join Now
  • 0
Guest xbmcgotham

code handling of "Carriage Returns"

Question

Guest xbmcgotham

Hi, was wondering. How does the code handle "Carriage Returns"?

For example I will need to add the following serial command into the action script:

"HTTP POST"... For the URL: http:///api/host/modules/1/ports/1/data

And this is the "body" where the following serial data must be used:

*pow=on#

Would it just be like this?

# URL
http:///api/host/modules/1/ports/1/data
# Body
*pow=on#

Or does the script need a different input to be able to send the correct serial command?

Thanks for the info.

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
3 hours ago, xbmcgotham said:

Hi, was wondering. How does the code handle "Carriage Returns"?

For example I will need to add the following serial command into the action script:

"HTTP POST"... For the URL: http:///api/host/modules/1/ports/1/data

And this is the "body" where the following serial data must be used:

*pow=on#

Would it just be like this?

# URL
http:///api/host/modules/1/ports/1/data
# Body
*pow=on#

Or does the script need a different input to be able to send the correct serial command?

Thanks for the info.

From what you said, it sounds like it needs a POST to that address. Try this:

# This command powers on something, I'm not sure what
http:///api/host/modules/1/ports/1/data
POST:{*pow=on#}

Does Homewizard have any API documentation? We might be able to help more if we knew what you were trying to do, and what the documentation outlined. :)

Share this post


Link to post
Share on other sites
  • 0
Guest xbmcgotham

Hi,

 

Thanks for helping.

I tried the code, however no activity. The response I get from the "Parser Messenger":

 

VALIDATE (ProjectorON.cvaction):

OK

TEST (ProjectorON.cvaction):

Action (HTTP) URL: http://<localip>/api/host/modules/1/ports/1/data
Action (HTTP) Response:
  

 

In this case its not the Homewizard that is requested to handle to command but the BenQ TH670s Projector through its RS232 serial cable connected to the network using a Global Cache iTach Flex device (http://www.globalcache.com/products/itachflex/). I have taken the correct code for switching ON the projector through the serial interface from the attached file (3. Command Table) and tested the same code using the Flex iTest (http://www.globalcache.com/downloads/) software which can be use to test if a command is correct and if it works. In my case the iTest worked perfect with the code and was able to switch on the projector through the Flex device.

So, my challenge is to find the correct way of inserting the serial command into the cinema vision action script so that it is able to send the same command to the projector.

Hope their are any other ideas. :-)

 

Thanks again.

 

 

benq_rs232_commands-1.pdf

Share this post


Link to post
Share on other sites
  • 0

Hi guys,

I am getting stuck here. Please help me solve this very easy problem. :-)

I have had detailed contact with the code developer of the hardware tool Cinemavision is talking to.

We identified that the problem is with the way the automation script within CinemaVision is executing the given code trigger in the body.

Below I will show you what code is used to succesfully excecute the "Switch Projector ON" trigger through a REST Client (https://www.getpostman.com):

 

On the attached screenshot (Postman) you can see the REST Client instruction we excecute.

On the attached screenshot (Powon) you can see the body code that is executed to switch on the projector. Please pay attention to the CR in the shown code. The CR is needed to have the execution be successful.

We tried everything within the "action file", however none of the changes we made was succefull in switching on the projector.

This is the response/question the developer had for CinemaVision developer:

Quote

"Can a non-ASCII control character be sent in the body of the POST request. If Yes, then how do we do this for a CR. If No, they should consider adding this little functionality in the code as its fairly standard and widely used within home automation systems"

Can someone please help fix this problem as its the last thing needed to integrate the home cinema. :-)

 

Thanks guys, appreciated!

 

postman.png

powon.png

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, xbmcgotham2014 said:

Hi guys,

I am getting stuck here. Please help me solve this very easy problem. :-)

I have had detailed contact with the code developer of the hardware tool Cinemavision is talking to.

We identified that the problem is with the way the automation script within CinemaVision is executing the given code trigger in the body.

Below I will show you what code is used to succesfully excecute the "Switch Projector ON" trigger through a REST Client (https://www.getpostman.com):

 

On the attached screenshot (Postman) you can see the REST Client instruction we excecute.

On the attached screenshot (Powon) you can see the body code that is executed to switch on the projector. Please pay attention to the CR in the shown code. The CR is needed to have the execution be successful.

We tried everything within the "action file", however none of the changes we made was succefull in switching on the projector.

This is the response/question the developer had for CinemaVision developer:

Can someone please help fix this problem as its the last thing needed to integrate the home cinema. :-)

 

Thanks guys, appreciated!

 

postman.png

powon.png

Turns out, I totally forgot to reply to you. Dang.

So long story short, we don't have the ability to do this built into Actions currently. It's been put on the list of features to add in our next round of development. You might be able to accomplish this via Python script, and use the Action to call that Python script.

When we wrote the way Action syntax works, we didn't know that some manufacturers used methods like this. :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines and Terms of Use.