From owner-freebsd-multimedia@FreeBSD.ORG Wed Jul 6 09:49:52 2011 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8191F106566C; Wed, 6 Jul 2011 09:49:52 +0000 (UTC) (envelope-from achill@matrix.gatewaynet.com) Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mx1.freebsd.org (Postfix) with ESMTP id F32398FC08; Wed, 6 Jul 2011 09:49:51 +0000 (UTC) Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id p669noHI017050; Wed, 6 Jul 2011 12:49:50 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id p669nnxs017049; Wed, 6 Jul 2011 12:49:49 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: Ian Smith Date: Wed, 6 Jul 2011 12:49:49 +0300 User-Agent: KMail/1.9.7 References: <201107041339.22470.achill@matrix.gatewaynet.com> <201107051730.03784.achill@matrix.gatewaynet.com> <20110706170845.Q84785@sola.nimnet.asn.au> In-Reply-To: <20110706170845.Q84785@sola.nimnet.asn.au> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201107061249.49637.achill@matrix.gatewaynet.com> Cc: freebsd-multimedia@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: FreeBSD and controlling an alarm via relay X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 09:49:52 -0000 another thing that puzzles me is power. This board : http://www.ebay.co.uk/itm/USB-Eight-Channel-Relay-Board-RS232-= Serial-Controlled-/110710333092?pt=3DUK_BOI_Electrical_Components_Supplies_= ET&hash=3Ditem19c6d99ea4 needs VDC 12V supply=20 while this one : http://www.ebay.co.uk/itm/USB-Four-4-Relay-Module-Board-Ho= me-Automation-/180646300804?pt=3DLH_DefaultDomain_0&hash=3Ditem2a0f5bcc84 is self powered from USB. batteries do not come cheap, and having an extra AC/DC adaptor is not very = good either ... another thing is the relay parameters, i see various figures : Relay parameters: 5V / 72mA, 15A/24VDC (120VAC), 10A/250VAC or Each switch 12VDC/15A or 240VAC/10A or Open (No) and Closed (NC) Contacts rated for voltages: 12VDC/15A; 24VDC/15A= ; 125VAC/15A; 250VAC/10A my specific application i want to drive is this wireless xmitter : http://www.visonic.com/Data/Uploads/MCT_100_Installer_Guide_English_DE2241U= =2Epdf Should i assume my device that i want my relay to control will have voltage= of 3V? for which Voltage/Ampere figures should i opt? are those figures crucial? thanx a lot =CE=A3=CF=84=CE=B9=CF=82 Wednesday 06 July 2011 11:03:14 =CE=BF/=CE=B7 Ian = Smith =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > On Tue, 5 Jul 2011, Achilleas Mantzios wrote: > > =FF=FF=FF=FF=FF=FF=FF=FF Tuesday 05 July 2011 16:10:59 =FF=FF=FF=FF=FF= =FF=FF=FF=FF=FF=FF=FF=FF=FF: > > > On Mon, 4 Jul 2011, Achilleas Mantzios wrote: > > >=20 > > > [snip] > > >=20 > > > > I was thinking of some relay board (instead of the old modem),=20 > > > > possibly ethernet controlled > > >=20 > > > This box has relays and GPIO available via ethernet. It's probably=20 > > > overkill for your application, but it's well made and easy to use: > > >=20 > > > http://www.extron.com/product/product.aspx?id=3Dipltcr48&s=3D0 > > >=20 > >=20 > > That is too big for my application, thanx anyway. > > Most probably i'll go for something cheaper like this one=20 > > http://www.ebay.co.uk/itm/USB-Eight-Channel-Relay-Board-RS232-Serial-C= ontrolled-/110710346488?pt=3DUK_BOI_Electrical_Components_Supplies_ET&hash= =3Ditem19c6d9d2f8 >=20 > These look quite well designed and built to me, reasonably priced new,=20 > but check out the/a source site [1] for various models, 1- and 4-relay=20 > boards too, or if you prefer, RS-232 serial rather than USB interface=20 > for the 8-relay boards. There's also a simple parallel port to 8 TTL=20 > outputs board (hi Tim!) and various other stuff. I'm tempted myself. >=20 > [1] http://sigma-shop.com/category/4/relay-boards.html > [2] http://www.sigma-shop.com/page/12/manuals.html >=20 > > Could i use the ucom driver to talk to the USB device like a normal se= rial device, via /dev/cua*** ? > > The above link says one needs to talk to the relay with: > > 8 Data, 1 Stop, No Parity,Baud rate : 9600 > > and the commands look like: > > FF 01 00 (HEX)=20 > > or=20 > > 255 1 0 (DEC) > >=20 > > could i be able to specify those over ucom?=20 >=20 > If so, great. If not and you have a serial port, the code will be the=20 > same anyway, except the port used. I grabbed most of the manuals from=20 > [2] and found the Linux software examples are all this one: >=20 > =3D=3D=3D=3D=3D=3D=3D > Linux : > The USB-serial device is automatically detected and mapped to /dev/ > ttyUSB0 (or USB1 in case there is already a similar device). > My test script: (Thanks Julian!) > -------------------------------------------------------- > # cat relay.sh > while true > do > echo -e "\xFF\x00\x00" > /dev/ttyUSB0 ; sleep .1 > echo -e "\xFF\x00\x01" > /dev/ttyUSB0 ; sleep .1 > echo -e "\xFF\x00\x00" > /dev/ttyUSB0 ; sleep .1 > [..] > echo -e "\xFF\x01\x01" > /dev/ttyUSB0 ; sleep .1 > echo -e "\xFF\x02\x01" > /dev/ttyUSB0 ; sleep .1 > [..] > echo -e "\xFF\x07\x01" > /dev/ttyUSB0 ; sleep .1 > echo -e "\xFF\x08\x01" > /dev/ttyUSB0 ; sleep .1 > echo -e "\xFF\x01\x00" > /dev/ttyUSB0 ; sleep .1 > echo -e "\xFF\x02\x00" > /dev/ttyUSB0 ; sleep .1 > [..] > echo -e "\xFF\x07\x00" > /dev/ttyUSB0 ; sleep .1 > echo -e "\xFF\x08\x00" > /dev/ttyUSB0 ; sleep .1 > =3D=3D=3D=3D=3D=3D=3D >=20 > If using sh[1] you might need to use \0377 instead of \xFF >=20 > > do you know any application, perl library, utility or just a guide for= standard C serial port programming? >=20 > Anything that can write bytes to a serial port - perl's overqualified :) >=20 > [..] >=20 > cheers, Ian =2D-=20 Achilleas Mantzios