Giter Site home page Giter Site logo

wsprrypi's Introduction

Raspberry Pi bareback LF/MF/HF/VHF WSPR transmitter

Makes a very simple WSPR beacon from your RasberryPi by connecting GPIO port to Antenna (and LPF), operates on LF, MF, HF and VHF bands from 0 to 250 MHz.

Compatible with the original Raspberry Pi, the Raspberry Pi 2/3, and the Pi Zero.

This version uses https://github.com/F5OEO/librpitx You need to add gpu_freq=250 in /boot/config.txt. Without that transmiting is unstable"


Installation / update:


Download and compile code: sudo apt-get install git git clone https://github.com/F5OEO/WsprryPi.git cd WsprryPi git clone https://github.com/F5OEO/librpitx.git cd librpitx/src
make cd ../../ make

Install to /usr/local/bin: sudo make install

Uninstall: sudo make uninstall


Usage: (WSPR --help output):


If running from the console, recent versions of Jessie cause WsprryPi to crash when the console screen blanks. The symptom is that WsppryPi works for several transmissions and then crashes. The fix is to add "consoleblank=0" to /boot/cmdline.txt. JamesP6000#10

Usage: wspr [options] callsign locator tx_pwr_dBm f1 ... OR wspr [options] --test-tone f

Options: -h --help Print out this help screen. -p --ppm ppm Known PPM correction to 19.2MHz RPi nominal crystal frequency. -s --self-calibration Check NTP before every transmission to obtain the PPM error of the crystal (default setting!). -f --free-running Do not use NTP to correct frequency error of RPi crystal. -r --repeat Repeatedly, and in order, transmit on all the specified command line freqs. -x --terminate Terminate after n transmissions have been completed. -o --offset Add a random frequency offset to each transmission: +/- 80 Hz for WSPR +/- 8 Hz for WSPR-15 -t --test-tone freq Simply output a test tone at the specified frequency. Only used for debugging and to verify calibration. -n --no-delay Transmit immediately, do not wait for a WSPR TX window. Used for testing only.

Frequencies can be specified either as an absolute TX carrier frequency, or using one of the following strings. If a string is used, the transmission will happen in the middle of the WSPR region of the selected band. LF LF-15 MF MF-15 160m 160m-15 80m 60m 40m 30m 20m 17m 15m 12m 10m 6m 4m 2m -15 indicates the WSPR-15 region of band .

Transmission gaps can be created by specifying a TX frequency of 0

Note that 'callsign', 'locator', and 'tx_power_dBm' are simply used to fill in the appropriate fields of the WSPR message. Normally, tx_power_dBm should be 10, representing the signal power coming out of the Pi. Set this value appropriately if you are using an external amplifier.


Radio licensing / RF:


In order to transmit legally, a HAM Radio License is REQUIRED for running this experiment. The output is a square wave so a low pass filter is REQUIRED. Connect a low-pass filter (via decoupling C) to GPIO4 (GPCLK0) and Ground pin of your Raspberry Pi, connect an antenna to the LPF. The GPIO4 and GND pins are found on header P1 pin 7 and 9 respectively, the pin closest to P1 label is pin 1 and its 3rd and 4th neighbour is pin 7 and 9 respectively. See this link for pin layout: http://elinux.org/RPi_Low-level_peripherals

Examples of low-pass filters can be found here: http://www.gqrp.com/harmonic_filters.pdf TAPR makes a very nice shield for the Raspberry Pi that is pre-assembled, performs the appropriate filtering for the 20m band, and also increases the power output to 20dBm! Just connect your antenna and you're good-to-go! https://www.tapr.org/kits_20M-wspr-pi.html

The expected power output is 10mW (+10dBm) in a 50 Ohm load. This looks neglible, but when connected to a simple dipole antenna this may result in reception reports ranging up to several thousands of kilometers.

As the Raspberry Pi does not attenuate ripple and noise components from the 5V USB power supply, it is RECOMMENDED to use a regulated supply that has sufficient ripple supression. Supply ripple might be seen as mixing products products centered around the transmit carrier typically at 100/120Hz.

