Quantcast
Channel: TECH-BLOG

WEBSDR – 11 SETUP INSTRUCTIONS

$
0
0

========================================================================
Upgrade instructions for the WebSDR server (20140709, pa3fwm@websdr.org)
========================================================================

This upgrade essentially boils down to unpacking the new version in the
right place, stopping the old version, and starting the new version.
See below for more details.
Note: the procedure is the same as before, except for step 3.
If you need any help with this procedure, please contact me.


—————————————————————————
Advantages of the new version:  (or: why should I bother with the upgrade?)
—————————————————————————

New features for the users:

* Support for HTML5 audio as an alternative to the use of Java applets.
  This works on recent versions of Firefox, Chrome, Opera and Safari, but
  not on IE.

* Support for use on mobile devices running Android (using Firefox) and
  iOS (using Safari). There's a separate version of the web page for
  mobile use, optimized for their small screens, touch control, and limited
  processing power.

* Recording and then downloading the received audio (only HTML5 and not on
  Safari).

* Making a real-time graph of received signal strength.

* Controlling the receiver web page via the keyboard.


New things for you as the administrator:

* It's possible to enable larger bandwidth ("HiFi") audio for SSB and AM,
  up to about 7 instead of 4 kHz; however, it has some disadvantages, so
  please only enable this if really useful on your site. See "allowwide"
  in config.txt.

* Some limits related to the use of RTL-SDRs have been lifted. You can now
  use converters. However, this doesn't change the fact that these SDRs
  have a limited dynamic range, so don't use them unless you've verified
  that in your system they are not overloaded, e.g., by comparing reception
  to a normal good analog receiver on the same antenna.

* It is now possible to write a driver to attach other SDR hardware to the
  WebSDR software, similar to how the rtl_tcp driver works but with 16 bits
  per sample.
  However, this is untested. If you are serious about writing such a driver,
  please contact me.

* I've made some changes to the reporting to the websdr.org server; this
  should hopefully prevent the problems that in the past caused servers to
  drop from the list.

* You can now explicitly specify which IP addresses have sysop access; see
  "dotrust" in config.txt.

* If your soundcard's gain is not flat across the audio spectrum, you can
  now compensate for this; see "equalize" in config.txt.

* Many minor changes, including bug fixes and browser compatibility issues.


———————————
Step-by-step upgrade instructions
———————————

In order to upgrade to the new version, do the following:

1. Go to the /home/websdr directory, or wherever you installed the websdr.
   Just to be sure: this is the directory which has a subdirectory named
   'dist10a' containing the previous version.

2. Unpack the new websdr-dist11.tgz file here.
   This creates a subdirectory named 'dist11' containing the new version.
   It will not overwrite anything else.

3. If you want to support mobile devices, copy the file 'm.html' from the
   /home/websdr/dist11/pub2/ directory to /home/websdr/pub/ . You may
   want to edit this file later to change the text on the mobile site.

4. Stop the old websdr version, if you hadn't done so yet.

5. Change into the /home/websdr/dist11 directory, and start the
   program there: ./websdr
   Or ./websdr64 if you have a 64-bit system, or ./websdr-rpi if you're
   on a RaspberryPi.

6. If you had made any changes to the files in dist10a/pub2 , you may
   want to make them again in dist11/pub2 .
   Otherwise, the upgrade is complete!

If you have problems with the new version, you can easily go back to the
previous one, by stopping the new one, going to the dist10a directory and
starting websdr there again. Please report the problem to me.

———————————————————————————————————————————

ISSUE

On Thu, Aug 14, 2014 



> When i run ./websdr from within the new dist11 it get this error:



> error while loading shared directories: libcrypto.so.1.0.0 cannot open shared

> object file: no such file or directory.



> I ran the debian update manager and according to it all is up-to-date



Then you're apparently running an older version of Debian; the current

stable version of Debian does have that library. (That library was not

needed in previous WebSDR versions, but it is needed now for the HTML5

audio stream.)



But there were more people who had this problem; see below for a

possible workaround that may or may not work.



73, Pieter-Tjerk, PA3FWM



—————————————————————————————————————————————-

SOLUTION:



1. Problem running the latest WebSDR version due to missing libcrypto.so.1.0.0.

The best solution would of course be to upgrade your linux system to a

later version, but as a workaround, please try the following:



1) Download http://websdr.ewi.utwente.nl:8901/tmp/lib32/libcrypto.so.1.0.0

  or http://websdr.ewi.utwente.nl:8901/tmp/lib64/libcrypto.so.1.0.0

  depending on whether you have run a 32- or a 64-bit version of linux.

  (These files are simply copies from those of my Debian system; they are

  copyright by the OpenSSL project and are under the OpenSSL license.)



2) Put this libcrypto.so.1.0.0 file in the same directory as where the

  WebSDR binary is (i.e., something like /home/websdr/dist11/ )



3) Don't start the websdr simply as ./websdr or ./websdr64, but as follows:



    LD_LIBRARY_PATH=. ./websdr





    LD_LIBRARY_PATH=. ./websdr64



  The LD_LIBRARY_PATH thing tells your system's dynamic linker to also look

  for libraries in the current directory.


WEBSDR – DIST 11 Websdr.cfg – rtl_tcp Setup Information

$
0
0

When setting up a websdr system various sdr;s can be used:

