Showing posts with label hamradio. Show all posts
Showing posts with label hamradio. Show all posts

Thursday, February 22, 2018

Setting up my hackrf on ubuntu 17.10

Setting up my hackrf on ubuntu 17.10



sudo apt-get install gcc-arm-none-eabi

sudo apt install cmake
sudo apt install hackrf

if the hackrf command above did not work then follow the following steps


git clone https://github.com/mossmann/libopencm3.git
cd libopencm3/
ls
cd ../hackrf/
ls
git submodule init
git submodule update
cd firmware/libopencm3/
make
sudo synaptic
xhost +
sudo synaptic
make
sudo apt-get install gcc-arm-none-eabi
cd hackrf/firmware/hackrf_usb/build
mkdir build
cd build
cmake ..

hackrf_spiflash -w hackrf_usb.bin

Update firmware
hackrf_spiflash -w hackrf_one_usb.bin
hackrf_info

hackrf_cpldjtag -x hackrf_cpld_default.xsvf
hackrf_info

Saturday, November 26, 2016

Creating a 2m Fm Repeater with a Raspberry Pi (B) and a RTL dongle.

Creating a 2m Fm Repeater with a Raspberry Pi (B) and a RTL dongle. (Don't use this application without the RF filter)

RTL dongles is available from Giga Technology and the filter will be available soon.



For the purpose of this configuration I expect your Raspberry pi to be connected to the internet.
How will this repeater work.
This configuration was done with the latest Raspbian Os for Raspberry Pi downloaded from here https://www.raspberrypi.org/downloads/
I used my original Raspberry Pi B+ and also repeated  this on a Banana Pi
 as I need a hard drive to compile gnuradio for later SDR use.

I will be using a rtl dongle to receive my input signal on 70cm frequency configurable on the amateur 2m or 70cm band. The receiver signal will then be demodulated and re transmitted with a DSP Library simulating a FM Signal using a GPIO pin on the Raspberry as an transmitter.

Get your Raspberry Pi on the latest patch/update.

sudo apt-get update
sudo apt-get upgrade
Go and get some Coffee as it might take long time to update ..zzz...... ;-) 

Install the SDR command line application to access rtl  USB dongle.
This rtl library allow you to demodulate the fm / ssb input

sudo apt-get install rtl-sdr-0.5.3-3 mplayer octave gnuplot gnuplot-x11


Download the Fm transmitter software from github using the following command

Install the rpitx python library using the following command. 

rpitx is the main software to transmit. It allows to transmit from:
  • IQ files *.iq (can be generated by external software like GNU Radio).
  • Frequency/Time files *.ft (generally used to easily implement digital modes)
Installation of rpitx

git clone https://github.com/F5OEO/rpitx git clone https://github.com/F5OEO/rpitx
cd rpitx # make sure to have access to the internet to download packages # or download and install them manually (libsndfile1-dev and imagemagick) 
./install.sh

Ok lets create some IQ files that will be used  to test the transmitter.

SSB Transmiiter
./pissb sampleaudio.wav ssbIQ.wav


A sample script testssb.sh is included.


FM modulation

pifm converts an audio file (Wav, 48KHz, 1 channel, pcm_s16le codec) to Narrow band FM (12.5khz excursion) and outputs it to a .ft file. Assuming your audio file is in your current working directory ./pifm sampleaudio.wav fm.ft

Connect a antenna to pin 4  long wire 40cm or longer depending on 1/4 lent of wavelength.
Pin Connection Diagram. Use coaxial cable to make connection
Here is a link with the filter details for the 2m Band


You could then transmit it on 100MHZ (please set a correct frequency to be legal) 
sudo ./rpitx -m RF -i fm.ft -f 100000 -l -c1


A sample script : testfm.sh is included.  add -c1 for pin 4 transmission in file

VFO
A VFO mode is provided to allows precise frequency resolution. For example to set a carrier on 100MHz (please set a correct frequency to be legal)sudo ./rpitx -m VFO -f 100000 -c1

