Terminalschnittstelle and i-rule remote control

Alles was nicht direkt mit dem normalen Verhalten des PC_DIMMERs zu tun hat
Antworten
dutch_anykey
Leuchtmittelaustauscher
Beiträge: 25
Registriert: 17.02.2010, 21:24

Terminalschnittstelle and i-rule remote control

Beitrag von dutch_anykey »

Good evening.
Sorry I have to do this in english, my german writing is still below acceptable limit :oops:

Last carnaval was a succes again. complete parade wagon powered by pc_dimmer again :clap:
But now I found myself another challenge again. I'm also a home cinema enthousiast. (For the insiders, I'm a proud owner of a barco 1208 CRT projector.....yep old style, but full HD) My home cinema is a ongoing WIP. One day I will move all my equipment to a dedicated room.
But for the challenge now...I want to automate my room lightning. I.e. when I pauze a movie I want the lights to slowly go on and vice versa.
Also in the future i want to move my screen up and down and so on. Since I already have a lot of DMX equipment, what better way to do it then use DMX with pcdimmer :D
The tricky part is to use it with I-rule application. In short, this is a remote control application that can be fully customized. The remote control unit can be an Android or IOS unit. At this moment i'm using an old ipad 1 as remote control.
At this point I already achieved that I can control all my media players, htpc, sound, with this application. It is capable of sending IR (via global cache unit), Serial and IP commands.

Nice till so far. Next step is to use the pcdimmer "terminalschnittstelle" to send IP commands from i-rule to pcdimmer.
After one day of trying and lots of reading here in the forums I finally decided to write here and ask for help.

What I have done so far:
Enabled "activate terminal" (port 10160)
ran some test commands with the pcdimmer_CMD.exe and with the test tool "form1" provided in the wiki pages.
These two programs do the job. So the tricky part would be to have i-rule send the command to this port. And this is where i'm stuck.
I'm pretty sure that i-rule is sending the command. I even used wireshark to sniff the ip packets. I will include the screenshots later on. I compared the working packets that were send with the test program and the packet that were send with the i-rule application. I can see no big difference, allthough I know the details are the problem here offcourse.

I have read a lot here on the wiki pages, but still a few things that I can not wrap my head around...
- The commands have to be send as text via ip on port 10160. But what is the protocol behind it? Http, telnet? or something else?
- Can the commands be send via http? (I was assuming that the http interface is only for the pcdimmer remote control gui, I mean the one that is on another port nr. not 10160)
- Can someone give me an example of what is really send, is there a specific pre-fix needed?

This is what i sent via i-rule:
set_absolutchannel 2 -1 0 3000 0

The ip adress and portnumber is given elswere in the application. So i-rule is always sending to the ip:port "set_absolutchannel 2 -1 0 3000 0"

Help is welcome,

kind regards,
Maurice
Ingo
< PC_DIMMER >
Beiträge: 544
Registriert: 19.03.2009, 17:49
Wohnort: Bad Hersfeld bzw. Stuttgart

Re: Terminalschnittstelle and i-rule remote control

Beitrag von Ingo »

Hello Maurice,

so far this looks quite good. I can just mention some points you might take care of:
  • The commands have to be sent via TCP/IP. Make sure you're using that low level protocol, without anything else (http and others are higher level)
  • You might have missed to terminate the command with \r\n (bytes 13 and 10), at least in the example application it is used ("WriteLn" means write line, so it automatically terminates with \r\n)
  • If nothing works, you might try to use HTTP, for example for setting a channel value, send a POST request to http://localhost/SendChannelValue with values ch, chvalue and time or as GET like http://localhost/SendChannelValue?ch=1& ... 255&time=0
  • For HTTP you might just activate the HTTP server and then open the page in a browser and take a look at the source code to see what requests PC_DIMMER accepts. Unfortunately, that interface is very limited.
Try these things and tell us if anything worked ;)

Best regards,
Ingo
Benutzeravatar
Christian
PC_DIMMER-Entwickler
Beiträge: 1856
Registriert: 12.11.2007, 09:30
Wohnort: Knw.-Remsfeld
Kontaktdaten:

Re: Terminalschnittstelle and i-rule remote control

Beitrag von Christian »

Hi,

PC_DIMMER uses the command "ReadLine()" to get the sent text, parses it afterwards and sends some text back. So as Ingo already said, you have to send the text with some carrier- and line-feed-signs. Otherwise the ReadLine() will not detect the Line-End:

Code: Alles auswählen

set_absolutchannel CHANNEL STARTVALUE ENDVALUE TIME DELAY#13#10
set_absolutchannel 2 -1 0 3000 0#13#10
kind regards,
Chris
dutch_anykey
Leuchtmittelaustauscher
Beiträge: 25
Registriert: 17.02.2010, 21:24

