Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a4eed20392 | ||
|
51528cd34b | ||
|
c37c2b4a0d | ||
|
594bb6006f | ||
|
2d99d0deba | ||
|
49a033f9a3 | ||
|
79b9ab5dc1 | ||
|
a8b5ad29b7 | ||
|
a8468dbe42 | ||
|
d2254a907b |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,3 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
irmc
|
irmc
|
||||||
irmc.o
|
*.o
|
||||||
|
44
README.md
44
README.md
@@ -1,13 +1,8 @@
|
|||||||
irmc - Internet Relay Morse Code
|
irmc - Internet Relay Morse Code
|
||||||
================================
|
================================
|
||||||
|
|
||||||
IRMC stands for Internet Relay Morse Code and is an implementation of [MOIP](https://github.com/8cH9azbsFifZ/moip).
|
IRMC stands for Internet Relay Morse Code and is an implementation of [MOIP](https://github.com/8cH9azbsFifZ/moip).
|
||||||
It implements the [CWCom protocol](http://kob.sdf.org/morsekob/docs/cwcom.pdf)
|
It implements the [CWCom protocol](http://kob.sdf.org/morsekob/docs/cwcom.pdf)
|
||||||
as adopted by [MorseKOB](http://kob.sdf.org/morsekob/docs/history.pdf).
|
as adopted by [MorseKOB](http://kob.sdf.org/morsekob/docs/history.pdf).
|
||||||
You can try out the software in a [browser](http://kob.sdf.org/morsekob/morsekob30/index.htm) using Java.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
# How to build?
|
# How to build?
|
||||||
## Install dependency: morse keyer library
|
## Install dependency: morse keyer library
|
||||||
@@ -39,50 +34,29 @@ Compilation with make :)
|
|||||||
For the USB serial devices you need a PL2303 driver
|
For the USB serial devices you need a PL2303 driver
|
||||||
(i.e. [PL2303_Serial-USB_on_OSX_Lion.pkg](http://changux.co/osx-installer-to-pl2303-serial-usb-on-osx-lio/)).
|
(i.e. [PL2303_Serial-USB_on_OSX_Lion.pkg](http://changux.co/osx-installer-to-pl2303-serial-usb-on-osx-lio/)).
|
||||||
|
|
||||||
## Testing
|
# Hardware interface options
|
||||||
./irmc morsecode.dyndns.org 7890 2348 test
|
|
||||||
|
|
||||||
Or you may want to use tcpdump, i.e.:
|
|
||||||
```
|
|
||||||
sudo tcpdump -i all -vvvv "host faeroes.sdf.org"
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
# How to use:
|
|
||||||
|
|
||||||
The usage is: `irmc [hostname] [port] [channel] [id] [serialport`
|
|
||||||
|
|
||||||
For example:
|
|
||||||
`./irmc mtc-kob.dyndns.org 7890 103 MyID /dev/tty.usbserial´
|
|
||||||
|
|
||||||
|
|
||||||
## Hardware interface options
|
|
||||||
A good description on how to build different interfaces (telegraph key, sounder or both)
|
A good description on how to build different interfaces (telegraph key, sounder or both)
|
||||||
is given on the [MorseKOB Website](http://kob.sdf.org/morsekob/interface.htm).
|
is given on the [MorseKOB Website](http://kob.sdf.org/morsekob/interface.htm).
|
||||||
Landline telegraphs use "closed circuits" for communications; if you have built one at home,
|
Landline telegraphs use "closed circuits" for communications; if you have built one at home,
|
||||||
you may also use the [loop interface](http://kob.sdf.org/morsekob/docs/loopinterface.pdf).
|
you may also use the [loop interface](http://kob.sdf.org/morsekob/docs/loopinterface.pdf).
|
||||||
|
|
||||||
Connection of a morse key:
|
Connection of a morse key:
|
||||||
Serial PIN: 4 & 6
|
|
||||||
[layout of pins](http://techpubs.sgi.com/library/dynaweb_docs/0650/SGI_Admin/books/MUX_IG/sgi_html/figures/4-2.serial.port.con.gif)
|
[layout of pins](http://techpubs.sgi.com/library/dynaweb_docs/0650/SGI_Admin/books/MUX_IG/sgi_html/figures/4-2.serial.port.con.gif)
|
||||||
Connecting the palm radio: keep an eye on the grounding :)
|
|
||||||
|
|
||||||
|
| RS232 | DB9 | Function |
|
||||||
http://kob.sdf.org/morsekob/interface.htm#portpins
|
| :-------- |:-------| :------ |
|
||||||
RS232 DB9 Function
|
| DTR | 4 | Manual Key / paddle common|
|
||||||
DTR 4 Manual Key / paddle common
|
| DSR | 6 | Manual key / dot paddle|
|
||||||
DSR 6 Manual key / dot paddle
|
| CTS | 8 | Dash paddle|
|
||||||
CTS 8 Dash paddle
|
| RTS | 7 | Sounder output|
|
||||||
RTS 7 Sounder output
|
| SG | 5 | Sounder ground|
|
||||||
SG 5 Sounder ground
|
|
||||||
|
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
* v0.3 [zip](https://github.com/8cH9azbsFifZ/irmc/archive/v0.3.zip) - commandline option cleanup
|
||||||
* v0.2 [zip](https://github.com/8cH9azbsFifZ/irmc/archive/v0.2.zip) - ported to debian wheezy and osx yosemite, DG6FL
|
* v0.2 [zip](https://github.com/8cH9azbsFifZ/irmc/archive/v0.2.zip) - ported to debian wheezy and osx yosemite, DG6FL
|
||||||
* v0.1 [zip](https://github.com/8cH9azbsFifZ/irmc/archive/v0.1.zip) - original version, VE7FEB
|
* v0.1 [zip](https://github.com/8cH9azbsFifZ/irmc/archive/v0.1.zip) - original version, VE7FEB
|
||||||
|
|
||||||
Code Quality
|
Code Quality
|
||||||
============
|
============
|
||||||
This is experimental code.
|
This is experimental code.
|
||||||
|
|
||||||
|
|
||||||
|
60
src/irmc.c
60
src/irmc.c
@@ -270,17 +270,53 @@ int main(int argc, char *argv[])
|
|||||||
char id[SIZE_ID];
|
char id[SIZE_ID];
|
||||||
char serialport[64];
|
char serialport[64];
|
||||||
|
|
||||||
if (argc < 4) {
|
// Set default values
|
||||||
fprintf(stderr," %i usage: irmc [hostname] [port] [channel] [id] [serialport]\n", argc);
|
snprintf(hostname, 64, "mtc-kob.dyndns.org");
|
||||||
exit(1);
|
snprintf(port, 16, "7890");
|
||||||
|
channel = 103;
|
||||||
|
snprintf(id, SIZE_ID, "irmc-default");
|
||||||
|
snprintf(serialport, 64, "/dev/tty.usbserial");
|
||||||
|
|
||||||
|
// Read commandline
|
||||||
|
opterr = 0;
|
||||||
|
int c;
|
||||||
|
while ((c = getopt (argc, argv, "h:p:c:i:s:")) != -1)
|
||||||
|
{
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case 'h':
|
||||||
|
snprintf(hostname, 64, "%s", optarg);
|
||||||
|
break;
|
||||||
|
case 'p':
|
||||||
|
snprintf(port, 16, "%s", optarg);
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
channel = atoi (optarg);
|
||||||
|
break;
|
||||||
|
case 'i':
|
||||||
|
snprintf(id, SIZE_ID, "%s", optarg);
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
snprintf(serialport, 64, "%s", optarg);
|
||||||
|
break;
|
||||||
|
case '?':
|
||||||
|
fprintf(stderr, "irmc - Internet Relay Morse Code\n\n");
|
||||||
|
fprintf(stderr, "usage: irmc [arguments]\n\n");
|
||||||
|
fprintf(stderr, "Arguments:\n\n");
|
||||||
|
fprintf(stderr, " -h [hostname] Hostname of morsekob server. Default: %s\n", hostname);
|
||||||
|
fprintf(stderr, " -p [port] Port of morsekob server. Default: %s\n", port);
|
||||||
|
fprintf(stderr, " -c [channel] Channel. Default: %d\n", channel);
|
||||||
|
fprintf(stderr, " -i [id] My ID. Default: %s\n", id);
|
||||||
|
fprintf(stderr, " -s [serialport] Serial port device name. Default: %s\n", serialport);
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
|
abort ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(hostname, 64, argv[1], "%s");
|
// Preparing connection
|
||||||
snprintf(port, 16, argv[2], "%s");
|
fprintf(stderr, "irmc - Internet Relay Morse Code\n\n");
|
||||||
channel = atoi(argv[3]);
|
fprintf(stderr, "Connecting to %s:%s on channel %d with ID %s.\n", hostname, port, channel, id);
|
||||||
if(argc > 4) snprintf(id, SIZE_ID, argv[4], "%s");
|
|
||||||
else snprintf(id, SIZE_ID, "irmc");
|
|
||||||
if(argc > 5) snprintf(serialport, 64, argv[5], "%s");
|
|
||||||
|
|
||||||
prepare_id (&id_packet, id);
|
prepare_id (&id_packet, id);
|
||||||
prepare_tx (&tx_data_packet, id);
|
prepare_tx (&tx_data_packet, id);
|
||||||
@@ -317,17 +353,17 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
fcntl(fd_socket, F_SETFL, O_NONBLOCK);
|
fcntl(fd_socket, F_SETFL, O_NONBLOCK);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
fprintf(stderr, "irmc: failed to connect\n");
|
fprintf(stderr, "Failed to connect.\n");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr),
|
inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr),
|
||||||
s, sizeof s);
|
s, sizeof s);
|
||||||
printf("irmc: connected to %s\n", s);
|
fprintf(stderr, "Connected to %s.\n", s);
|
||||||
beep_init();
|
beep_init();
|
||||||
fd_serial = open(serialport, O_RDWR | O_NOCTTY | O_NDELAY);
|
fd_serial = open(serialport, O_RDWR | O_NOCTTY | O_NDELAY);
|
||||||
if(fd_serial == -1) {
|
if(fd_serial == -1) {
|
||||||
printf("irmc: unable to open serial port.\n");
|
fprintf(stderr,"Unable to open serial port %s.\n", serialport);
|
||||||
}
|
}
|
||||||
freeaddrinfo(servinfo); /* all done with this structure */
|
freeaddrinfo(servinfo); /* all done with this structure */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user