I use 3 softrocks and 2 dvb rtl type dongles with HF nooelec converters (125meg shifting)

 

1. On one dvb dongle I use a raspberry pi as the tcp_rtl server  - 

When setting up this type of sdr you must add the correct config in into the websdr.cfg file

#RTL_TCP DONGLE SDR SETUP

#

band 20m

device !rtlsdr 192.168.1.162:1234 5

samplerate 1024000

centerfreq 14000

swapiq

progfreq 139000

# Example progfreq is equal to 14000 center freq + 125000 (hf converter shift)

#
antenna S9 Vertical on ground

gain -35

########################################################################

VERY IMPORTANT NOTE:

Remember to restart the tcp server each time a new change has been made to  the websdr.cfg file

 

This must be done:

as the websdr changes will not be synced correctly and the websdr changes will not be used on the tcp server.!!!!

stop the websdr 192.168.1.186

sudo kill process on tcp server

ps -ae to view process

start tcp server

FORMAT SAMPLE  rtl_tcp -a 192.168.1.162 [-p listen port (default: 1234)]
rtl_tcp -a 192.168.1.162 &

 

The rtl_tcp server will also run fine in Windows

 

The websdr.cfg file is the main file for sdr configuration.

 It is located in a directory called "cfg"  Usually located in "home/websdr/cfg"

 

NOTE: More configuration commands are available an located in the doc directory

SAMPLE:

org email joeman2116@gmail.com
#
# WebSDR server configuration file
# Lines starting with a hash (#) are comments.
# Each line consists of a keyword followed by one or more settings.
# The order of the lines is arbitrary, except that lines configuring
# a band should be together.
#
############################################################################
# first, a few generalities about the server:

# The maximum number of users.
# Estimating this in advance is a bit hard;.
# Roughly, a P3 1GHz should be able to handle 40 users, a P4 3GHz 200 users,
# but of course this depends on the number of bands and the samplerate(s).
# Also your internet uplink speed may be the limiting factor; count on about
# 100 kbit/s per user, depending on the compression level you choose.
maxusers 5

#log out users who do not change frequency in x seconds
#Can be useful if your site is popular and has limited internet bandwidth.

idletimeout 2000

# 2100 equals aprox 35 min
# On which port should the server listen?
# An obvious choice would be 80, so users don't need to specify it in the URL.
# However, this requires the websdr binary to be setuid root, see install.txt.
# A common alternative choice is 8901.
tcpport 8901

# If (and only if) you are running the WebSDR on a computer that is shared
# with users that you do not trust, uncomment the following line.
# It disables the system administration interface in sysop.html.
#donttrustlocalhost

fftplaneffort 2
#  Sets the FFTW library's planning effort to x, where x may be:
#  0 for FFTW_ESTIMATE
#  1 for FFTW_MEASURE
#   2 for FFTW_PATIENT
#   3 for FFTW_EXHAUSTIVE
#  Higher numbers make the program start up slower but may result in
# reducing the CPU load, because the library tries to optimize the FFT
# calculation. Default is 0.


# If your computer is on a 10.x.x.x or 192.168.x.x network on which there
# are no users that you do not trust, uncomment the following line.
# It enables the system administration interface in sysop.html also for computers
# on these local networks.
dotrustlocalnet

############################################################################

# If you do NOT want your WebSDR to register itself on http://www.websdr.org
# site, uncomment the following line:
#noorgserver

# The following lines contain information that is transmitted to websdr.org:

# What is your system's (public) hostname?
# (Note: give _only_ the hostname here, _not_ the complete URL; so leave out
# the 'http://' and the portnumber.)
# If left commented out, the www.websdr.org page will show the IP address.
#hostname websdr.example.org
hostname radman.no-ip.com

# Your system's locator square:
org qth FN65RT

# A short description of your site:
org description VE1BWV – Softrock SDR'S New Brunswick Canada

# If you want your logo to appear on the http://www.websdr.org site, do the following:
# – make a 48×48 (non-animated, please!) picture in a usual format, such as GIF, PNG or JPEG;
# – put it in the pub directory of your websdr server;
# – uncomment the following line and put your picture's filename in it:
org logo mylogo.gif
############################################################################


# We need to configure at least one band:

# First give it a short name, e.g. "20m":
band 40m

# From what sound device should the I/Q audio signals be read;
# typically either /dev/dsp or /dev/dsp0 is your system's primary sound card.
# If your system does not have OSS but does have ALSA, enter the ALSA device
# name here, preceeded by a dollar sign.
#
# OSS example:
#device /dev/dsp0
# ALSA example:
device $hw:0,0,0

# Samplerate in Hz:
samplerate 192000
##samplerate 9600

# Center frequency in kHz:
centerfreq 7185

# A short description of the antenna, for listing on websdr.org:
antenna S9 vertical

# If needed, you can amplify or attenuate the signals by a number of dB:
#gain 20
gain -35
# If you have a calibrated signal source, you can use this to calibrate the
# S-meter in dBm.


############################################################################

############################################################################


# We need to configure at least one band:

# First give it a short name, e.g. "20m":
band 20m

# From what sound device should the I/Q audio signals be read;
# typically either /dev/dsp or /dev/dsp0 is your system's primary sound card.
# If your system does not have OSS but does have ALSA, enter the ALSA device
# name here, preceeded by a dollar sign.
#
# OSS example:
#device /dev/dsp0
# ALSA example:
device $hw:2,0,0