DO NOT expose GPIO4 to voltages or currents that are above the specified Absolute Maximum limits. GPIO4 outputs a digital clock in 3V3 logic, with a maximum current of 16mA. As there is no current protection available and a DC component of 1.6V, DO NOT short-circuit or place a resistive (dummy) load straight on the GPIO4 pin, as it may draw too much current. Instead, use a decoupling capacitor to remove DC component when connecting the output dummy loads, transformers, antennas, etc. DO NOT expose GPIO4 to electro- static voltages or voltages exceeding the 0 to 3.3V logic range; connecting an antenna directly to GPIO4 may damage your RPi due to transient voltages such as lightning or static buildup as well as RF from other transmitters operating into nearby antennas. Therefore it is RECOMMENDED to add some form of isolation, e.g. by using a RF transformer, a simple buffer/driver/PA stage, two schottky small signal diodes back to back.


TX Timing:


This software is using system time to determine the start of WSPR transmissions, so keep the system time synchronised within 1sec precision, i.e. use NTP network time synchronisation or set time manually with date command. A WSPR broadcast starts on an even minute and takes 2 minutes for WSPR-2 or starts at :00,:15,:30,:45 and takes 15 minutes for WSPR-15. It contains a callsign, 4-digit Maidenhead square locator and transmission power. Reception reports can be viewed on Weak Signal Propagation Reporter Network at: http://wsprnet.org/drupal/wsprnet/spots


Calibration:


As of 2017-02, NTP calibration is enabled by default and produces a frequency error of about 0.1 PPM after the Pi has temperature stabilized and the NTP loop has converged.

Frequency calibration is REQUIRED to ensure that the WSPR-2 transmission occurs within the narrow 200 Hz band. The reference crystal on your RPi might have an frequency error (which in addition is temp. dependent -1.3Hz/degC @10MHz). To calibrate, the frequency might be manually corrected on the command line or a PPM correction could be specified on the command line.

NTP calibration: NTP automatically tracks and calculates a PPM frequency correction. If you are running NTP on your Pi, you can use the --self-calibration option to have this program querry NTP for the latest frequency correction before each WSPR transmission. Some residual frequency error may still be present due to delays in the NTP measurement loop and this method works best if your Pi has been on for a long time, the crystal's temperature has stabilized, and the NTP control loop has converged.

AM calibration: A practical way to calibrate is to tune the transmitter on the same frequency of a medium wave AM broadcast station; keep tuning until zero beat (the constant audio tone disappears when the transmitter is exactly on the same frequency as the broadcast station), and determine the frequency difference with the broadcast station. This is the frequency error that can be applied for correction while tuning on a WSPR frequency.

Suppose your local AM radio station is at 780kHz. Use the --test-tone option to produce different tones around 780kHz (eg 780100 Hz) until you can successfully zero beat the AM station. If the zero beat tone specified on the command line is F, calculate the PPM correction required as: ppm=(F/780000-1)*1e6 In the future, specify this value as the argument to the --ppm option on the comman line. You can verify that the ppm value has been set correction by specifying --test-tone 780000 --ppm on the command line and confirming that the Pi is still zero beating the AM station.


Example usage:


Brief help screen ./wspr --help

Transmit a constant test tone at 780 kHz. sudo ./wspr --test-tone 780e3

Using callsign N9NNN, locator EM10, and TX power 33 dBm, transmit a single WSPR transmission on the 20m band using NTP based frequency offset calibration. sudo ./wspr N9NNN EM10 33 20m

The same as above, but without NTP calibration: sudo ./wspr --free-running N9NNN EM10 33 20m

Transmit a WSPR transmission slightly off-center on 30m every 10 minutes for a total of 7 transmissions, and using a fixed PPM correction value. sudo ./wspr --repeat --terminate 7 --ppm 43.17 N9NNN EM10 33 10140210 0 0 0 0

Transmit repeatedly on 40m, use NTP based frequency offset calibration, and add a random frequency offset to each transmission to minimize collisions with other transmitters. sudo ./wspr --repeat --offset --self-calibration N9NNN EM10 33 40m


Reference documentation:


http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf http://www.scribd.com/doc/127599939/BCM2835-Audio-clocks http://www.scribd.com/doc/101830961/GPIO-Pads-Control2 https://github.com/mgottschlag/vctools/blob/master/vcdb/cm.yaml https://www.kernel.org/doc/Documentation/vm/pagemap.txt