Re: Terminalschnittstelle and i-rule remote control

Beitrag von dutch_anykey »

Thanks a lot Ingo and Chris!

This helped me really further and finally Succes :clap:

the final line in I-rule application:

set_absolutchannel 2 -1 0 3000 0\x0D\x0A


Too much coffee today haha. But tomorrow I will rig some dimmers and ledstrips to make it real :D
I can even get some ledstrips to make ambilight and turn it on and of with i-rule. I will post a video of this setup.


kind regards,
Maurice
dutch_anykey
Leuchtmittelaustauscher
Beiträge: 25
Registriert: 17.02.2010, 21:24

Re: Terminalschnittstelle and i-rule remote control

Beitrag von dutch_anykey »

Hello Chris and Ingo,

Yesterday I didnt find the time to fumble around. Today I made a quick and dirty setup.
I was using some RGB ledstrips. connected to a RGB dimmer that I build from Hendrik Hoelscher site. DMX is send by the digital enlightment usb-dmx unit that I also build.
Pcdimmer is running on the HTPC machine that I use to connect to my projector.

I also tried ambilight. I got it working that I can switch it on and of from the i-rule application. But I found out that when mediacenter is in fullscreen mode, somehow pcdimmer is unable to pickup the screen. So ambi stays dark. When I minimize mediacenter window, ambi light works again. Anyway, ambi light was just for playing around now. Maybe nice if you are watching music clips. But when watching a movie, it should be dark i.m.o.

Here a short movie of the result:
Not the best quallity, but I hope you get the idea ;-)

http://youtu.be/YossDsvHlus

(Tried to create embedded youtube link, but can't get it to work)


Thanks for the support !
Ingo
< PC_DIMMER >
Beiträge: 544
Registriert: 19.03.2009, 17:49
Wohnort: Bad Hersfeld bzw. Stuttgart

Re: Terminalschnittstelle and i-rule remote control

Beitrag von Ingo »

Hey Maurice,

I think AmbiLight doesn't work with fullscreen Mediacenter window because Chris' implementation of AmbiLight captures the screen using Windows APIs and the GDI (Graphic Device Interface). They are a bit old-fashioned but work in an easy way. They are a bit inefficient though, and most applications with heavy use of graphics use graphics libraries like DirectX and OpenGL. I experienced that when I use VLC, AmbiLight always works except when I use DirectX (DirectDraw). I think when your Mediacenter application is on fullscreen mode it sends it's graphics data directly to the graphics card/driver instead through Windows' windows, so PC_DIMMER can't capture that and it only sees a black window.

Regards,
Ingo
dutch_anykey
Leuchtmittelaustauscher
Beiträge: 25
Registriert: 17.02.2010, 21:24

Re: Terminalschnittstelle and i-rule remote control

Beitrag von dutch_anykey »

Hi Ingo,

Oh well, for my use not a big problem. It needs to be dark when watching a movie on a big cinema screeen. surrounding light and reflection from objects is distracting. That's why I wanted this solution to work. When I hit pause and the lights go on you can see where you are walking again.
Some are even worse then me, I'm also reading forums about home cinema's. And mentioning ambilight is like swearing in a church at times :D

Maybe I'm going to work on dmx controlled blinding screens now. Movies come in different formats. 4:3, 16:9, 2.35:1. When projecting you either have unused white screen on the sides or on the bottomand top. I see a lot of hobbyists have a motor controlled blinding system from black material that can move the sides and top and bottom up and down to hide the unused white projection screen.

br
Maurice
dutch_anykey
Leuchtmittelaustauscher
Beiträge: 25
Registriert: 17.02.2010, 21:24

Re: Terminalschnittstelle and i-rule remote control

Beitrag von dutch_anykey »

Another question on this subject.

I want to get automatic startup of pcdimmer with the current project file when my htpc starts. Is that possible at all?
For now I have to click three messages out of the way before the program is started. So for sure I get these messages when I put pcdimmer project file in the windows startup folder.

First message is related to the language setting. I copied this project file from another p.c. somehow this file is not completly compatible. It complains that it can not find the language file "EN" and that it will start in Englisch.
Maybe I can overcome this problem if i create a new project from scratch on the htpc machine itself.
message 1
message 1
pcdimmer message 1.png (65.11 KiB) 8057 mal betrachtet
Second message, i'm not sure what it is complaining about. please have a look at the attached screenshot.
message 2
message 2
pcdimmer message 2.png (64.06 KiB) 8057 mal betrachtet

Third message is about the ambilight startup. Last session it was enabled, do you want to enable it again.
Can this message somehow be skipped in any case? I don't want to acknowledge this even if ambilight is on or off the last session.
message 3
message 3
pcdimmer message 3.png (62.58 KiB) 8056 mal betrachtet

Thanks in advance
Maurice
Antworten