Jump to content


c4Forums Member
  • Content Count

  • Joined

  • Last visited

About sofakng

  • Rank
    Control4 End User

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you so much for the help everybody. I really learned a lot.
  2. The application is that I’m trying to control power to a PC. (there are other ways of controlling a PC, but I’m interested in completely removing power, etc) Would something like this work? http://www.powerswitchtail.com/new-powerswitch-tail-3 It’s described as a DC-actuated power cord with built-in 5vdc power supply. I’m wondering if I can connect the +5v from the power cord to the Control4 relay, and then back into the power cord control signal. When Control4 activates the relay, the +5v will turn on the power cord. Does that make sense? Thanks again for all of your help!
  3. Thank you so much for the information. Is the relay basically an electronic switch? For example, you can connect up to 24v into the COM terminal and then it will go out the NO/NC terminals depending if the controller has it on or off? I'm thinking of relays that are used for a low voltage (i.e. 24v) to control a high voltage (120v) device? Can you explain how it works better?
  4. Hmmm, maybe I’m confusing the contact sensor ports and the relays? I’m trying to connect a Control4 controller (EA3/IO extender) to another relay and be able to turn it on and off. For example, I thought that the C4 relay would send 24v when “on” and 0v when “off”. The goal is to control a 120v device (on/off) using Control4 and wires. I know there are several wireless outlet relays (WeMo, etc) but I’m trying to find/build something hardwired. Does that make sense?
  5. Does anybody know the voltage of the EA3 and I/O extender relays? I believe they are both 24v but I’m not 100% sure. The manually specifies that as the “max” voltage. For example, if a Control4 driver turns the relay on, does than mean that 24v will be sent across COM and NO (normally open)? (and likewise, 0v will be sent when the relay is off)
  6. Thanks Ryan. Am I correct in my statements about C4 being mostly asynchronous and are my steps basically correct for what’s required to connect and then send a command? (ie. C4:NetConnect will return immediately after being called so you need to further monitor the connection status and wait for a connection before sending a command which then requires queuing, etc) EDIT: Actually, it seems like queuing is important even with auto_connect because SendToNetwork will just attempt to send a command pass or fail regardless of connection status so you could be attempting to send commands to an unavailable server, etc.
  7. I’m not looking for a wrapper for three lines of code. I was just looking for a similar function to C4:urlGet/urlPut. (ie. something built into the C4 libraries that did everything in one call) I think that most of the C4 APIs are asynchronous (please correct me if I’m wrong) so I would need something like the following: Send command into queue/buffer. Attempt to establish connection. Wait for connection to establish successful or fail. If connection established then send command. If connection fails then either: Abort connection attempt Remove command from buffer Create timer to attempt connection again If command was sent successfully then remove command from buffer. This involves several methods and global variables to queue commands, monitor connection status changes, send commands, etc. (and this is all just to send one command!) I believe that some of the DriverEditor Templates already have this code written which I can use. However, and I’m not trying to complicate this, I was just wondering if a more simple function existed because urlPut/urlGet does all of these functions internally and the driver writer only needs one method call. Also, I’m sorry for using the term one-way incorrectly. I typically think of any driver that only sends commands to a device and doesn’t receive (or ignores) anything back as one-way as there is only one direction of communication (even though the underlying tunnel supports two-way traffic). Oh, and I’ve also purchased the Generic TCP Command driver a while ago and use it quite often. It’s fantastic but programming an entire (faux) driver using it with all available remote control buttons, etc, is quite a bit of work.
  8. I'm not sure what you mean... I asked the following: Your response was to use C4:SendToNetwork: However, this doesn't answer my question. I'm trying to find a command that will connect if required and send a command. In my response to you I pointed out that your method (SendToNetwork) does not connect if required. Regardless, I appreciate the help. Thanks.
  9. Thanks Pounce. Unfortunately the C4:SendToNetwork will fail silently if the connection isn't established. (or was dropped, etc).
  10. Thanks again for the help. It looks like C4:url is the new method and urlGet/urlPost are deprecated (as of 2.10.5). Anyways, is there a similar method for raw TCP commands? (ie. connect if required and send command)
  11. Thanks for the reply. I have a long history of development (10+ years of Java, C#) so I like to learn how the low-level stuff works instead of using lots of abstraction/wrappers until I understand what is actually happening. I've also watched the training videos (100-400 series) but they didn't seem to go into enough detail but they were still helpful. Anyways, I have a quick question on TCP connections. What is the best practice for one-way TCP connections? For example, a simple driver that sends commands off to a device and doesn't need a response. It seems like you can either enable AUTO_CONNECT, MONITOR_CONNECTION, and KEEP_CONNECTION or call C4:NetConnect. What's your opinion/best practice on using them? For example, if you use auto_connect and the connection is dropped, you need to make sure you check before you use C4:SendToNetwork. Alternatively you can check the connection status every time before a command is sent and re-connect as needed? Lots of different options of course but I'm hoping to see what's the best practice for stability, etc.
  12. I’m working my way through the documentation and training videos but I’m a bit confused. The DriverEditor Templates create driver projects with a whole bunch of files (common/*, lib/*, etc). Is the current best practice to keep all of these in every driver? I’m looking at the source for other drivers (even recent ones) and most of them either have everything in the .c4i file, or at most only have a driver.lua/driver.xml in a .c4z file. Is the difference that the standalone driver.lua drivers are just calling the C4 API directly, and the templates include a bunch of helper libraries/classes to use instead?
  13. I'm looking to purchase an EA1 controller for a spare room that I don't use very much so hopefully something cheap (ie. used, v1 is fine, etc). I'm also looking for 2x SR260 recharge kits. (not the remote, but the kit that converts them into rechargeables).
  14. What are the differences between EA1 and the EA1-v2? (not the newer POE release) Also, if I’m buying used equipment, how can I tell them apart?
  15. I'm starting to learn DriverWorks but I thought I would only need the Driver Wizard for a simple one-way driver? Everything works great except for the navigation/arrow buttons.
  • Create New...