Credits:


Credits goes to Oliver Mattos and Oskar Weigl who implemented PiFM [1] based on the idea of exploiting RPi DPLL as FM transmitter.

Dan MD1CLV combined this effort with WSPR encoding algorithm from F8CHK, resulting in WsprryPi a WSPR beacon for LF and MF bands.

Guido PE1NNZ [email protected] extended this effort with DMA based PWM modulation of fractional divider that was part of PiFM, allowing to operate the WSPR beacon also on HF and VHF bands. In addition time-synchronisation and double amount of power output was implemented.

James Peroulas [email protected] added several command line options, a makefile, improved frequency generation precision so as to be able to precisely generate a tone at a fraction of a Hz, and added a self calibration feature where the code attempts to derrive frequency calibration information from an installed NTP deamon. Furthermore, the TX length of the WSPR symbols is more precise and does not vary based on system load or PWM clock frequency.

Michael Tatarinov for adding a patch to get PPM info directly from the kernel.

Retzler András (HA7ILM) for the massive changes that were required to incorporate the mailbox code so that the RPi2 and RPi3 could be supported.

Evariste COURJAUD F5OEO : adapt to use librpitx and simplify code [1] PiFM code from http://www.icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter [2] Original WSPR Pi transmitter code by Dan: https://github.com/DanAnkers/WsprryPi [3] Fork created by Guido: https://github.com/threeme3/WsprryPi [4] This fork created by James: https://github.com/JamesP6000/WsprryPi

wsprrypi's People

Contributors

danankers avatar f5oeo avatar ha7ilm avatar jamesp6000 avatar jcp-sd avatar kukabu avatar threeme3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wsprrypi's Issues

Transmission starts, then stops after about 1 second

Running the following command:

sudo wspr -n wa6ydq cm98 10 30m

Listening on 10.140, I can hear the transmission start. After a little less than 1 second, it stops transmitting. The program keeps running. This is the program output:
WSPR packet contents:
Callsign: WA6YDQ
Locator: CM98
Power: 10 dBm
Requested TX frequencies:
10.140200 MHz
Extra options:
NTP will be used to periodically calibrate the transmission frequency

Ready to transmit (setup complete)...
Desired center frequency for WSPR transmission: 10.140200 MHz
Transmitting immediately (not waiting for WSPR window)
Obtained new ppm value: 28.5143
TX started at: UTC 2018-04-04 02:58:23.498
Channel 14 CBSize 2000 UsermemSize 1000
Using mbox device /dev/vcio.
68000 Size NUM PAGES 17 PAGE_SIZE 4096
BufferSize 1000 , cb 2000 user 1000
Info:NTP find ppm=28.514297
Info:NTP find ppm=28.514297
Info:NTP find ppm=28.514297
Freq = 1201723187
multiplier:48.588458 divider:92 VCO: 932.9MHz
Master PLLA Locked
Clk Number 4 div 92 frac 0
Freq = 500000006
PCM prediv = 837
PCM clk=4091 / 2400

When I run the test tone the same thing happens:

sudo wspr -n --test-tone 10140000
A test tone will be generated at frequency 10.140000 MHz
NTP will be used to calibrate the tone frequency

Info:NTP find ppm=28.514297
Freq = 1201698596
Transmitting test tone on frequency 10.140000 MHz
Press CTRL-C to exit!
multiplier:48.587500 divider:92 VCO: 932.9MHz
Master PLLA Locked
Clk Number 4 div 92 frac 0

Transmission starts, the after a little less than 1 second, it stops. Program continues to run.

So far, 30M is the only band tested.

  • kurt

Raspian Buster - strange behaviour - frequency is some kHz off - sends always on first band

Hi,

yesterday i was looking for another repo because i installed the new raspian buster on a pi 3b+ on which i used WsprryPi from JamesP6000 which was pretty ok. After installing a fresh raspian buster the compiler stopped with an error: undefined reference to 'makedev'

Your version seems to be newer, so i tried this. The compiler works, i see the error shortly but only as warning.