Ok we got the Transmitter working Now lets get the rtl dongle working.
Follow my steps here http://zr6aic.blogspot.co.za/2013/02/setting-up-my-raspberry-pi-as-sdr-server.html

When you are complete with installation of rtl_sdr and have tested it wit rtl_test -t we can now check what audio devices the raspberry have.

sudo aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Now we need to install some audio utility programs to pyp and convert audio signals
sudo apt-get install sox libsox-fmt-all
ok lets test to see if we can receive 2m band transmission.

Tune the the rtl dongle for a frequency of 145.500Mhz and transmit a test signal.

sudo rtl_fm -f 145500000 -M fm 

Transmit a mp3 file recording
sox -t mp3 zr6aic_CQ_mono.mp3 -t wav -r 48000 -c 1 - | sudo ./pifm - 145.5 -c1

Installing ffmpeg


# build and install x264
git clone --depth 1 git://git.videolan.org/x264 cd x264 
./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl 
make -j 4
sudo make install

 # build and make ffmpeg
git clone --depth=1 git://source.ffmpeg.org/ffmpeg.git cd ffmpeg
./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
make -j4
sudo make install


Install the following utility classes to help with the audio manipulation
sudo apt-get install libav-tools sox oggfwd libsndfile1-dev
sudo apt-get install fftw3 libfftw3-dev

Install csdr
git clone https://github.com/simonyiszk/csdr.git 
cd csdr 
git fetch 
git checkout dev 
make && sudo make install

Testing transmitter with Audio file (pin4 = -c1)
(while true; do cat speech48000.raw; done) | csdr convert_i16_f | csdr gain_ff 700 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 145000 -c1

Putting the rpitx transmitter in TCP port listening mode (replace ip with Raspberry pi ip)
Sending audio from remote computer. (using mike from Linux computer)
arecord -fS16_LE -r48000 -c1 - | nc 192.168.10.128 8011

Testing RTL_fm (replace ip with your Raspberry ip)
sudo rtl_fm -M wbfm -f 98000000 | play -t raw -r 24k -es -b 16 -c 1 -V1 -
sudo rtl_fm -M wbfm -f 98000000 |nc  192.168.10.128 8011 -


Send rtl_dongle to transmitter (replace with your raspnerry ip)
sudo rtl_sdr -s 250000 -f 144300000 -p 0 - | nc -vv 192.168.10.128 8011
sudo rtl_sdr -s 4800 -f 144300000 -p 0 - | nc -vv 192.168.10.128 8011
 

Working RX with rtl dongle
sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 8000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 145300 -c1

Working TX with pin 4

sudo rtl_fm -s48000 -g 49.6 -l 0 -M fm -f 434400000 |nc  192.168.10.128 8011 -

here is repeater without sqaulse


How to make the Repeater to auto start when the Raspberry start boot up.

Create a file and edit it
sudo vi /etc/init.d/Repeater

Add the following in the file and save it

#! /bin/sh

# /home/pi/sh/run_repeater.sh

### BEGIN INIT INFO

# Provides:          SDR repater start script
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Simple script to start a program at boot
# Description:       A simple script from www.stuffaboutcode.com which will start / stop a program a boot / shutdown.
### END INIT INFO

# If you want a command to always run, put it here


# Carry out specific functions when asked to by the system

case "$1" in
  start)
    echo "Starting SDR_repeater"
    # run application you want to start
    /home/pi/sh/run_repeater.sh
    ;;
  stop)
    echo "Stopping SDR_Repeater"
    # kill application you want to stop
    killall rtl_fm
    killall rpitx
    ;;
  *)
    echo "Usage: /etc/init.d/Repeater {start|stop}"
    exit 1
    ;;

esac

Make the file executable

sudo chmod 755 /etc/init.d/Repeater


Create a file in the /home/pi/sh/run_repeater.sh

Vi /home/pi/sh/run_repeater.sh

Add the Repeater script define above in this file so that it can auto start on boot time.


sudo rtl_fm -p 38 -s48000 -g 0 -l 3 -M fm -f 434400000 |csdr convert_i16_f | csdr gain_ff 12000 | csdr convert_f_samplerf 20330 | sudo rpitx -i- -m RF -f 145293 -c1&