# Samplerate in Hz:
samplerate 96000
#samplerate 192000

# Center frequency in kHz:
centerfreq 14230

#swapiq

# A short description of the antenna, for listing on websdr.org:
antenna s9 vertical

# If needed, you can amplify or attenuate the signals by a number of dB:
#gain 20
gain -45
# If you have a calibrated signal source, you can use this to calibrate the
# S-meter in dBm.


############################################################################
############################################################################


# We need to configure at least one band:

# First give it a short name, e.g. "20m":
band 17m

# From what sound device should the I/Q audio signals be read;
# typically either /dev/dsp or /dev/dsp0 is your system's primary sound card.
# If your system does not have OSS but does have ALSA, enter the ALSA device
# name here, preceeded by a dollar sign.
#
# OSS example:
# device /dev/dsp0
# ALSA example:
device $hw:1,0,0

# Samplerate in Hz:
samplerate 96000

# Center frequency in kHz:
centerfreq 18125


#swapiq

# A short description of the antenna, for listing on websdr.org:
antenna SD9 VERTICAL

# If needed, you can amplify or attenuate the signals by a number of dB:
gain -45

##gain -5
# If you have a calibrated signal source, you can use this to calibrate the
# S-meter in dBm.
noiseblanker 80

############################################################################
#RTL_TCP DONGLE SDR SETUP
#
band 20m
device !rtlsdr 192.168.1.162:1234 5
samplerate 1024000
centerfreq 14000
swapiq
progfreq 139000
antenna S9 Verical on ground
gain -35
########################################################################


#
# That's all, unless you want to configure more bands. In that case, just repeat
# the band section (starting at the 'band' keyword) from the above.
#
# Several more things can be configured; see config.txt for details.
#
audioformat 1

——————————————————————————————————————————–

——————————————————-CONFIG.TXT——————————————————-

home/websdr/dist/doc

====================================================================
Configuring the WebSDR                            PA3FWM, 2014-06-08
====================================================================

Almost all of the WebSDR is configured through a single file called
'websdr.cfg'.
This file contains first global settings, followed by configuration
for each band.
Each line starts with a keyword, followed by one or more arguments,
as detailed below.

====================================================================
Global configuration statements:
====================================================================

____________________
Access to the server
^^^^^^^^^^^^^^^^^^^^

myhost x
  Only bind to this address; useful if your server has multiple IP
  addresses. Note: if x is an IPv4 address, precede it with ::ffff: 
  to make it look like an IPv6 address.