If i start with the same command line like this:
sudo /home/pi/WsprryPi/wspr --repeat --self-calibration DO7TIM JN39 10 10m 15m

the output seems to be ok, but the transmission is only 10m even if the frequency shows 15m ! The frequency is about 3 kHz off, the entry gpu_freq was done and i installed ntp and ntpstat.
I have a kiwi-SDR, so i can see what the raspi does.

Desired center frequency for WSPR transmission: 28.126100 MHz <- OK
Waiting for next WSPR transmission window...
TX started at: UTC 2019-06-26 15:24:01.001
TX ended at: UTC 2019-06-26 15:25:52.638 (111.637 s)
Desired center frequency for WSPR transmission: 21.096100 MHz <- sends 10m too
Waiting for next WSPR transmission window...
TX started at: UTC 2019-06-26 15:26:01.000
TX ended at: UTC 2019-06-26 15:27:51.418 (110.417 s)
Desired center frequency for WSPR transmission: 28.126100 MHz
Waiting for next WSPR transmission window...
TX started at: UTC 2019-06-26 15:28:01.000

i use a combined 10m/15m-Antenna and bandpass-filter

Thank you

PCM Frequency out of range

Please can you help me.

I installed WsprryPi yesterday and every time I try and run a transmission this is what I get:

sudo ./wspr --repeat --offset --self-calibration ZS6RAS KG44 20 40m
WSPR packet contents:
Callsign: ZS6RAS
Locator: KG44
Power: 20 dBm
Requested TX frequencies:
7.040100 MHz
Extra options:
NTP will be used to periodically calibrate the transmission frequency
Transmissions will continue forever until stopped with CTRL-C
A small random frequency offset will be added to all transmissions

Ready to transmit (setup complete)...
Desired center frequency for WSPR transmission: 7.040035 MHz
Waiting for next WSPR transmission window...
Obtained new ppm value: -6.20636
TX started at: UTC 2018-07-08 08:50:01.000
Channel 14 CBSize 2000 UsermemSize 1000
Using mbox device /dev/vcio.
68000 Size NUM PAGES 17 PAGE_SIZE 4096
BufferSize 1000 , cb 2000 user 1000
Info:NTP find ppm=-6.206360
Info:NTP find ppm=-6.206360
Info:NTP find ppm=-6.206360
Freq = 1000000012
Master PLLA Locked
Clk Number 4 div 133 frac 0
Freq = 1000000012
PCM clk=6849 / 1290
PCM Frequency out of range

I am using a Raspberry Pi Model 3B and RASPBIAN STRETCH LITE.

Frequency hopping is not working

In original code, band hopping is not working.
I have change the code to the following to make it work.

***** wspr.cpp: Original *****************************************************

if(ngfmtest==NULL)
{
ngfmtest=new ngfmdmasync(center_freq_actual,SR,14,FifoSize,true);
FreqPWM=(float*)malloc(Upsample*sizeof(float));
}
else
ngfmtest->enableclk(4);

***** wspr.cpp: Changed *****************************************************

ngfmtest=new ngfmdmasync(center_freq_actual,SR,14,FifoSize,true);
FreqPWM=(float*)malloc(Upsample*sizeof(float));
ngfmtest->enableclk(4);

And also add call cleanup(); function at the end of tx.

// Turn transmitter off
ngfmtest->disableclk(4);
cleanup();

Still unknown other issue after this modification.

Hope this help.

73 Joe
HS2JFW

70cm

Check why 70 cm is not yet decoded.

WsprryPi tx running beyond 120 sec window

Seeking some assistance
Over the last month I have tried (many times) to get WsprryPi running on a variety of RPis (3s and 4s) and even with a range of operating systems (Buster, Ubuntu mate etc) but with the same outcome. Instead of transmissions terminating after 100 secs or so, they continue for more like 217 secs. The system then waits for the next window and resumes transmitting - this time for 220 secs. The pattern continues 217, 220, 217, 220 secs etc. I have been downloading the WsprryPi software from F5OEO on github each time onto a clean SD card, freshly loaded with the operating system. As unlikely as it seems, is there a bug in the currently available version of WsprryPi? I've used WsprryPi in the past with no issues. Hoping for some advice. regards Grant Symons

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.