Jump to content
C4 Forums | Control4

Any ideas on how to pass info from C4 to/from PCs on your LAN


Recommended Posts

Does anyone have any ideas on how one could pass information, like variable values, from C4 to your PC and vice-versa?

Here are some potential ideas, anyone have a comment on what is the best way to go:

(1) Ryan's old CGI interface for C4 (does that even work on 2.x?)

(2) Use your PC to monitor a folder on your C4 and have it take action when a file changes - this assumes that you could use something like "On (Button Push) Start Logging, Programming" and these logs being accessible to a drive visible on your PC that would take action when a file changes

(3) Trigger a relay on your C4 which can be read by a PC

(4) Have C4 send an IR command and have your PC read this IR command

Am I missing something which is much easier?

More on item (2) - When I browse the IP address of my Controller (HC-800) in Windows Explorer it shows a bunch of shares including db, drivers, log, etc. In the log folder there is a file called diagnostics that appears to only be updated when I turn on logging via C4 programming. This files seems to stop updating when I issue the command "Stop Logging". In the last line of the file you can see the Stop Logging command like this:

May 27 23:38:37:787861 home-controller-800-XXXXXXX DEBUG [13480]: Driver Zaphods Office(48) event <event>#012<deviceid>48</deviceid><eventid>5402</eventid><codeitem>#012<id>0</id><device>0</device><type>1</type><display></display>#012<cmdcond></cmdcond>#012<subitems>#012<codeitem>#012<id>1</id><device>100115</device><type>1</type><display>Stop logging</display>#012<cmdcond><devicecommand owneridtype="" owneriditem="-1"><command>STOP_LOGGING</command><params/></devicecommand></cmdcond>#012</codeitem>#012</subitems>#012</codeitem>#012</event>#012(5402) added to execute queue

So this looks like a way to get info out of C4, but it isn't too easy and will require some parsing on the receiving side.

Link to comment
Share on other sites


The 'CGI Interface' was a C compiled program, which was only compiled for the older controllers, (Media Controller, HTC). I don't think I even have a version for the HC300 or HC500/800/1000/250.

I'd do it with a combination of:

1) Sending Device Commands to control the Control4 system from command-line tools, or using the Web Events driver, both of which can be found on my http://www.untestedhacks.com site.

2) Having a driver send Web commands to get data out. To do this, I would typically use another driver, HTTP Table Grabber driver, although that's a bit old. It's a bit of a pain, as it's not bad for sending a 'this happened' message to a webserver, it's not great at using dynamic variables in the message.

RyanE

Link to comment
Share on other sites

Thanks Ryan. I know that I was able to use the CGI interface on an HC-300 in the past but my current main controller is an HC-800.

Does the Command Line Light Control in Lua (found here http://untestedhacks.com/2012/command-line-light-control/#more-80) require a driver installed on your Controller? But I assume that the Web Events driver requires me to have my dealer install this driver, correct?

Link to comment
Share on other sites

It's certainly possible I compiled it for the HC300, it's been a long time, and it's possible it would work on the 800, they're both ARM processors, but there's no guarantee.

The command line Lua script that can be used to send devicecommands to devices does *not* require anything installed on the controller, nor a driver installed in the project.

The Web Events driver would need to be installed by a dealer, yes.

RyanE

Link to comment
Share on other sites

As has been mentioned in many places, there is no password unless you set one on your system through Composer.

This is one of the reasons that port forwarding your Control4 system onto the Internet is a *Very Bad Idea*.

The system was designed to be accessed on the local (presumably secure) network.

RyanE

Link to comment
Share on other sites

I wrote a remote app that would install a very generic driver on the control4 system and then wire up the media player UI commands / sr-250 remote presses and that would get sent via IP to a listener on a windows box, via IP and specific port number.

Then the app takes each command and can be mapped to an action on the computer, either keyboard command, mouse command or batch file execution...

I abandoned the application for distribution because of many different reasons, but have been using it for over a year in my own installation (use it to control my pc)

However, as a proof of concept, it worked well and wasn't terribly difficult to code.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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