Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jul 2011 17:30:03 +0300
From:      Achilleas Mantzios <achill@matrix.gatewaynet.com>
To:        Chris Hill <chris@monochrome.org>, freebsd-hardware@freebsd.org, freebsd-multimedia@freebsd.org
Subject:   Re: FreeBSD and controlling an alarm via relay
Message-ID:  <201107051730.03784.achill@matrix.gatewaynet.com>
In-Reply-To: <alpine.BSF.2.00.1107050902220.63675@tripel.monochrome.org>
References:  <201107041339.22470.achill@matrix.gatewaynet.com> <alpine.BSF.2.00.1107050902220.63675@tripel.monochrome.org>

next in thread | previous in thread | raw e-mail | index | archive | help
=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

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-Contro=
lled-/110710346488?pt=3DUK_BOI_Electrical_Components_Supplies_ET&hash=3Dite=
m19c6d9d2f8

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:
=46F 01 00 (HEX)=20
or=20
255 1 0 (DEC)

could i be able to specify those over ucom?=20
do you know any application, perl library, utility or just a guide for stan=
dard C serial port programming?

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 t=
his 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;

my $v =3D new Modem::Vgetty;

$v->device('DIALUP_LINE');
$v->send("ATH1");
sleep(5);
$v->send("ATH0");

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



=2D-=20
Achilleas Mantzios



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107051730.03784.achill>