Jump to content
C4 Forums | Control4

Sending Hex Codes to SendToSerial()


Recommended Posts

I'm writing a very simple serial driver to control On/Off for a video wall. I loaded the driver onto our director and made the physical and composer connections, but when I issue the power on command, the display doesn't do anything.

I have the following code:

CMDS_SERIAL = {	 
		--Power
		["ON"]             = "F5 88 FF FE FE 01",
		["OFF"]            = "F5 88 FF FE FE 00",
		
		--Input Toggle
		["DP"]=			"F5 88 FF FE 01 01",
		["HDMI"]=			"F5 88 FF FE 01 02"
}

function ReceivedFromProxy(idBinding, strCommand, tParams)
    if CMDS_SERIAL[strCommand] ~= nil then
	   C4:SendToSerial(idBinding, tohex(CMDS_SERIAL[strCommand]))
	   print("sending " .. strCommand)
	   print("command is " .. CMDS_SERIAL[strCommand])
    else 
	   print (strCommand .. " command not found")
    end
end

I know the hex commands work. I can connect to the displays directly via serial wire and putty. I can turn the display on and off that way. 

 

I imagine I am just missing something simple.

 

thanks

Link to comment
Share on other sites


How are you making the driver, from scratch?

Id suggest trying to make the driver using driver wizard and copy an existing display driver.  Then input your codes where needed.  Easier to test to make sure syntax and protocol are correct.

From there you can use the tool to make it a c4z and add anything else you’d want like a custom logo, etc.

Link to comment
Share on other sites

You're sending it to the proxy binding, where you're getting the message of what to send.

You need to send it to the serial control binding, which is usually in the range of 1-100.

That serial control binding will be declared in the XML part of the driver.  There will also be a <serialsettings> section, with the serial baud rate, etc.

RyanE

 

Link to comment
Share on other sites

  • 3 years later...
On 27/4/2021 at 13:14, ivan-alarcon said:

buenas, soy nuevo en la creación de drivers con (DriverEditor) y estoy realizando un driver para control de un dimmer UPB por conexión serial  y se que para el envío de códigos hex hay comandos como C4:sendToSerial pero no he podido encontrar los comandos que me establezcan la conexión serial con el puerto com y los baudios que yo desee, agradecería que me pudieran colaborar; también quisiera saber como programo en el DriverEditor  el envió de comandos a través de la sección de programación del ComposerPro. 

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

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

Guest
Reply to this topic...

×   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.

×
×
  • Create New...

Important Information

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