YaK:: W6REK/B HF Beacon (amateur radio transmitter) [Changes]   [Calendar]   [Search]   [Index]   [PhotoTags]   
[mega_changes]
[photos]

W6REK/B HF Beacon (amateur radio transmitter)

W6REK/B 10m Coordinated Beacon [28.2143] (Oct 2017 & on)

The beacon is being spotted by N6TV (San Jose, Calif) on the Reverse Beacon Network: http://www.reversebeacon.net/dxsd1/dxsd1.php?f=0&c=w6rek%2Fb&t=dx

Currently using a Realistic HTX-100 at 5 watts on 28.2143 MHz (plus or minus; I'm trying to tune it better).

The Morse Code Keyer is an ATtiny45 microcontroller toggling a single output:

#define LED_BUILTIN 0  /* SparkFun Tiny Programmer for ATtiny45*/
#define PAUSE 5 /* seconds before repeating */

#define WPM 12
#define DIT ((int)(1200/(WPM)))
/* 100 milliseconds is 12 WPm */

#define W  ".-- "
#define _6 "-.... "
#define R  ".-. "
#define E  ". "
#define K  "-.- "
#define SL "-..-. "
#define B  "-... "
#define __ "   "
#define C  "-.-. "
#define M  "-- "
#define _9 "----. "
#define _7 "--... "
#define D "-.. "

const char Message[] = D E __ W _6 R E K SL B __ W _6 R E K SL B __ C M _9 _7;

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// Use macros with constants, to avoid needing to multiply at runtime.
#define Beep(NDITS) { digitalWrite(LED_BUILTIN, HIGH); delay(NDITS*DIT); }
#define Gap(NDITS) { digitalWrite(LED_BUILTIN, LOW); delay(NDITS*DIT); }

void Fist(int ch) {
  switch (ch) {
    case '.':
      Beep(1);
      Gap(1);
      break;
    case '-':
      Beep(3);
      Gap(1);
      break;
    default:
      Gap(2);
      break;
  }
}

void loop() {
  int i = 0;
  int ch;
  while (ch = Message[i++]) {
    Fist(ch);
  }
  delay(PAUSE * 1000);
}


new message 2017-10-23:


#define VVV "...- ...- ...- "
#define W  ".-- "
#define _6 "-.... "
#define R  ".-. "
#define E  ". "
#define K  "-.- "
#define SL "-..-. "
#define B  "-... "
#define __ "   "
#define C  "-.-. "
#define M  "-- "
#define _9 "----. "
#define _7 "--... "
#define D "-.. "
#define A ".- "
#define H ".... "

//#define EGESZSEGERE ". --. . ... --.. ... . --. . .-. . "
#define EGESZSEGERE ". --. ..-.. ... --.. ... ..-.. --. ..-.. .-. . "

const char Message[] = VVV __ D E __ W _6 R E K SL B __ W _6 R E K SL B __ C M _9 _7 A H __ EGESZSEGERE __ D E __ W _6 R E K SL B;



This one is for a Raspberry Pi, using GPIO 17 for keying.

I run the GPIO 17 output (with a 1K pullup to +V) through three CMOS inverting buffers (half a CMOS 4049) in series, then through a diode, to pull down the tranceiver's CW key input. I power the 4049 from a +5 output on the Raspberry Pi.

pi@raspberrypi:~ $ cat beacon.py
import gpiozero
import time

MORSE = {
  'V': '...-',
  'D': '-..',
  ' ': ' ',
  'W': '.--',
  '6': '-....',
  'R': '.-.',
  'E': '.',
  'K': '-.-',
  '/': '-..-.',
  'B': '-...',
}

Ascii = 'VVV DE W6REK/B         '

Morse = ' '.join(MORSE[ch] for ch in Ascii)
print repr(Morse)

BEEPS = {
  '.': 'X',
  '-': 'XXX',
  ' ': '_',
}

Output = ' '.join(BEEPS[ch] for ch in Morse)
N = len(Output)
print N, repr(Output)

led = gpiozero.LED(17)

while True:
  t = int(time.time() * 10)

  # i = 0
  while t == int(time.time() * 10):
    # i += 1
    pass
  # print i

  if Output[t % N] == 'X': led.on()
  else: led.off()

pass  # NOT REACHED
pi@raspberrypi:~ $




W6REK/B HF Beacon for Eclipse Science (OLD: August 2017)

PLEASE SEE http://eclipse.yak.net/


The plan is to operate before, during, and after the Aug 21, 2017, eclipse from Edgefield Country, South Carolina, USA.

This Bash script (for linux) sends a beacon on the frequencies and the powers shown on the SCHED= line.

It currently stays on each frequency about 40 seconds, with a 28 second transmission (plus time for the automatic tuner to respond).

HF Spots: http://www.reversebeacon.net/dxsd1/dxsd1.php?f=0&c=w6rek%2Fb&t=dx

Solar Eclipse Ham Science: http://hamsci.org/basic-project/2017-total-solar-eclipse

     3        SCHED='28071111:80 14071111:80 7071111:80 3571111:50'
     4
     5        alias rig="rigctl -m 370 -s 19200 -r /dev/ttyUSB0"
     6        trap 'rig T 0' 0 1 2 3
     7
     8        set -e
     9        while true
    10        do
    11                for sched in $SCHED
    12                do
    13                        set / $(echo $sched | tr ':' ' ')
    14                        F=$2
    15                        P=$3
    16                        date
    17                        echo "T 0
    18        F $F
    19        M CW 250
    20        L RFPOWER $(echo "puts [format %.2f [expr 0.01+$P/100.0]]" | tclsh)
    21        L KEYSPD 20
    22        T 0
    23        " | rig -
    24                        sleep 1
    25                        rig G TUNE
    26                        sleep 8
    27                        rig T 1
    28                        rig b ". eclipse test "
    29                        rig b "de w6rek/b w6rek/b "
    30                        rig b "cm97ah ${P}w ."
    31
    32                        for x in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    33                        do
    34                                sleep 1
    35                                echo "exit [expr { $(rig l SWR) > 1.4 }] " | tclsh
    36                        done
    37
    38                done
    39        done

Here's a single frequency beacon on 28.242400:

     1        #!/bin/bash
     2
     3        alias rig="rigctl -m 370 -s 19200 -r /dev/ttyUSB0"
     4        trap 'rig T 0' 0 1 2 3
     5
     6        set -e
     7        rig T 0
     8        rig F 28242400
     9        rig M CW 250
    10        rig L RFPOWER 0.8
    11        rig L KEYSPD 20
    12        rig G TUNE
    13        sleep 8
    14        rig T 1
    15        sleep 1
    16
    17        while true
    18        do
    19                date
    20                rig b "de w6rek/b cm97"
    21                for x in 1 2 3 4 5 6 7 8 9 10 11 12
    22                do
    23                        sleep 1
    24                        echo "exit [expr { $(rig l SWR) > 1.2 }] " | tclsh
    25                done
    26        done

alias rig="rigctl -m 370 -s 19200 -r /dev/ttyUSB0"
trap 'sleep 0.888; rig T 0' 0 1 2 3
set -e

POWER=${POWER:-0.05}
FREQ=${FREQ:-28242424}
SPEED=${SPEED:-12}

rig F $FREQ
rig M CW 250
rig L RFPOWER $POWER
rig L KEYSPD $SPEED

while true
do
        date
        rig T 1
        sleep 1

        rig b "DE W6REK/B W6REK/B CM97"

        while [ 1 = "$(rig t)" ]
        do
                echo "exit [expr { $(rig l SWR) > 1.2 }] " | tclsh
                sleep 0.3
                rig T 0
        done

        sleep 1
done

  • beacon.sh
  • beacon.sh
  • beacon-fast28.sh
  • radiolog.txt
  • beacon25nov.txt
  • beacon26nov.txt
  • beacon26nov.txt

    
    /* rts_dtr_beacon */
    
    #include <fcntl.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <sys/ioctl.h>
    #include <sys/stat.h>
    #include <sys/types.h>
    #include <termios.h>
    #include <time.h>
    #include <unistd.h>
    
    #define W  ".-- "
    #define _6 "-.... "
    #define R  ".-. "
    #define E  ". "
    #define K  "-.- "
    #define SLASH "-..-. "
    #define B  "-... "
    #define __ "   "
    #define C  "-.-. "
    #define M  "-- "
    #define _9 "----. "
    #define _7 "--... "
    #define D "-.. "
    
    const char Message[] = D E __ W _6 R E K SLASH B __ __ __;
    char codes[1000];
    
    struct timespec deci_second = { 0, 100 * 1000 * 1000 };
    
    void cw_beacon(int fd) {
        char* p = codes;
        for (const char* cp = Message; *cp; cp++) {
            if (*cp == '.') {
                *p++ = 1;
            } else if (*cp == '-') {
                *p++ = 1;
                *p++ = 1;
                *p++ = 1;
            } else {
                *p++ = 0;
                *p++ = 0;
            }
            *p++ = 0;
        }
    
        int rts = TIOCM_RTS;
        ioctl(fd, TIOCMBIS, &rts);
    
        while (1) {
            char* q;
            for (q = codes; q < p; q++) {
                int dtr = TIOCM_DTR;
    
                if (*q) {
                    ioctl(fd, TIOCMBIS, &dtr);
                } else {
                    ioctl(fd, TIOCMBIC, &dtr);
                }
                struct timespec remainder = { 0, 0 };
                nanosleep(&deci_second, &remainder);
            }
        }
    }
    
    int main() {
        int fd = open("/dev/ttyUSB0", O_RDWR);
        if (fd < 0) {
            perror("/dev/ttyUSB0");
            exit(3);
        }
        cw_beacon(fd);
    
    #if 0
        int mu = open("/dev/audio1", O_RDWR);
        if (mu < 0) {
            perror("/dev/audio1");
            exit(3);
        }
    #endif
    }
    
    
  • (unless otherwise marked) Copyright 2002-2014 YakPeople. All rights reserved.
    (last modified 2018-04-04)       [Login]
    (No back references.)