Test the start and stop script.


Start the Repeater

sudo /etc/init.d/Repeater start

Stop The Repeater

sudo /etc/init.d/Repeater stop

Here is a video of the Test of the repeater ( I have changed the wires with a coaxial cable)


Video testing Fm demod and re mod cross band


What else can I do

Creating APRS transmitter
Setting up APRX rpitx with Raspberry Pi

aprs --callsign <callsign> --output - "<message>" | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -m RF -i - -f 144800 -c1

Repeater configured in a single line 
sudo rtl_fm -p 38 -s48000 -g 0 -l 0 -M fm -f 434400000 |csdr convert_i16_f | csdr gain_ff 12000 | csdr convert_f_samplerf 20330 | sudo rpitx -i- -m RF -f 145293 -c1


Specifications (measured with New Low pass filter board )

Here is some results of Power measurements at 145Mhz. (@50ohm) 

  • Voltage  1.3V
  • Power 32.7 mW  (15.1dBm)

Total power consumption on power supply when repeater is running

Measured  5.44 V  and  540mA  = Total watts   2.937Watts

Monday, February 22, 2016

Geostationary AMSAT Satellite (Phase 4) Spacecraft Covering the whole of Africa and Europe. (P4B) Es'hail-2

I think this Satellite will open up one of the most exiting telecommunication capabilities for Africa and Europe.(P4A/B) Es'hail-2 OS-100

Coverage map

Phase 4 AMSAT-DL planed

Qatar Satellite Company’s second satellite, Es’hailSat-2 (OS-100), will be placed in a geostationary orbit by a Space-X Falcon-9 rocket in November 2018. It will carry an AMSAT linear transponder as a secondary payload, giving Radio Amateurs access to a geostationary satellite for the first time.

Es’hailSat-2 will be “parked” 35 786 km above the equator at 25.5°East, nearly due North from Pretoria and Johannesburg (which are at 28°E).

Planned Frequency.

This satellite will have two linear transponders. (250 Khz and 8Mhz wide)
Narrow band transponder:
Up-links: 2400.050 - 2400.300 MHz modes SSB and CW. 5 Watt up link power,
Down links: 10489.550 - 10489.800 center 10 489.675 MHz. Vertical polarization.

Wide band transponder:
Up-links: 2401.500 - 2409.500 MHz
Down-links: 10491.000 -10499.000 MHz 

It will be so nice to have fixed antennas mounted on mast pointing to the satellite having continuous communication to any where in Africa and Europe. HI ;-) ;-)

Will have to start looking for some equipment and antennas for this one.

Link to Live websdr http://zr6aic.giga.co.za:8902

Live SDR of Es'hail 2 OS-100

Here is a list of Equipment that should work for the P4A satellite.

X-Band 10 GHz Down link:



HailSat-2 Down link configuration.

Please note Some LNB's is using a 22khz tone to switch Polarization.

Only the Generic LNB work with voltage switching.

Click to enlarge Satellite Systems



Here is how I inject my power. The black typed lead has an short peas of coaxle cable with an Inductor on Center peas going to a 13V Power supply.
Power DC blocker and Power injection

Top coax go to LNB
Left Bottom go to SDR and has build in Cap to isolate dc from SDR
Right Bottom has inductor on center going to 13V Power supply
Power Injection and DC isolation to SDR

I have change the LNB  to new one here is the LO details


LO 9.75 for 13V
I  had to do some calculations

Satellite frequency  For now is 10.706 - 9.75 = 0.956Mhz


For Narrow 250Khz Band Polarization is 0 deg V
Add caption 0 Deg V Polarization
Here is my 2.4Ghz Transmitting Antenna
2.4Ghz Tx Grid



Dish 60deg Elevation about 0 Deg Azimuth




2.4Ghz Transmitting Grid
View from back of two Antennas
Grid Mobile configuration

15db Grid antenna. just made it into satellite with ssb. CW was fine.


