PDA

View Full Version : How to connect to a USB relay board



Inmocean
June 18th, 2013, 01:18 AM
Hello

I think I am out of my depth here but I have to ask the question to hopefully complete my project. I am trying to connect and send basic commands to a Canakit USB serial relay board via Netremote actions. I can manipulate it via hyperterminal no problem. However for some reason I cannot see this in Girder. Do I have to build a LUA driver for this (I hope not, thats over my head) or should Girder pick this up for me? I have spent days trying all sorts but have come up blank. Could anyone put me in the right direction please.

Many Thanks

Richard

Ron
June 18th, 2013, 06:53 AM
Do you have a link to the protocol?

Inmocean
June 18th, 2013, 01:12 PM
Hi Ron

I was not expecting you to reply. Thank you. Regarding my other issue with the screens on Netremote I managed to sort that out. A touch pad and big finger caused the side bars to undock themselves. By using a mouse I managed to redock them, so all is good again. The present issue, below is the link

===http://www.canakit.com/uk1104===

simple protocol really I just cannot get Girder to see the port.

Thanks for any help

Richard

PS I also tried a board with a FTDI chip but LUA does not support that protocol

Ron
June 18th, 2013, 01:17 PM
Hmm that didn't have the protocol in it. But really if all you need to do is send some serial commands this should be straight forward. Look at "<GIRDER INSTALL>\luascript\transport\devices\SimpleSend.lua"

Make sure the baud rate is correct and all. If not simply copy this file and correct in there.

Then use the transport manager to load this device.

Now there is a serial send action that allows you to send any data you like.

Inmocean
June 19th, 2013, 03:28 AM
Thank you Ron. However I have played with this before and for some reason the port drop down list only ever shows one comport "3" on the action page. The unit has picked Comport 24 in the Windows Device Manager. The port is however listed under the Serial Port button option as "unassigned" on the serial send action page.

Any Suggestions?

Ron
June 19th, 2013, 06:39 AM
Did you start the simplesend driver on com24 in the transport manager?

Inmocean
June 19th, 2013, 01:03 PM
Ron I am not sure what you mean by this? The port number does not come up in the settings box.

Inmocean
June 19th, 2013, 01:05 PM
Ron I am not sure what you mean. The comport24 does not show up as an option in the settings box after selecting simplesend. So I am unable to start the driver on the comport.

Inmocean
June 21st, 2013, 03:48 PM
Ron 2 days (frustrated) but I have made progress. I had to load the board driver in the transport files in Girder. So it now shows up in simplesend but I have a question. How do I type a CR in text in the command line? Obviously typing REL1.ON is fine but it needs a CR at the end to send.

Regards

Ron
June 21st, 2013, 04:01 PM
A few options:

1. Use HEX option to send. That way you can add any characters you like. A bit cumbersome.

2. Change the send function in simplesend to append the CR.


Send = function ( self, data )
if self.Transport then
-- the false below indicates we don't care about the return values.
return self.Transport:Send(data.. '\n', false)
end
end,

Inmocean
June 21st, 2013, 09:14 PM
Nice...homework for the weekend!!

Probably too late to mention this but the reason for the "relay" board is so that I can multi zone. I intend turning the power off to unwanted Niles IR receivers (5 in total). That way only the equipment for the zone selected will receive IR and operate. All amps are Marantz and mounted in one cupboard. So you can imagine the scene every time we turned on a zone everything would come on at once, very cumbersome. If I can get this right it completes the backbone for one touch slate operating multi zones etc etc. I have even purchased an IR relay board thinking that was a work around, maybe. As far as Netremote goes great software and having fun using it, but this LUA thing needs a degree I think. Would be nice to know though. Have a nice weekend and thanks for the help, without it I would have tossed the whole lot in the bin by now.

Ron
June 21st, 2013, 09:23 PM
You're welcome, have fun!