From 7ffe23fe81363cbe92fbf519a0f6950192180a49 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 27 Dec 2018 23:58:22 +0100 Subject: [PATCH] Reverse API: added documentation about reverseapi.py script --- swagger/sdrangel/examples/Readme.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/swagger/sdrangel/examples/Readme.md b/swagger/sdrangel/examples/Readme.md index 4bf83a84d..f33fdc37b 100644 --- a/swagger/sdrangel/examples/Readme.md +++ b/swagger/sdrangel/examples/Readme.md @@ -102,6 +102,21 @@ It uses the following APIs: - URI: `/sdrangel/deviceset/{deviceSetIndex}/device/run` - HTTP method: `DELETE` +

reverseapi.py

+ +This script runs continuously to act as the server side of SDRangel reverse API feature. It will respond with a copy of the settings when forwarding channel or device settings which is a valid reply and will also send back a valid reply when forwarding the device start/stop actions. The reverse API feature was implemented in version 4.3.2 and you can learn more about it in the Wiki. + +It uses Python flask package for the server so you will need to either install it system wide or better create your own virtual environment and use the `pip install flask` command once your virtual environment is activated. If you know Python then you know what a virtual environment is about. + +Then in the virtual environment do: + +``` +export FLASK_APP=reverseapi.py +export FLASK_ENV=development +flask run +``` +By default the server will listen on port 5000. It was used to conveniently test the reverse API but actually does not do much. It can serve as a base to implement more complex scenarios to control other devices or software or other instances of SDRangel. +

rtlsdr_settings.py

Make sure a RTLSDR device is selected on device set #0. Get and change the settings of this RTLSDR device.