LNB (14 - 18V Polarization switching) 10.7Ghz

Generic one Port LNB Available from Giga Technology
Video of my first test on Eshail-2 using  Hackrf and preamp with and 2W PA and 2.4Ghz 15db Grid Antenna


Link to Live websdr http://zr6aic.giga.co.za:8902/
Websdr http://zr6aic.giga.co.za:8902


I think the signal must look lie this



Linear transponder 2400.050 - 2400.300 MHz Up-link 10489.550 - 10489.800 MHz Down link
Wide band digital transponder 2401.500 - 2409.500 MHz Up-link 10491.000 - 10499.000 MHz Down link

My RTL dongle needs to listen on the following frequency

LO with 12V injection = lo - 10.489500Ghz + 1M to get center of bottom of the Spectrum on websdr
=9.75Ghz - 10.489500Ghz + 1Mhz = 7395Mhz (this is still debatable )
  • 89 cm dishes in rainy areas at EOC like Brazil or Thailand.
  • 60 cm around coverage peak,
  • 75 cm dishes at peak -2dB.
Narrow Band : linear vertical polarization.
Wide Band: linear horizontal polarization.

S-Band 2.4 GHz Narrow Band-Uplink:
    • Narrow band modes like SSB, CW
    • 5W nominal Uplink power (22.5 dBi antenna gain, 75cm dish)
    • RHCP polarization

S-Band 2.4 GHz Wide Band-Uplink (DATV):

    • Wide band modes, DVB-S2
    • Peak EIRP of 53 dBW (2.4m dish and 100W) required
    • RHCP polarization


Azimuth and Elevation details for Johannesburg South Africa.
(For now the Elevation is 59.17 and Azimuth 350.43)

Azimuth and Elevation from Johannesburg
 Setting up elevation the simple way.


Paper with a piece of string at back of Dish

 Here is the Paper details


Gpredict tracking details.

Catalog number of Satellite is 43700

It seems that the satellite is still rotating around the equator

With the new TLE the Satellite has stabilized. at 59.17 Elevation and 350.43 Azimuth

Elevation is now 59.17 and Azimuth 350.43

2.4GHZ Transmitter.


The plan is to use my LimeSDR or hackrf for transmitter with low pass filter and a Power AMP. Details to follow

2.4Ghz Transmitter Diagram

Gnuradio Block diagram for Hackrf SSB


SSB Transmitter for Eshail2

Antenna setup

15db 2.4Ghz wifi Grid Antenna
I would recommend the 24db Grid or rather use 8 watt amp in 15db Grid.
Here is my presentation at the SARL on QO-100

My new transceiver setup.

  • 1) Raspberry Pi 3B +
  • Hackrf.
  • MSI SDR dongle 10Mhz Bandwith 12bit. RX.
  • 8W RF Amp.
  • 40db Pre-Amp
My Eshail-2 QO-100 transceiver setup.
Software on Raspberry Pi
Connect remotely via Wifi



Now start testing my Horizontal DBV-S2 Reception.

Video of DBV-S2 reception.



DBV-S2 decoding using leansdr (leandbv)



I will add more details soon.


https://docs.google.com/presentation/d/195l60I4IvKEl59Dl87AVFxjkrKzAcY5ZyUXNKXBXBcs/edit?usp=sharing


You can generate your own elevation and azimuth here http://www.satlex.us/en/azel_calc-params.html?satlo=&user_satlo=25.5&user_satlo_dir=E&location=-26.16%2C28.03&la=-26.16&lo=28.03&country_code=za&diam_w=75&diam_h=80

 REF:
Information http://amsat-uk.org/2015/07/03/phase-4-spacecraft-frequencies/
and here http://www.itu.int/en/ITU-R/space/workshops/2015-prague-small-sat/Presentations/Eshail-2.pdf
Spectrum Analizer for RTL https://github.com/pavels/spektrum/releases

Frequency list  http://frequencyplansatellites.altervista.org/Beacon-Telemetry_Europe-Africa-MiddleEast.html

Azimuth direction finding  http://www.satsig.net/ssazelm.htm