Skip to content
Thomas Goodwin edited this page Feb 19, 2015 · 8 revisions

Welcome to the rest-python wiki!

This modified rest-python repo should not be used in production. Its purpose is to explore creating a set of client widgets (based on admin-console) and some new elements to support future rapid development of end-user applications from the same rest-python server instance. See the GeonTech admin-console fork for a version of the app that works with this fork of rest-python.

To use them together, clone, link, or copy the admin-console into your rest-python/apps directory. Access the site (once started of course), navigate to http://yourhost:yourport/apps/admin-console.

Frontend Interfaces

The fei.py package was added to support fetching properties from Frontend Interface Provides ports. In order for the handlers to correctly use your ports, the following naming convention is required:

  • Tuners: TEXTTunerDIRECTION
  • GPS: GPSDIRECTION (DIRECTION is optional and GPS can be lower-case)
  • RFInfo: RFInfoDIRECTION
  • RFSource: RFSourceDIRECTION
  • NavData: NavDataDIRECTION

For example, a digital tuner port would be DigitalTuner_in, as the current REDHAWK 1.10.x wizard will default.

Access these additional handlers by navigating to your Device's URL under ports followed by the port name. For example with the RTL2832U device in the rtlNode (found on redhawksdr), the server response for http://.../ports/RFInfo_in is:

{"rf_flow_id": "RTL_FLOW_ID_NOT_SET", "type": "RFInfo", "name": "RFInfo_in", "rfinfo_pkt": {"spectrum_inverted": false, "rf_center_freq": 50000000000.0, "if_center_freq": 0.0, "capabilities": {"bw_range": {"max_val": 0.0, "values": [], "min_val": 0.0}, "freq_range": {"max_val": 0.0, "values": [], "min_val": 0.0}}, "ext_path_delays": [], "rf_bandwidth": 100000000000.0, "rf_flow_id": "RTL_FLOW_ID_NOT_SET", "sensor": {"feed": {"polarization": "", "name": "", "freq_range": {"max_val": 0.0, "values": [], "min_val": 0.0}}, "collector": "", "rx": "", "mission": "", "antenna": {"size": "", "type": "", "description": "", "name": ""}}, "additional_info": []}}

Additionally, further navigating into http://.../ports/RTLInfo_in/rfinfo_pkt will return only the RFInfo packet structure, the result of calling _get_rfinfo_pkt():

{"id": "rfinfo_pkt", "rfinfo_pkt": {"spectrum_inverted": false, "rf_center_freq": 50000000000.0, "if_center_freq": 0.0, "capabilities": {"bw_range": {"max_val": 0.0, "values": [], "min_val": 0.0}, "freq_range": {"max_val": 0.0, "values": [], "min_val": 0.0}}, "ext_path_delays": [], "rf_bandwidth": 100000000000.0, "rf_flow_id": "RTL_FLOW_ID_NOT_SET", "sensor": {"feed": {"polarization": "", "name": "", "freq_range": {"max_val": 0.0, "values": [], "min_val": 0.0}}, "collector": "", "rx": "", "mission": "", "antenna": {"size": "", "type": "", "description": "", "name": ""}}, "additional_info": []}}

Tuners are somewhat different since allocation IDs determine the result of the attribute calls. Navigating to DigitalTuner_in would result in frontend_tuner_status and a list of all allocation IDs for that device:

{"frontend_tuner_status": [{"FRONTEND::tuner_status::tuner_type": "RX_DIGITIZER", "FRONTEND::tuner_status::bandwidth": 2000000.0, "FRONTEND::tuner_status::sample_rate": 2000000.0, "FRONTEND::tuner_status::group_id": "", "FRONTEND::tuner_status::available_sample_rate": "28126.00-2560000.00", "FRONTEND::tuner_status::enabled": true, "FRONTEND::tuner_status::allocation_id_csv": "RTL_FM_Waveform_028_114236932", "FRONTEND::tuner_status::available_gain": "0.00-49.60", "FRONTEND::tuner_status::rf_flow_id": "RTL_FLOW_ID_NOT_SET", "FRONTEND::tuner_status::complex": true, "FRONTEND::tuner_status::tuner_number": 0, "FRONTEND::tuner_status::available_frequency": "24000000.00-1766000000.00", "FRONTEND::tuner_status::gain": 0.0, "FRONTEND::tuner_status::center_frequency": 101099998.0, "FRONTEND::tuner_status::stream_id": "tuner_freq_88500000_Hz_d17b4872-a0dc-4b4e-913d-a327a9882172", "FRONTEND::tuner_status::agc": true}], "type": "DigitalTuner", "name": "DigitalTuner_in", "allocations": ["RTL_FM_Waveform_028_114236932"]}

Using an allocation ID, for example DigitalTuner_in/RTL_FM_Waveform_028_114236932 results in the following:

{"tuner_agc_enable": true, "tuner_control": "RX_DIGITIZER", "tuner_reference_source": "NOT_SUPPORTED", "tuner_bandwidth": 2000000.0, "tuner_output_sample_rate": 2000000.0, "tuner_rf_flow_id": "RTL_FLOW_ID_NOT_SET", "tuner_status": [{"scaType": "simple", "id": "FRONTEND::tuner_status::agc", "value": true}, {"scaType": "simple", "id": "FRONTEND::tuner_status::allocation_id_csv", "value": "RTL_FM_Waveform_028_114236932"}, {"scaType": "simple", "id": "FRONTEND::tuner_status::available_frequency", "value": "24000000.00-1766000000.00"}, {"scaType": "simple", "id": "FRONTEND::tuner_status::available_gain", "value": "0.00-49.60"}, {"scaType": "simple", "id": "FRONTEND::tuner_status::available_sample_rate", "value": "28126.00-2560000.00"}, {"scaType": "simple", "id": "FRONTEND::tuner_status::bandwidth", "value": 2000000.0}, {"scaType": "simple", "id": "FRONTEND::tuner_status::center_frequency", "value": 101099998.0}, {"scaType": "simple", "id": "FRONTEND::tuner_status::complex", "value": true}, {"scaType": "simple", "id": "FRONTEND::tuner_status::enabled", "value": true}, {"scaType": "simple", "id": "FRONTEND::tuner_status::gain", "value": 0.0}, {"scaType": "simple", "id": "FRONTEND::tuner_status::group_id", "value": ""}, {"scaType": "simple", "id": "FRONTEND::tuner_status::rf_flow_id", "value": "RTL_FLOW_ID_NOT_SET"}, {"scaType": "simple", "id": "FRONTEND::tuner_status::sample_rate", "value": 2000000.0}, {"scaType": "simple", "id": "FRONTEND::tuner_status::tuner_number", "value": 0}, {"scaType": "simple", "id": "FRONTEND::tuner_status::tuner_type", "value": "RX_DIGITIZER"}, {"scaType": "simple", "id": "FRONTEND::tuner_status::stream_id", "value": "tuner_freq_88500000_Hz_d17b4872-a0dc-4b4e-913d-a327a9882172"}], "tuner_enable": true, "tuner_device_control": true, "tuner_gain": 0.0, "tuner_group_id": "", "id": "RTL_FM_Waveform_028_114236932", "tuner_center_frequency": 101099998.0}

These represent the various getAttributeName(allocationID) calls defined in TunerControl.idl. Each attribute can individually be indexed with the allocation ID by appending it to the URL, for example:

`.../DigitalTuner_in/RTL_FM_Waveform_028_114236932/tuner_output_sample_rate`

Results in the more concise:

{"id": "RTL_FM_Waveform_028_114236932", "tuner_output_sample_rate": 2000000.0}

Clone this wiki locally