tcpport x
  Set the TCP port number on which the server should work.
  (That's e.g. the 8901 in http://websdr.ewi.utwente.nl:8901/ )
  Default is 80, which is also the default web browsers use when none
  is specified. However, this requires running the websdr as root.

chroot x
  After starting, perform a chroot() to x.
  This can be used as a security measure (although I don't do it on my
  own server). It does require the websdr to be setuid root, but those
  privileges are dropped immediately as soon as possible.

rawpassword x
  Set a password to restrict access to the raw data stream.
  Default is no password. (This is not a security risk.)

donttrustlocalhost
  Including this line DISables sysop access even from the machine
  itself.
  You only need this if your websdr is running on a machine that is
  shared with users that you don't trust.
  The "sysop access" referred to includes two things:
  – using the administrator interface in sysop.html;
  – still accessing the receiver even if the maxusers limit has been
    reached.

dotrustlocalnet
  Including this line ENables sysop access from all computers in the
  local IP range (10.*.*.* and 192.168.*.*).
  Use this only if you trust all users on your local network.

dotrust x
  Allow sysop access from address x (you may include multiple addresses
  here, separated by spaces).

____________________
Where are the files?
^^^^^^^^^^^^^^^^^^^^

chatboxlogfile x
  Log all chatbox message into a file named x.

logfileinterval x
  Set the time (in seconds) after which the next logfile is started and
  the previous one is zipped. Default is 3600 (i.e., one hour).
  If you set it to 0, no log file is written, but log messages are sent
  to stderr.

logdir x
  Set the directory containing log files to x.
  Default is log

public x
  Set the directory containing the public files (html etc.) to x.
  Default is ../pub

public2 x
  Set the second directory containing the public files (html etc.) to x.
  This directory is also searched for server-side includes.
  Default is pub2

___________________
Processing settings
^^^^^^^^^^^^^^^^^^^

maxusers x
  Limits the number of simultaneous users to x.
  (Users from localhost or the local network can still be allowed
  beyond this limit; see the donttrustlocalhost and dotrustlocalnet
  settings.)

slowdownusers x
  Only allow slow waterfalls when number of listeners exceeds x.
  Useful to save CPU power on slow computers, or network bandwidth
  on slow links.

slowdownusers2 x
  Slow down waterfalls to half the normal minimum speed when number
  of listeners exceeds x.

fftplaneffort x
  Sets the FFTW library's planning effort to x, where x may be:
   0 for FFTW_ESTIMATE
   1 for FFTW_MEASURE
   2 for FFTW_PATIENT
   3 for FFTW_EXHAUSTIVE
  Higher numbers make the program start up slower but may result in
  reducing the CPU load, because the library tries to optimize the FFT
  calculation. Default is 0.

waterfallformat x
  Set the dataformat for the waterfall datastream.
  x=0 gives the old uncompressed, 8 bit per pixel format.
  x=8 uses on average 2.9 bits per pixel.
  x=9 is the default now: compression to between 1.5 and 2.3 bits
      per pixel with very few artefacts.

audioformat x
  Set the amount of compression for the audiodata.
  x can be from 0 to 3.
  The higher x, the larger the quantisation noise will be.
  Normally, x=0 (which is the default) should be good; but if your
  network bandwidth is really limited, you could try others.
  (I've used x=2 at my home system with hardly any user complaints;
  x=3 was found too noisy.)
  
initial x y
  Set the initial frequency to x kHz with mode y (usb/lsb/am/cw/fm).

allowwide
  Allow bandwidth setting of SSB and AM signals to be widened beyond
  the normal 4 and 8 kHz, respectively; useful for better sound quality
  on AM broadcast signals, but puts a higher load on the internet link.
  Also, this is only properly supported for HTML5 audio; there are
  aliasing products audible when using Java.
  Finally, changing the bandwidth while recording also may not work
  correctly (WAV files don't support changing samplerates).

idletimeout x
  Set a timeout of x seconds for idle users (i.e., users who don't
  change the frequency etc. for x seconds are disconnected).
  Can be useful if your site is popular and has limited internet
  bandwidth.


___________________________________________________________
Settings related to the appearance on http://www.websdr.org
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

noorgserver
  Including this line prevents your server from being listed on the
  http://www.websdr.org/ site.
  
hostname x
  Set your own hostname. If set, this name will be displayed on
  http://www.websdr.org instead of your IP address.

org …….
  Set data to be sent to the websdr.org server.
  Current possibilities are:
   org qth x               – set QTH locator
   org description x       – set a brief description of your site
   org logo x              - set the filename of the logo picture
   org email x             – your e-mail address
  Note: the e-mail address will NOT appear on websdr.org; it only serves
  to give PA3FWM your contact information so he knows whom to contact if
  there is a problem, and whom to send software updates to.
  Out of the above, only the logo is optional; the others are necessary.
                 


====================================================================
Per-band configuration statements:
====================================================================

band x
  Start configuration for a band named x.
  Should be the first statement of the settings for a band.

device x
  Sets the input device to x, like /dev/dsp0 .
  ALSA device names can be used too, prefixed by a '$', like  $hw:0,0,0

device x y
  Alternative syntax for use with a multi-input sound card.
  y is the device name like /dev/dsp0, while x is a single digit number:
  0 for the first two inputs, 1 for the next two inputs, etc.
  All bands sharing the card must have the same samplerate, and they
  cannot have the 'noniq' setting (see below), nor be ALSA devices.

device !rtlsdr x:y z    eg – !rtlsdr 192.168.1.162:1234 5

192.168.1.162 is one of my rtl_tcp server ip – using a raspberry pi

1234 is the tcp_rtl server port
5 is the freq correction – mine is 5

  Sets the input device to be an RTL-SDR (DVB-T USB dongle), through
  the rtl_tcp driver running at host x on port y, with ppm correction z.
  Supported samplerates for use with the RTL-SDR are 256000, 512000,
  768000, 1024000, 1536000, 2048000 and 2880000 Hz.
  For use with up/down converters, see 'progfreq' elsewhere in this document.

  When  using a raspberry pi as a server use a sample rate of 1024000

  Note: these dongles have a rather small dynamic range. As a consequence,
  when there are strong signals in the passband, weaker signals in the
  passband disappear into the noise floor. For a WebSDR this is not good,
  because the idea behind a WebSDR is that each user can tune independently
  to any signal within the band.
  So please run a WebSDR with an RTL-SDR only after you've verified that
  in your system it is not overloaded, e.g., by comparing reception of
  weak signals to a normal good analog receiver on the same antenna. 

extrazoom x
  Increase the maximum zoom depth by x steps.
  Each step doubles the maximum resolution, but halves the maximum
  (and default) waterfall scroll speed. The default is 0. Higher
  values may be useful to provide longer integration for long-duration
  carriers, but the WebSDR is not really a good tool for this…

samplerate x
  Set samplerate (in Hz). 1024000

centerfreq x
  Set center frequency (in kHz) 14000
  Note that the WebSDR software cannot control the SDR hardware (except
  the rtlsdr). In case of a fixed-frequency SDR, you just write the SDR's
  center frequency as determined by the SDR's crystal. If you have an
  SDR with a synthesizer, you need some external software to set the
  SDR hardware to the same frequency as you write here.

progfreq x

For my HF rtl dongle :

centerfreq 14000
progfreq 139000

My HF converter from nooelec uses 125meg shifting

centerfreq + 125000 (my converter freq) = progfreq

14000+125000 = 139000


  In case you have external SDR hardware of which the WebSDR software
  controls the frequency (practically speaking: RTL-SDRs), this setting
  can be used to specify to what frequency (in kHz) the hardware should
  be programmed, different from centerfreq. This is useful in case of
  use with an up/down converter.

noniq
  Input data is treated as a baseband signal (mono), instead of an I/Q
  quadrature (stereo) signal. This is useful for a VLF receiver, with
  the antenna connected directly to the soundcard.
  With 'noniq' set, the 'centerfreq' setting is interpreted not as the
  center of the passband, but as the left end of the passband (i.e., 0
  in the VLF case).

swapiq   

for my RTL DVB dongles I need to swapiq

  Swap the I and Q (left and right) channels.
  Use this if the passband appears mirrored.

balance x
  Read balancing data from file x.
  Use this to compensate for minor differences in the I and Q channels
  causing signals to appear "mirrored".
  See separate documentation in doc/iq-balance.txt .

antenna x
  Short description of the antenna, to be listed on http://www.websdr.org.

delay x
  Artificially delay signals by x seconds.
  Useful to prevent cheating in contests, if your receiver is so special
  that using it would give participants an unfair advantage (e.g., a very
  big dish for EME).

gain x
  Insert x dB of gain (may be negative).
  This does not make an audible difference; it only shifts the waterfall
  colour scale and the S meter, so you can use this to calibrate the
  S meter.

equalize z
  Read equalizing data from file x.
  This is basically a frequency-dependent version of the above 'gain'
  setting. It can be used to compensate for minor gain variations of
  the soundcard channels.
  The file has a very simple format: each line has a frequency in kHz
  and a corresponding gain correction in dB.
  The software will interpolate between the given frequencies.
  The frequencies are "audio"/"baseband" frequencies, not the radio
  frequencies.

hpf x
  Set the cut-off frequency to the input high-pass filter to x Hz.
  This filter cuts out the DC offset and possibly other low-frequency
  noise (e.g. mains hum) at the soundcard input.
  This is just a first-order filter, so it is not very steep.
  Setting it to 0 removes the filter entirely.
  Default is 500 Hz.

noiseblanker x
  Enables a simple noise blanker, where x sets the threshold factor.
  The higher x is, the higher the threshold above which a noise spike
  needs to rise to be blanked; a value on the order of 80 makes sense,
  but experimentation may be needed.
  Due to its simplicity, this noise blanker is probably only useful
  if you have rather strong local noise sources, e.g., an electric
  fence.


====================================================================
Station information for labels on the frequency scale
====================================================================

If you want to put some labels on the frequency scale, e.g., to mark
beacons or other permanent stations of special interest, you can put
them in a file called 'stationinfo.txt' in the cfg/ directory.
The format of this file is very simple: each line has a frequency
in kHz followed by a brief description (e.g., callsign).
You can also include a mode (am/usb/lsb/cw/fm) directly after the
frequency. For example:
  14100cw International beacons
This file is re-read every minute, so if you make a change, you do
not need to restart the server.

 

RTL_TCP – WINDOWS TCP SERVER FOR NETWORKING A DVB DONGLE – WINDOWS

$
0
0

Run a CMD window, drill down to the folder that contains the 


either the 32 or 64 bit version of rtl_tcp, and I execute that software 


with results as shown:





C:\rtltcp\x32\rtl_tcp

rtl_tcp -a 192.168.162      < ————————- note —– default port is 1234




Found 1 device(s).


Found Elonics E4000 tuner


Using ezcap USB 2.0 DVB0T/DAB/FM dongle


Tuned to 10000000 Hz.


Listening…


 

Windows

  • Download and extract the archive rtlsdr_win.zip

  • You should see the file zadig.exe and two directories: x32 and x64. these correpond to 32bit and 64bit rtl_sdr binaries.

  • Plug your RTL device in for the first time, Windows may request a driver or automatically install a driver from Microsoft – this is OK as it will be replaced in the next few steps. Don't install the software on the CD that comes with the device.

  • Run the Zadig.exe file and you should see the following with an empty list:

  • Click on Options and select “List All Devices”:

  • Choose the one that says “Bulk-In, Interface (Interface 0)”. This should be the primary endpoint of your RTL device:

  • In the box to the right of the green arrow make sure “WinUSB” is chosen – not libusb or libusbk. The big button underneath will say “Replace Driver” or “Reinstall Driver”. Before you proceed make sure the USBID matches the VID/PID.

  • Note that if you insert the dongle into a different USB port you may have to use Zadig again. It seems that you can change which driver is loaded depending on the USB port used. So you could use one USB port for RTLSDR and another port for using the dongle to watch DVB-T with the supplied Windows application.

  • In a command line window, run the test:

>> rtl_test.exe -t

 

RTL_TCP – Command Line – options

$
0
0

USAGE

       Run this  program  on  a  machine  with  an  rtl-sdr  supported  device
       connected  and  it  will  provide  I/Q  data  to other applications via
       TCP/IP.

SYNOPSIS

       rtl_tcp [OPTIONS]

OPTIONS

       -a listen address

       -p listen port (default: 1234)

       -f frequency to tune to [Hz]

       -g gain (default: 0 for auto)

       -s samplerate in Hz (default: 2048000 Hz)

       -b number of buffers (default: 32, set by library)

       -n max number of linked list buffers to keep (default: 500)

       -d device_index (default: 0)

Example:

       rtl_tcp -a 10.0.0.2 [-p listen port (default: 1234)]
               Found 1 device(s).
               Found Elonics E4000 tuner
               Using Generic RTL2832U (e.g. hama nano)
               Tuned to 100000000 Hz.
               listening...

SD CARD RESIZING

$
0
0

Manually resizing the SD card on Linux

Tutorial video here: http://www.youtube.com/watch?v=R4VovMDnsIE

Following on from the instructions above, keep the newly-written SD card in the card reader, but unmounted. We'll use the parted (partition editor) tool to resize the partitions.

  • Show partition information to find your SD card

$ df -h

Look for a partition that matches the roughly 2GB size of your distribution image.

  • Unmount the partition

$ umount /dev/sdc2

  • Use parted to examine the card
$ sudo parted /dev/sdd
(parted) unit chs
(parted) print
Disk /dev/sdd: 121535,3,31
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 121536,4,32.  Each cylinder is 65.5kB.
Partition Table: msdos

Number  Start      End         Type     File system     Flags
 1      16,0,0     1215,3,31   primary  fat32           lba
 2      1232,0,0   26671,3,31  primary  ext4
 3      26688,0,0  29743,3,31  primary  linux-swap(v1)
This shows how my SD card was formatted after writing the image. Notice that nothing uses the card from end of 'cylinder' 29743 to the card's maximum at 121535.
Partition 1 is the boot partition: we'll leave that alone. Partition 2 is the root partition, which we'll grow to fill most of the card. Some OS versions will have a Partition 3 for swap space, which needs to be moved to the end of the card. Note that on some other versions of linux (and some other versions of hardware) use /sde not /sdd.
  • Move the swap partition if it exists (you'll have to adjust the numbers so that the end of partition 3 is at the end cylinder/head/sector of the card)
  • to calculate the number to use in the following command do:- (Maximum - (Partition 3 End - Partition 3 Start) ) - 1 = Partition 3 New Start so in this example (121535 - ( 29743 - 26688)) -1 = 118479
  • Will not work with parted versions later than 2.4
(parted) move 3 118479,0,0
  • Now grow the root partition. This involves removing the partition, re-creating it, then using resize2fs to grow the filesystem to fill the partition. It won't destroy any data.
(parted) rm 2
(parted) mkpart primary 1232,0,0 118478,3,31
(parted) quit
Note that the starting address of the new partition is identical to its original value, and the ending address is immediately before the start of the swap partition.
  • Now clean and resize the root partition. As before, some users may need to use /sde2 instead.
$ sudo e2fsck -f /dev/sdd2
(allow it to add lost-and-found)
$ sudo resize2fs /dev/sdd2
  • Then put the card in the RPi and boot. You end up with a 7Gb partition to use.
pi@raspberrypi:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                  94M  4.0K   94M   1% /lib/init/rw
udev                   10M  168K  9.9M   2% /dev
tmpfs                  94M     0   94M   0% /dev/shm
rootfs                7.1G  1.3G  5.4G  20% /
/dev/mmcblk0p1         75M   28M   48M  37% /boot

Manually extracting partitions from the image on Linux

Get the information about offsets and sizes from the SD-Card-Image:

$ parted -s SD-Card-Image unit KiB print

Here, the -s option directs parted to go into scripting mode and the commands unit KiB print tells parted to display its results in blocks of 1024 byte (KiB, see also block size in GNU Coreutils docu) and print the partition table.

You will get some information like the following (this is created with the Raspbian Wheezy image dated 15-Jul-2012):

Disk SD-Card-Image: 1894400kiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start     End         Size        Type     File system  Flags
 1      4096kiB   61440kiB    57344kiB    primary  fat16        lba
 2      61440kiB  1894400kiB  1832960kiB  primary  ext4

Now you can extract the partitions with

 $ dd if=SD-Card-Image of=Part1 bs=1024 skip=4096 count=57344
 $ dd if=SD-Card-Image of=Part2 bs=1024 skip=61440 count=1832960

Fill in the skip and count parameters with the numbers for start and size, which you got from the parted command above.

Manually resizing the SD card using a GUI on Linux

If you are using a PC with a linux distribution to resize the partitions, you can run GParted to resize the partitions using a GUI. This method is tested on Ubuntu 10.10 using the Gnome desktop. Versions of GParted differ slightly in their GUIs.

GParted can be installed using:

  • sudo apt-get install gparted

Note: I had to physically remove and re-insert the SD card from the card reader after writing the image before the partitions were recognised properly and the following could be done.

  • Start GParted (on my system it is [System]->[Administration]->[GParted Partition editor]).
  • Select the drive corresponding to your SD card (was /dev/sdh/ on my system). You now see the partitions mentioned above (with some tiny unallocated areas in between and a large one after).
  • Select the swap partition by clicking on it.
  • If the Resize/Move toolbar icon or [Resize/Move] menu option is disabled, go to Partition / Unmount.
  • Select the menu option [Partition]->[Resize/Move] and drag the partition to the right (click/drag in the middle).
  • Select the ext4 partition.
  • If the Resize/Move toolbar icon or [Resize/Move] menu option is disabled, go to Partition / Unmount.
  • Resize the partition by dragging the right edge of the partition all the way to the right (click/drag the right edge).
  • When you are satisfied with the changes, click on the green check mark, "Return" arrow, or other "apply" control to execute these changes.

You're done!

Manually resizing the SD card on Raspberry Pi

You can also resize the partitions of the SD card that your Pi is running on.

First you need to change the partition table with fdisk. You need to remove the existing partition entries and then create a single new partition than takes the whole free space of the disk. This will only change the partition table, not the partitions data on disk. The start of the new partition needs to be aligned with the old partition!

Start fdisk:

sudo fdisk -cu /dev/mmcblk0

Then delete partitions with d and create a new with n. You can view the existing table with p.

  • p to see the current start of the main partition
  • d3 to delete the swap partition
  • d2 to delete the main partition
  • n p 2 to create a new primary partition, next you need to enter the start of the old main partition and then the size (enter for complete SD card). The main partition on the Debian image from 2012-04-19 starts at 157696, but the start of your partition might be different. Check the p output!
  • w write the new partition table

Now you need to reboot:

 sudo shutdown -r now

After the reboot you need to resize the filesystem on the partition. The resize2fs command will resize your filesystem to the new size from the changed partition table.

sudo resize2fs /dev/mmcblk0p2

This will take a few minutes, depending on the size and speed of your SD card.

When it is done, you can check the new size with:

df -h

SDCARD – SIZE REDUCER

$
0
0

by DeanC » Sat Oct 12, 2013 7:29 pm

This script will take a Raspbian image (.img) file and reduce it to it's smallest size. Once the reduce image is copied to a new SD card, make sure you expand the file system.


I have added a test in the script. It will stop the script from executing if an error is encountered while checking the file system that e2fsck cannot automatically fix. There is no reason to continue the script if the image is corrupt.


*** THIS SCRIPT ONLY WORKS ON RASPBIAN IMAGES. ***


To use this script, copy the code to a file called 'resizeimage.pl'. Then issue 'sudo perl ./resizeimage.pl'.


After burning, always remember to run 'sudo raspi-config' first thing, and expand the file system before use.

 
CODE: SELECT ALL
#!/usr/bin/perl

 

 

 

use utf8;
use 5.010;
use strict;
#use autodie;
use warnings;
#use diagnostics;

 

my $who = `whoami`;

 

if ($who !~ /root/)
{

 

   print "This should be run as root or with the sudo command.\n";
   exit 1;

 

}

 

if (!$ARGV[0])
{
   
   print "No image file given.\n";
   exit 1;
   
}

 

my $image = $ARGV[0];

 

if ($image !~ /^\//)
{

 

   print "Please enter full path to image file.\n";
   exit 1;
   
}

 

if (! -e $image)
{

 

   print "$image does not exist.\n";
   exit 1;
   
}

 

my @name = split (/\//, $image);
print "\n$name[(scalar @name) - 1]:\n";
print "=" x (length ($name[(scalar @name) - 1]) + 1) . "\n";

 

my $info = `parted -m $image unit B print | grep ext4`;

 

(my $num, my $start, my $old, my $dummy) = split (':', $info, 4);
chop $start;
chop $old;
printf "Old size - %d MB (%1.2f GB)\n", int ($old / 1048576), ($old / 1073741824);

 

my $loopback = `losetup -f --show -o $start $image`;
chop $loopback;

 

`e2fsck -p -f $loopback`;

 

if ($? != 0)
{

 

   print "There was an error in the file system that can't be automatically fixed... aborting.\n";
   `losetup -d $loopback`;
   exit 1;

 

}

 

$info = `resize2fs -P $loopback 2>&1`;

 

($dummy, my $size) = split (': ', $info, 2);
chop $size;
$size = $size + 1024;

 

`sudo resize2fs -p $loopback $size 2>&1`;
sleep 1;
`losetup -d $loopback`;

 

$size = ($size * 4096) + $start;

 

`parted $image rm $num`;
`parted -s $image unit B mkpart primary $start $size`;

 

$size = $size + 58720257;
printf "New size - %d MB (%1.2f GB)\n", int ($size / 1048576), ($size / 1073741824);

 

`truncate -s $size $image`;

 

my $diff = $old - $size;
printf "Image file was reduced by %d MB (%1.2f GB)\n", int ($diff / 1048576), ($diff / 1073741824);

 

exit 0;

Last edited by DeanC on Fri Jan 10, 2014 4:14 pm, edited 3 times in total.

 

 

SDCARD – script-automatic-rpi-image-downsizer

$
0
0

ALLCREDIT TO - http://sirlagz.net/2013/03/10/script-automatic-rpi-image-downsizer/

 

There’s been a few threads recently on the Raspberry Pi forums regarding SD Card images too big to fit on other SD cards.
So I’ve come up with a script to automatically resize SD Cards to the smallest size possible. At the moment it is Linux only unfortunately, but I may release a windows version if there’s demand.

The script can be downloaded from here

or copied and pasted from here

#!/bin/bash
# Automatic Image file resizer
# Written by SirLagz
strImgFile=$1


if [[ ! $(whoami) =~ "root" ]]; then
echo ""
echo "**********************************"
echo "*** This should be run as root ***"
echo "**********************************"
echo ""
exit
fi

if [[ -z $1 ]]; then
echo "Usage: ./autosizer.sh "
exit
fi

if [[ ! -e $1 || ! $(file $1) =~ "x86" ]]; then
echo "Error : Not an image file, or file doesn't exist"
exit
fi

partinfo=`parted -m $1 unit B print`
partnumber=`echo "$partinfo" | grep ext4 | awk -F: ' { print $1 } '`
partstart=`echo "$partinfo" | grep ext4 | awk -F: ' { print substr($2,0,length($2)-1) } '`
loopback=`losetup -f --show -o $partstart $1`
e2fsck -f $loopback
minsize=`resize2fs -P $loopback | awk -F': ' ' { print $2 } '`
minsize=`echo $minsize+1000 | bc`
resize2fs -p $loopback $minsize
sleep 1
losetup -d $loopback
partnewsize=`echo "$minsize * 4096" | bc`
newpartend=`echo "$partstart + $partnewsize" | bc`
part1=`parted $1 rm 2`
part2=`parted $1 unit B mkpart primary $partstart $newpartend`
endresult=`parted -m $1 unit B print free | tail -1 | awk -F: ' { print substr($2,0,length($2)-1) } '`
truncate -s $endresult $1

FLEX – DDUTIL AND VSP MANAGER

$
0
0

ARTICLE CREDIT: 

http://home.comcast.net/~k7rld/MultipleProgramswithPSDR.html

 

How to Run More Than One Program with PSDR / FLEX

You are correct. As is, there is only one road in and out of the FLEX so only one program can communicate with the FLEX at a time.

The way to accommodate other programs simultaneously is indeed to use DDUtil.

 

You must designate DDUtil, that one program that communicates with the FLEX, with a pair of virtual ports that you set up with a free program like VSPR.

Before leaving VSPR, make up 5 more pairs. You’ll see why soon. (Make sure you write them down somewhere.)

The beauty of DDUtil is that IT becomes the “interface”, if you will, for up to 5 programs to communicate simultaneously with PSDR/FLEX.

So, instead of only being able to use one program at a time, you let up to 5 programs communicate with DDUtil which in turn lets all of them communicate with PSDR simultaneously.

The Virtual Ports are key. One pair lets PSDR and DDUtil communicate. Each of the five other pairs are used to associate each of 5 programs communicate with DDUtil.

 

For Example:

You first have to set up the Virtual COM Ports.

Let’s say you set up  6 pairs of Virtual Ports with VSPR.

These can be ANY pairs of numbers as long the included COM ports aren’t being used by other things.

I randomly chose the following:

 COM4 and COM6

COM10 and COM12

COM16 and COM18

COM20 and COM22

COM26 and COM28

COM30 and COM32

Save VSPR by naming the saved file and put it into the windows “Startup Folder” so these ports are assigned each time the computer is booted.

For now, though, once you’ve save it, just start VSPR by selecting the forward arrow button.

Normally, RCP #1 is setup first due to the fact you don't want more than one program regularly polling the radio for frequency data. If RCP1 is setup DDUtil's internal polling is disabled. Not all RCP's poll the radio regularly and may only send commands to the radio when they want to know specific data. This is not good if you have a piece of equipment like an amplifier or tuner connected that expects up to date frequency data.

To complete the association of PSDR with DDUtil see below:

 1.      Chose PSDR “Setup”. Scroll over to CAT INTERFACE

2.      Enter COM4 in the PSDR/FLEX Setup. Save it. (I chose to use COM4 and COM6 for my first pair)

3.      Now launch DDUtil and go to the PORTS Tab.

4.      Enter COM6 under Serial Ports.

5.      That’s all there is to get PSDR and DDUtil to talk.

 

To Make DXLabs Commander Work with PSDR see below:

6.   Lets say you want to set up DXLabs Commander as the Rig Control Program. (You can just as easily  use HRD or others)

7.  Take another Virtual Pair of COM ports that we set up previously in VSPR. COM10 and COM12 for instance.

8.  With DDUtil still runniing, go to the RCP Tab.

9.   Enter COM10 under COM PORT as RCP2. Don't mess with anything else.

10  Then launch DXLabs Commander and select Configure.

11  Enter COM12, the other port in our Virtual Pair, where it asks for PORT.

12 Put in a speed of 57600 and then WORD 8, Parity none, STOP 1, DTR Off, RTS Off

13 Getting out of both DDUtil and Commander saves the entries so get out of both.

R   Relaunch DDUtil and Commander and you should see Commander show the PSDR frequency.

Remember that the virtual port program with all those ports you designated must also be running. That’s why I put both VSPR and DDUtil in the Startup Folder.
To make any other program work with PSDR, do the same thing as I did with Commander but use another one of the pairs of Virtual Ports we made earlier. One COM Port of the pair of COM ports goes in DDUtil under RCP3 and the other goes in the Config / Setup  of the program you want to work with PSDR.

 HINT: I put into the blank space for notes the description of each of those pairs as to what program that pair is used for. 

 This seems a lot more complicated than it is. I hope it helps and please email if you have any questions.

————————————————————————————————————————————-

I added a diagram of my current setup :

 

FLEX NETWORK1A

 


FLEX – VSP MANAGER / DDUTIL / VAC SNAPSHOTS

$
0
0

 

VSP MANAGER FLEX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DDUTIL3FLEX

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Normally, RCP #1 is setup first due to the fact you don't want more than one program regularly polling the radio for frequency data. If RCP1 is setup DDUtil's internal polling is disabled. Not all RCP's poll the radio regularly and may only send commands to the radio when they want to know specific data. This is not good if you have a piece of equipment like an amplifier or tuner connected that expects up to date frequency data.

DDUTIL3FLEXPORTS

 

 

 

 

 

 

 

 

 

 

 

 

 

VAC1

 

 

 

 

 

 

 

 

 

 

 

FLEX – DDUTIL VIDEO





Latest Images