RadioBanter

RadioBanter (https://www.radiobanter.com/)
-   Digital (https://www.radiobanter.com/digital/)
-   -   RigBlaster and FreeBSD (https://www.radiobanter.com/digital/8293-rigblaster-freebsd.html)

Jack Twilley January 26th 04 09:28 PM

RigBlaster and FreeBSD
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've looked over the West Mountain website and I can't see anything
about how to make the RigBlaster run on FreeBSD. It's something I'd
need to know before buying one, obviously. Anyone here have any
experience with something like this?

Jack.
- --
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFAFYZuGPFSfAB/ezgRAkXfAJ0bJ7a8tCl7op0Iwz4wM88IVK9CVwCgkmiz
2y+IcWsdx4o54kE4N3UfoWA=
=+D6p
-----END PGP SIGNATURE-----

Mike Andrews January 26th 04 09:39 PM

Jack Twilley wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I've looked over the West Mountain website and I can't see anything
about how to make the RigBlaster run on FreeBSD. It's something I'd
need to know before buying one, obviously. Anyone here have any
experience with something like this?


Since we're not in an airport, I feel free to say this:

Hi, Jack.

If it'll run on Linux, then the Linux-compatibility stuff in
FreeBSD will run it very nicely -- except for a _very_ few
things.

--
"Why are we hiding from the police, daddy?"

"Because we use vi, son, and they use emacs."
(seen in the satalk mailing list, during an editor war)

Mike Andrews January 26th 04 09:39 PM

Jack Twilley wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I've looked over the West Mountain website and I can't see anything
about how to make the RigBlaster run on FreeBSD. It's something I'd
need to know before buying one, obviously. Anyone here have any
experience with something like this?


Since we're not in an airport, I feel free to say this:

Hi, Jack.

If it'll run on Linux, then the Linux-compatibility stuff in
FreeBSD will run it very nicely -- except for a _very_ few
things.

--
"Why are we hiding from the police, daddy?"

"Because we use vi, son, and they use emacs."
(seen in the satalk mailing list, during an editor war)

S. Sampson January 26th 04 11:15 PM

The rigblaster just uses the DTR and RTS signals of a serial port.

Here's some code I wrote in Linux to play with mine. It basically
just changes the state of the DTR and RTS signals.

Steve

"Jack Twilley" wrote

I've looked over the West Mountain website and I can't see anything
about how to make the RigBlaster run on FreeBSD. It's something I'd
need to know before buying one, obviously. Anyone here have any
experience with something like this?


/*
* repeater.c
*
* This module controls the RTS pin 5 signal of the DB-25,
* or pin 7 of the DB-9 connector, and the DCD pin 8 of the
* DB-25, or pin 1 of the DB-9.
*
* The RTS signal is used to control the Push-To-Talk (PTT),
* and the DCD signal is used to detect the Carrier Operated
* Squelch (COS) of a Radio Repeater.
*
* Tested with Red Hat Linux 6.2 (Kernel 2.2.14)
*
* Compile with: cc -O -s repeater.c -o repeater
*/

/* Includes */

#include stdio.h
#include unistd.h
#include fcntl.h
#include sys/ioctl.h /* TIO stuff in bits/ioctl.h and asm/ioctl.h */
#include sys/time.h
#include sys/types.h
#include termios.h
#include errno.h
#include string.h
#include signal.h

/* Defines */

typedef unsigned char BYTE;

#define FALSE (0)
#define TRUE (!FALSE)

/* Globals */

int fd;
int terminate = FALSE;
int port_signal;
int state_tx;
char portname[16];

/* Subroutines */

void intHandler(int signum)
{
terminate = TRUE;
}

void killHandler(int signum)
{
exit(0);
}

/*
* Wait up to sec seconds for file descriptor fd
* to become readable
*
* if sec is 0, returns immediately
*
* returns:
*
* 0 if descriptor is readable
* 0 if error (errno set by select())
* == 0 if timeout
*/

int timeout(int fd, int sec)
{
struct timeval tv;
fd_set rset;

FD_ZERO(&rset);
FD_SET(fd, &rset);

tv.tv_sec = sec;
tv.tv_usec = 0;

return (select(fd+1, &rset, NULL, NULL, &tv));
}

/* Main Program */

int main(int argc, char **argv)
{
struct timeval tv;
int port;
pid_t pid;

if (argc != 2)
{
fprintf(stderr, "Usage: repeater port\n");
fprintf(stderr, "Where ports 1 through 4 are valid\n");
exit(1);
}

port = atoi(argv[1]) - 1;

if (port 0 || port 3)
{
fprintf(stderr, "Valid ports are 1 through 4\n");
exit(2);
}

sprintf(portname, "/dev/ttyS%d", port);

if ((fd = open(portname, O_RDWR | O_NONBLOCK)) 0)
{
perror(portname);
exit(3);
}

/*
* Don't need these anymore
*/

close(0);close(1);close(2);

port_signal = TIOCM_RTS;

/*
* Bail out on Terminate Signal (kill -15)
*/

signal(SIGTERM, intHandler);

/*
* Daemonize
*/

if ((pid = fork()) 0) /* Error */
{
perror("daemonize");
exit(5);
}

if (pid != 0) {
/*
* Parent Process, so Exit
*/

exit(0);
}

/*
* Child process continues
*
* Fork a second time into control and timer
*/

if ((pid = fork()) 0) /* Error */
{
perror("repeater fork");
exit(6);
}

if (pid == 0) /* Child Process */
{
/*
* Timer process
*
* Set 9 minute, 3 minute, and 30 sec timers
*/

strcpy(argv[0], "Repeater Timer");

signal(SIGTERM, killHandler);

for (;;)
{
}
}

if (pid != 0 ) /* Parent Process */
{
/*
* While the COS signal on the DCD line is true
* enable the PTT signal on the RTS line.
*/

strcpy(argv[0], "Repeater Control");

for (;;)
{
int status;

if (terminate) {
state_tx = 0;
ioctl(fd, TIOCMBIC, &port_signal); /* clear */
kill(pid, SIGTERM);
sleep(1);
close(fd);
exit(0);
}

ioctl(fd, TIOCMGET, &status); /* get Modem bits */

if ((status & TIOCM_CAR) && !state_tx)
{
state_tx = 1;
ioctl(fd, TIOCMBIS, &port_signal); /* set */
}

if (!(status & TIOCM_CAR) && state_tx)
{
state_tx = 0;
ioctl(fd, TIOCMBIC, &port_signal); /* clear */
}
}
}
}
/* EOF */



S. Sampson January 26th 04 11:15 PM

The rigblaster just uses the DTR and RTS signals of a serial port.

Here's some code I wrote in Linux to play with mine. It basically
just changes the state of the DTR and RTS signals.

Steve

"Jack Twilley" wrote

I've looked over the West Mountain website and I can't see anything
about how to make the RigBlaster run on FreeBSD. It's something I'd
need to know before buying one, obviously. Anyone here have any
experience with something like this?


/*
* repeater.c
*
* This module controls the RTS pin 5 signal of the DB-25,
* or pin 7 of the DB-9 connector, and the DCD pin 8 of the
* DB-25, or pin 1 of the DB-9.
*
* The RTS signal is used to control the Push-To-Talk (PTT),
* and the DCD signal is used to detect the Carrier Operated
* Squelch (COS) of a Radio Repeater.
*
* Tested with Red Hat Linux 6.2 (Kernel 2.2.14)
*
* Compile with: cc -O -s repeater.c -o repeater
*/

/* Includes */

#include stdio.h
#include unistd.h
#include fcntl.h
#include sys/ioctl.h /* TIO stuff in bits/ioctl.h and asm/ioctl.h */
#include sys/time.h
#include sys/types.h
#include termios.h
#include errno.h
#include string.h
#include signal.h

/* Defines */

typedef unsigned char BYTE;

#define FALSE (0)
#define TRUE (!FALSE)

/* Globals */

int fd;
int terminate = FALSE;
int port_signal;
int state_tx;
char portname[16];

/* Subroutines */

void intHandler(int signum)
{
terminate = TRUE;
}

void killHandler(int signum)
{
exit(0);
}

/*
* Wait up to sec seconds for file descriptor fd
* to become readable
*
* if sec is 0, returns immediately
*
* returns:
*
* 0 if descriptor is readable
* 0 if error (errno set by select())
* == 0 if timeout
*/

int timeout(int fd, int sec)
{
struct timeval tv;
fd_set rset;

FD_ZERO(&rset);
FD_SET(fd, &rset);

tv.tv_sec = sec;
tv.tv_usec = 0;

return (select(fd+1, &rset, NULL, NULL, &tv));
}

/* Main Program */

int main(int argc, char **argv)
{
struct timeval tv;
int port;
pid_t pid;

if (argc != 2)
{
fprintf(stderr, "Usage: repeater port\n");
fprintf(stderr, "Where ports 1 through 4 are valid\n");
exit(1);
}

port = atoi(argv[1]) - 1;

if (port 0 || port 3)
{
fprintf(stderr, "Valid ports are 1 through 4\n");
exit(2);
}

sprintf(portname, "/dev/ttyS%d", port);

if ((fd = open(portname, O_RDWR | O_NONBLOCK)) 0)
{
perror(portname);
exit(3);
}

/*
* Don't need these anymore
*/

close(0);close(1);close(2);

port_signal = TIOCM_RTS;

/*
* Bail out on Terminate Signal (kill -15)
*/

signal(SIGTERM, intHandler);

/*
* Daemonize
*/

if ((pid = fork()) 0) /* Error */
{
perror("daemonize");
exit(5);
}

if (pid != 0) {
/*
* Parent Process, so Exit
*/

exit(0);
}

/*
* Child process continues
*
* Fork a second time into control and timer
*/

if ((pid = fork()) 0) /* Error */
{
perror("repeater fork");
exit(6);
}

if (pid == 0) /* Child Process */
{
/*
* Timer process
*
* Set 9 minute, 3 minute, and 30 sec timers
*/

strcpy(argv[0], "Repeater Timer");

signal(SIGTERM, killHandler);

for (;;)
{
}
}

if (pid != 0 ) /* Parent Process */
{
/*
* While the COS signal on the DCD line is true
* enable the PTT signal on the RTS line.
*/

strcpy(argv[0], "Repeater Control");

for (;;)
{
int status;

if (terminate) {
state_tx = 0;
ioctl(fd, TIOCMBIC, &port_signal); /* clear */
kill(pid, SIGTERM);
sleep(1);
close(fd);
exit(0);
}

ioctl(fd, TIOCMGET, &status); /* get Modem bits */

if ((status & TIOCM_CAR) && !state_tx)
{
state_tx = 1;
ioctl(fd, TIOCMBIS, &port_signal); /* set */
}

if (!(status & TIOCM_CAR) && state_tx)
{
state_tx = 0;
ioctl(fd, TIOCMBIC, &port_signal); /* clear */
}
}
}
}
/* EOF */



Jack Twilley January 27th 04 09:02 AM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Mike" == Mike Andrews writes:


Mike Since we're not in an airport, I feel free to say this:

Mike Hi, Jack.

Whee!

Mike If it'll run on Linux, then the Linux-compatibility stuff in
Mike FreeBSD will run it very nicely -- except for a _very_ few
Mike things.

And this is a serial thing, so I'm convinced it'll work just fine --
if it works under Linux.

Jack.
- --
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFAFilHGPFSfAB/ezgRAoEqAKCZso5QSRH6p2fvriN7HgbUl1TMFwCdFsIF
DPBMIsKjzFAaT+Hn2bPK4H4=
=JghG
-----END PGP SIGNATURE-----

Jack Twilley January 27th 04 09:02 AM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Mike" == Mike Andrews writes:


Mike Since we're not in an airport, I feel free to say this:

Mike Hi, Jack.

Whee!

Mike If it'll run on Linux, then the Linux-compatibility stuff in
Mike FreeBSD will run it very nicely -- except for a _very_ few
Mike things.

And this is a serial thing, so I'm convinced it'll work just fine --
if it works under Linux.

Jack.
- --
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFAFilHGPFSfAB/ezgRAoEqAKCZso5QSRH6p2fvriN7HgbUl1TMFwCdFsIF
DPBMIsKjzFAaT+Hn2bPK4H4=
=JghG
-----END PGP SIGNATURE-----

Jack Twilley January 27th 04 09:14 AM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Steve" == S Sampson writes:


Steve The rigblaster just uses the DTR and RTS signals of a serial
Steve port. Here's some code I wrote in Linux to play with mine. It
Steve basically just changes the state of the DTR and RTS signals.

Thanks for the code segment. I may have asked the wrong question.

Here's another try: can this box do everything a good TNC can do, and
what modifications need to be made to programs that expect a standard
TNC?

Steve Steve

Jack.
- --
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFAFivuGPFSfAB/ezgRAtpPAJwI5akwLC0PeLvXIFPXxYHlEqDT+wCfZDiZ
E42cmDSnaMTvvfYfkj1DceQ=
=tTNH
-----END PGP SIGNATURE-----

Jack Twilley January 27th 04 09:14 AM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Steve" == S Sampson writes:


Steve The rigblaster just uses the DTR and RTS signals of a serial
Steve port. Here's some code I wrote in Linux to play with mine. It
Steve basically just changes the state of the DTR and RTS signals.

Thanks for the code segment. I may have asked the wrong question.

Here's another try: can this box do everything a good TNC can do, and
what modifications need to be made to programs that expect a standard
TNC?

Steve Steve

Jack.
- --
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFAFivuGPFSfAB/ezgRAtpPAJwI5akwLC0PeLvXIFPXxYHlEqDT+wCfZDiZ
E42cmDSnaMTvvfYfkj1DceQ=
=tTNH
-----END PGP SIGNATURE-----

Roger January 27th 04 09:43 AM

Jack Twilley wrote on 27/01/2004 09:14:

Steve The rigblaster just uses the DTR and RTS signals of a serial
Steve port. Here's some code I wrote in Linux to play with mine. It
Steve basically just changes the state of the DTR and RTS signals.

Thanks for the code segment. I may have asked the wrong question.

Here's another try: can this box do everything a good TNC can do, and
what modifications need to be made to programs that expect a standard
TNC?


It's nothing like a TNC - it's basically just a switch / cable connecter
for use with sound card modem programs. (It tells you that on the web page.)

--
Roger Barker, G4IDE -
For UI-View go to -
http://www.UI-View.com
For WinPack go to - http://www.peaksys.co.uk


All times are GMT +1. The time now is 12:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
RadioBanter.com