From owner-freebsd-multimedia@FreeBSD.ORG Tue Jul 5 18:21:00 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 8B0C3106564A; Tue, 5 Jul 2011 18:21:00 +0000 (UTC) (envelope-from pozar@lns.com) Received: from kumr.lns.com (kumr.lns.com [209.237.227.146]) by mx1.freebsd.org (Postfix) with ESMTP id 2E27F8FC0A; Tue, 5 Jul 2011 18:20:59 +0000 (UTC) Received: from [192.168.101.54] ([38.109.25.246]) (authenticated bits=0) by kumr.lns.com (8.14.4/8.14.4) with ESMTP id p65HhE6j047685 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 5 Jul 2011 10:43:17 -0700 (PDT) (envelope-from pozar@lns.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=utf-8 From: Tim Pozar In-Reply-To: <201107051730.03784.achill@matrix.gatewaynet.com> Date: Tue, 5 Jul 2011 12:43:10 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <295D8D24-CAE4-4EB6-BCF1-EEE7B8623D85@lns.com> References: <201107041339.22470.achill@matrix.gatewaynet.com> <201107051730.03784.achill@matrix.gatewaynet.com> To: Achilleas Mantzios X-Mailer: Apple Mail (2.1084) X-Spam-Status: No, score=-102.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE, USER_IN_WHITELIST autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on kumr.lns.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: Tue, 05 Jul 2011 18:21:00 -0000 Why not use the parallel port? Have one of its pins drive a relay. = You may need to put a transistor in front of the relay. Software: http://excamera.com/articles/21/parallel.html Hardware: http://www.dakeng.com/relay.htm Fancy hardware: http://www.electronickits.com/kit/complete/elec/ck1601.htm Tim On Jul 5, 2011, at 9:30 AM, Achilleas Mantzios wrote: > =CE=A3=CF=84=CE=B9=CF=82 Tuesday 05 July 2011 16:10:59 =CE=B3=CF=81=CE=AC= =CF=88=CE=B1=CF=84=CE=B5: >> 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-Contr= olled-/110710346488?pt=3DUK_BOI_Electrical_Components_Supplies_ET&hash=3Di= tem19c6d9d2f8 >=20 > Could i use the ucom driver to talk to the USB device like a normal = serial 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 > do you know any application, perl library, utility or just a guide for = standard C serial port programming? >=20 > i have used mgetty/vgetty in the past to control some modems. > I do not know if there any fancier methods to access the serial port, = but this is how i used to do it, back in 7.* > /usr/local/bin/vm shell -l cuad1 -S onhook_offhook.pl > where onhook_offhook.pl reads like: > #!/usr/bin/perl > # > use Modem::Vgetty; >=20 > my $v =3D new Modem::Vgetty; >=20 > $v->device('DIALUP_LINE'); > $v->send("ATH1"); > sleep(5); > $v->send("ATH0"); >=20 > if i could speak directly with e.g. "255 1 0" like > $v->send("255 1 0"); > that would be awesome... > i guess i will have to try it out. >> I'd also look at manufactureres such as Moxa and LANtronics. >>=20 >=20 >=20 >=20 > --=20 > Achilleas Mantzios > _______________________________________________ > freebsd-multimedia@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-multimedia > To unsubscribe, send any mail to = "freebsd-multimedia-unsubscribe@freebsd.org"