Giter VIP home page Giter VIP logo

examples's Introduction

SDRVM Examples on DragonOS

Documentation (commands reference) : http://sdrvm.sdrtechnologies.fr/

To get the latest PC or RPi VMBASE executable, go to our 'Download and Install page' : http://sdrvm.sdrtechnologies.fr/releases/#download-and-test

Our thanks to CemaXecuter, author of DragonOS distribution for the time spent testing, experimenting with our tool and ensuring integration into DragonOS. His help is invaluable to us.

DragonOS notes

On DragonOS distribution, the application executable and basic examples are located in /usr/src/SDR4space.

DragonOS images download
DragonOS applications upgrade (PC)

Update SDRVM examples

  • To update your DragonOS examples to the latest version :
cd ~
git clone https://github.com/SDR4space/Examples/ SDRVM_latest
cd SDRVM_latest
git checkout DragonOS

License

A couple of examples are requiring registered license to enable specific modules ( ZMQ support, WebServer, DDC channels). Feel free to write us at [email protected], providing informations on your project to get more informations on licensing.

Main config file

The main config file settings.js stored at the top root of the project is used as a template config file for the sub-folders.
Update this file according to your setup by adapting variables:

  • SDR soapy device name : var sdr_device='driver=plutosdr';

  • the default samplerate for this device : var sample_rate=5e6;

  • external servers : DB, MQTT, GQRX client...

  • observer location for satellite users.

  • For most cases the settings.js will be copied to sub-directories at first launch (if missing), BUT only once.
    This will permit later to adjust parameters in each subdirectory, based on a common skeleton.

Quick start

  • Adapt the main `settings.ini' file (sdr_device variable)
  • Execute following commands to run a** quick demo based on WBFM (88-108)** spectrum/capture:
cd /usr/src/SDR4space/RX
./sdrvm

Running the ./sdrvm executable with no arguments will start the boot.js script by default (if present)

GNUplot considerations

  • Scripts are tested using gnuplot-x11 application.
    gnuplot-qt works also. Maybe !

  • For some scripts we are using gnuplot_app variable defined in main settings.js file.
    Please take a minute to check if path is valid (hint: use 'which gnuplot' to get path to gnuplot).

// Define GNUplot path
var gnuplot_app='/usr/bin/gnuplot';

Plots output

You have choice to get your plots on screen or saved to file. Even both. Edit .gnu file and adapt according your needs.

Output to file
#GUI output
#set term x11 size 800,500

# output to file
set term png size 1200,500
set output "/tmp/spectrum.png"
Output to screen
#GUI output
set term x11 size 800,500

# output to file
#set term png size 1200,500
#set output "/tmp/spectrum.png"
Output to file and screen

# output to file
set term png size 1200,500
set output "/tmp/spectrum.png"

plot "/tmp/spectrum.csv" using ($1):2  with lines lt rgb "red"  title 'spectrum'

#GUI output
set term x11 size 1200,500
replot
pause -1

Basic use

Note : by using the GPU optimized version of our product (usually on Jetson platforms), you need to run sdrvm as sudo !

Parameters:

---------------------------------------------------------------------------------
 SDRVM Version v1.0 - Build : 2021xxxx
 (c) SDR-Technologies SAS - www.sdrtechnologies.fr
---------------------------------------------------------------------------------
Creating Radio Device factory
Disk free space : 7.6 % 
JavaScript SDR/Sat/DSP and more
Usage:
  sdrvm [OPTION...]

  -a, --autoload      Automatic load of license file (default: true)
  -r, --request       Generate a license request for this machine
  -t, --timing        Enable timing for each running task
  -h, --help          Print usage
  -f, --file arg      Script file name/url/archive
  -w, --web           Enable Webserver at boot
  -p, --port          Web server TCP port (overwrite value in 
                      conf/sdrvm.conf)
  -d, --workdir arg   working directory, default is program location 
  -v, --verbose       Verbose mode (default: true)
  -g, --gps arg       set GPS NMEA source port input (ex: /dev/ttyACM0),
                      default baudrate is 9600
  -b, --baudrate arg  GPS Baudrate (default: 9600)
  -s, --service       Runs as system daemon

Run a script

By default SDRVM will try to open boot.js script in current directory if the script name (-f switch) is NOT specified

A script can be run from different sources :

  • .JS file : ./sdrvm -f test.js
  • HTTP URL: ./sdrvm -f http://my_server/path/test.js
  • From a compressed ZIP file: insert your files/scripts in a compressed file.
    Rename your main script boot.js, then launch it : ./sdrvm -f ./test.zip

IQ file formats

File extension name

SDRVM will handle .cf32, .cs16 and .cs8 extension for filename as IQobject, and .wav as sound file.
That said, we can open a .cf32 file; read it then save it as different name, using CS16 extension.
CF32 --> CS16 conversion is done !

SDR capture devices

Please see the documentation section for more detailed informations. Check SoapySDR
Use SoapySDR

SoapySDR

Most of the script are written using the soapySDR driver, for compatibility reason.

Declaring JSradio object.

var rx = Soapy.makeDevice({'query' : 'driver=rtlsdr' }) ;
var rx = Soapy.makeDevice( {'query' : 'driver=bladerf' });

Examples index

IQ files

IQ operations

DDC

DDCBank examples (2 channels and more) are requiring a registered license.

Sat

GPS

examples's People

Contributors

alphafox02 avatar sdr-technologies avatar sdr4space avatar

Stargazers

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

Watchers

 avatar

examples's Issues

[sat_receive.js] MQTT error : 'Error sending Mqtt message'

(boot:0)> waiting for AOS
(boot:0)> 13:31:59 - WAIT_AOS --> Sat position: Lat=0.492, Lon=-14.572, Az=200.264, Elev=36.039
(boot:0)> 13:31:59 - In view ! -->  Elev=36.039, Az=200.264, Lat=0.492, Lon=-14.572, Doppler@1GHz= 351
Error sending Mqtt message.
(boot:0)> START RECORD MQTT
(boot:0)> send MQTT AOS : RECORD_START:ELEKTRO-L2_20210728-113159
Error sending Mqtt message.


  • Be sure following packages are installed : mosquitto mosquitto-clients
  • Check mosquitto status :
mosquitto_pub -h localhost -u mqtt -P mqtt -t 'sdrcli/stream' -m "0"
Connection Refused: not authorised.
Error: The connection was refused.
  • Create 'mqtt' user & password for mosquitto :
    sudo mosquitto_passwd -b /etc/mosquitto/passwd mqtt mqtt

[GPS support] Basic example

Not yet documented, sorry, here is a short example to access GPS from SDR4space.lite

  • You have to launch SDR4space.lite with following parameters (adapt to your setup):
     -g, --gps arg       set GPS NMEA source port input (ex: /dev/ttyACM0),
     -b, --baudrate arg  GPS Baudrate (default: 9600)
  • Basic test :
var gps= System.GPSAvail() ;
print(gps);
sleep(2000);
var mypos = System.GPSInfos();
print(JSON.stringify(mypos));

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.