diff --git a/Guide-GroundSystem.md b/Guide-GroundSystem.md index f8bae56..fdc30f5 100644 --- a/Guide-GroundSystem.md +++ b/Guide-GroundSystem.md @@ -1,4 +1,4 @@ -# cFS Ground System Version 2.1.5 +# cFS Ground System Version 2.1.8 ## cFS Ground System Info @@ -9,6 +9,7 @@ This ground system supports commanding and receiving telemetry from multiple spa The Ground System contains the main window that lets you launch the different utilities. To start receiving data from the cFS, you need to enable telemetry first. To enable telemetry: + - click the "Start Command System" button from the main window, - then from the Command System Main Page click the "Enable Tlm" button (you will need to enter the target/destination IP address as an input to this command). @@ -17,27 +18,27 @@ Note: The Main Window needs to be opened at all times so that the telemetry mess The Ground System will automatically detect the spacecraft when it starts sending the telemetry, and it will be added to the IP addresses list. You can select the spacecraft from the list, and start Telemetry System to receive its data. If 'All' spacecrafts are selected, you can start Telemetry System to display the packet count from multiple spacecrafts (if it detected more than one). Future enhancements: + 1. Detect different spacecrafts based on telemetry header (spacecraft `id`) data instead of using the spacecraft IP address. -1. Add instructions for Windows. +2. Add instructions for Windows. ## Install and run Before launching the Ground System make sure that: + - PyQt4 is installed, - PyZMQ is installed, - cmdUtil is compiled. Installing and running cFS Ground System on Ubuntu: -1. ```sudo apt-get install python3-pyqt4``` -1. ```sudo apt-get install python3-zmq``` -1. ```sudo apt-get install libcanberra-gtk-module``` -1. ```cd Subsystems/cmdUtil/ && make``` -1. ```python3 GroundSystem.py``` +1. `sudo apt-get install python3-pyqt4` +2. `sudo apt-get install python3-zmq` +3. `sudo apt-get install libcanberra-gtk-module` +4. `cd Subsystems/cmdUtil/ && make` +5. `python3 GroundSystem.py` -The historically included instructions for running on macOS or CentOS are included at the bottom of this document for reference. -Please note that instructions have not been maintained. -Welcoming instruction contributions if any of these are your platform of choice. +The historically included instructions for running on macOS or CentOS are included at the bottom of this document for reference. Please note that instructions have not been maintained. Welcoming instruction contributions if any of these are your platform of choice. ## Adding new flight software application to ground system command GUI @@ -45,40 +46,37 @@ This section was made to help developers who are adding core Flight Software (cF The `CHeaderParser.py` program that should be found in: -```GroundSystem/Subsystems/cmdGui``` - +````groundsystem/subsystems/cmdgui``` Is an interactive, command-line based program to help walk developers through the process of adding custom cFS applications to the Ground System. Along with `CHeaderParser.py` is a configuration file that CHeaderParser uses to find the proper header files for your "new" cFS application. This file is named `CHeaderParser-hdr-paths.txt`, and should be placed in the same directory as `CHeaderParser.py`. Expected file structure: -``` -cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/CHeaderParser.py -cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/CHeaderParser-hdr-paths.txt -cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/CommandFiles/ -cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/ParameterFiles/ -cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/command-pages.txt +```` + +cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/CHeaderParser.py cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/CHeaderParser-hdr-paths.txt cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/CommandFiles/ cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/ParameterFiles/ cFE-6.4.x-OSS-release/cfe/tools/cFS-GroundSystem/Subsystems/cmdGui/command-pages.txt + ``` Steps to adding application commands to the Ground System: -1. Edit `CHeaderParser-hdr-paths.txt`: - 1. Locate any header files that contain command code definitions or command structure definitions. These files typically end in `*app_msg.h` or `*app_msgdefs.h` but could be named anything. - 1. Add each one of the paths to a new line in `CHeaderParser-hdr-paths.txt`. - 1. Comment out any paths/lines that aren't needed with `#` (at the beginning of the line). - -1. Run CHeaderParser: - 1. Call CHeaderParser using python: `python3 CHeaderParser.py` - 1. The program will prompt you to enter a filename for the application. This will create a pickle file for your application named `CommandFiles/`. Notice that this file will be stored in the `CommandFiles` directory. This same filename will be used in `command-pages.txt` later. - 1. Type `yes` if any commands in your application have parameters. The program will then look through the provided header files for `definitions.pick` which-ever definitions describe related command codes (one at a time, the program will prompt you for the next command code after all parameters have been added for the current command). - 1. Select the appropriate command structure for the selected command. The program will show all structures that it could find in the provided header files. Enter the index of the command structure (the corresponding index should be above the command structure). - 1. Select any parameters from the structure that apply. Once you have selected all applicable lines from the command structure, enter `-1` to finish. This will create a pickle file for the command/parameters named `ParameterFiles/`. Notice that this file will be stored in the `ParameterFiles` directory. - -1. Update `command-pages.txt` (CSV): - 1. Column 1 - Title of your application (whatever you want it called). - 1. Column 2 - filename of your application (chosen in Step 2.ii) under `CommandFiles` directory. - 1. Column 3 - Message ID for Application Commands (typically defined in `mission_msgids.h`). - 1. Column 4 - Endianess (default little endian: `LE`). - 1. Column 5 - PyGUI Page (default: `UdpCommands.py`). - 1. Column 6 - Command Send Address (default: `127.0.0.1`). - 1. Column 7 - Command Send Port (default: `1234`). +1\. Edit `CHeaderParser-hdr-paths.txt`: + 1\. Locate any header files that contain command code definitions or command structure definitions. These files typically end in `*app_msg.h` or `*app_msgdefs.h` but could be named anything. + 1\. Add each one of the paths to a new line in `CHeaderParser-hdr-paths.txt`. + 1\. Comment out any paths/lines that aren't needed with `#` (at the beginning of the line). + +1\. Run CHeaderParser: + 1\. Call CHeaderParser using python: `python3 CHeaderParser.py` + 1\. The program will prompt you to enter a filename for the application. This will create a pickle file for your application named `CommandFiles/`. Notice that this file will be stored in the `CommandFiles` directory. This same filename will be used in `command-pages.txt` later. + 1\. Type `yes` if any commands in your application have parameters. The program will then look through the provided header files for `definitions.pick` which-ever definitions describe related command codes (one at a time, the program will prompt you for the next command code after all parameters have been added for the current command). + 1\. Select the appropriate command structure for the selected command. The program will show all structures that it could find in the provided header files. Enter the index of the command structure (the corresponding index should be above the command structure). + 1\. Select any parameters from the structure that apply. Once you have selected all applicable lines from the command structure, enter `-1` to finish. This will create a pickle file for the command/parameters named `ParameterFiles/`. Notice that this file will be stored in the `ParameterFiles` directory. + +1\. Update `command-pages.txt` (CSV): + 1\. Column 1 - Title of your application (whatever you want it called). + 1\. Column 2 - filename of your application (chosen in Step 2.ii) under `CommandFiles` directory. + 1\. Column 3 - Message ID for Application Commands (typically defined in `mission_msgids.h`). + 1\. Column 4 - Endianess (default little endian: `LE`). + 1\. Column 5 - PyGUI Page (default: `UdpCommands.py`). + 1\. Column 6 - Command Send Address (default: `127.0.0.1`). + 1\. Column 7 - Command Send Port (default: `1234`). Notes: - USE ONLY SPACES, NO TABS (Remember, it's Python). @@ -91,88 +89,62 @@ After completing these steps, restart the Ground System and the changes should h ### Issue: Cannot Send Command, receiving the "[Errno 8] Exec format error" Traceback: - -``` -Calling cmdUtil from Parameter.py -Traceback (most recent call last): - File "Parameter.py", line 100, in ProcessSendButton - subprocess.Popen(cmd_args, stdout=subprocess.PIPE) - File "/usr/lib/python3.7/subprocess.py", line 642, in __init__ - errread, errwrite) - File "/usr/lib/python3.7/subprocess.py", line 1234, in _execute_child - raise child_exception -OSError: [Errno 8] Exec format error ``` -Fix: This problem is most likely caused by calling `cmdUtil` without compiling it. This issue has also been found to occur when the `cmdUtil` executable has been compressed/decompressed. To fix this problem, use the `Makefile` inside of the `cmdUtil` directory to compile or recompile (in the case after decompressing). +Calling cmdUtil from Parameter.py Traceback (most recent call last): File "Parameter.py", line 100, in ProcessSendButton subprocess.Popen(cmd_args, stdout=subprocess.PIPE) File "/usr/lib/python3.7/subprocess.py", line 642, in __init__ errread, errwrite) File "/usr/lib/python3.7/subprocess.py", line 1234, in _execute_child raise child_exception OSError: [Errno 8] Exec format error ``` -$ cd Subsystems/cmdUtil -$ make -$ cd ../.. -$ python3 GroundSystem.py +Fix: This problem is most likely caused by calling `cmdUtil` without compiling it. This issue has also been found to occur when the `cmdUtil` executable has been compressed/decompressed. To fix this problem, use the `Makefile` inside of the `cmdUtil` directory to compile or recompile (in the case after decompressing). ``` +$ cd Subsystems/cmdUtil $ make $ cd ../.. $ python3 GroundSystem.py + +``` ## Historically included instructions for running on macOS or CentOS ### Installing and running cFS Ground System on macOS, using Homebrew - -``` -$ brew install pyqt -$ brew install zeromq -$ ( cd Subsystems/cmdUtil/ && make ) -$ python GroundSystem.py ``` +$ brew install pyqt $ brew install zeromq $ ( cd Subsystems/cmdUtil/ && make ) $ python GroundSystem.py + +``` ### Installing and running cFS Ground System on CentOS 6 #### Update yum ``` -$ su -$ -$ yum -y update -``` +$ su $ + + +$ yum -y update + +``` #### Install pip and python-development #### If you are on a 64-bit CentOS / RHEL based system: ``` -$ wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm -$ rpm -ivh epel-release-6-8.noarch.rpm -``` -If you are on a 32-bit CentOS / RHEL based system: +$ wget $ rpm -ivh epel-release-6-8.noarch.rpm + ``` -$ wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm -$ rpm -ivh epel-release-6-8.noarch.rpm -$ yum install -y python-pip -$ yum install -y python-devel +If you are on a 32-bit CentOS / RHEL based system: ``` -#### Install zeroMQ and pyZMQ messaging system #### +$ wget $ rpm -ivh epel-release-6-8.noarch.rpm $ yum install -y python-pip $ yum install -y python-devel + ``` -$ yum install -y uuid-devel -$ yum install -y pkgconfig -$ yum install -y libtool -$ yum install -y gcc-c++ -$ wget http://download.zeromq.org/zeromq-4.0.5.tar.gz -$ tar xzvf zeromq-4.0.5.tar.gz -$ cd zeromq-4.0.5 -$ ./configure -$ make -$ make install -$ echo /usr/local/lib > /etc/ld.so.conf.d/local.conf -$ ldconfig -$ pip install pyzmq +#### Install zeroMQ and pyZMQ messaging system #### ``` -#### Install pyQT4 #### +$ yum install -y uuid-devel $ yum install -y pkgconfig $ yum install -y libtool $ yum install -y gcc-c++ $ wget $ tar xzvf zeromq-4.0.5.tar.gz $ cd zeromq-4.0.5 $ ./configure $ make $ make install $ echo /usr/local/lib > /etc/ld.so.conf.d/local.conf $ ldconfig $ pip install pyzmq + ``` -$ yum install -y PyQt4 -$ yum install -y qt qt-demos qt-designer qt4 qt4-designer +#### Install pyQT4 #### ``` +$ yum install -y PyQt4 $ yum install -y qt qt-demos qt-designer qt4 qt4-designer -#### Running Ground System ### ``` -$ python GroundSystem.py +#### Running Ground System ### ``` + +$ python GroundSystem.py ``` diff --git a/Guide-GroundSystem.txt b/Guide-GroundSystem.txt index 98f0d28..e2c5149 100644 --- a/Guide-GroundSystem.txt +++ b/Guide-GroundSystem.txt @@ -1,4 +1,4 @@ -cFS Ground System Version 2.1.7 +cFS Ground System Version 2.1.8 cFS Ground System Info: diff --git a/README.md b/README.md index 444b382..f42197d 100644 --- a/README.md +++ b/README.md @@ -2,47 +2,62 @@ This repository contains NASA's Lab Ground System (cFS-GroundSystem), which is a framework component of the Core Flight System. -This lab application is a non-flight utility ground system to interact with the cFS. It is intended to be located in the `tools/cFS-GroundSystem` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at https://github.com/nasa/cFS (which includes cFS-GroundSystem as a submodule), which includes build and execution instructions. +This lab application is a non-flight utility ground system to interact with the cFS. It is intended to be located in the `tools/cFS-GroundSystem` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at (which includes cFS-GroundSystem as a submodule), which includes build and execution instructions. See Guide-GroundSystem.txt for more information. ## Version History -##### Development Build: 2.1.7 - - Commands and Telemetry definitions now match code - - See https://github.com/nasa/cFS-GroundSystem/pull/74 +### Development Build: 2.1.8 -##### Development Build: 2.1.6 - - Cmd code (and checksum) are always in the same place - - See https://github.com/nasa/cFS-GroundSystem/pull/69 +- No warnings when building with GCC9 +- Event messages now display both Event type and ID. +- See -##### Development Build: 2.1.5 - - Updated build instructions for Python 3 - - See https://github.com/nasa/cFS-GroundSystem/pull/64 +### Development Build: 2.1.7 -##### Development Build: 2.1.4 - - Finish conversion to python 3 - - cmdutil now accepts --word as alias to --long - - See https://github.com/nasa/cFS-GroundSystem/pull/54 +- Commands and Telemetry definitions now match code +- See -##### Development Build: 2.1.3 - - Minor updates to work with python 3 - - No longer compatible with python 2.7 - - Note issue #50 is to update the related documentation - - See https://github.com/nasa/cFS-GroundSystem/pull/47 +### Development Build: 2.1.6 -##### Development Build: 2.1.2 - - Minor updates (see https://github.com/nasa/cFS-GroundSystem/pull/39) +- Cmd code (and checksum) are always in the same place +- See -##### Development Build: 2.1.1 - - Minor updates (see https://github.com/nasa/cFS-GroundSystem/pull/36) +### Development Build: 2.1.5 -### ***OFFICIAL RELEASE 2.1.0*** - - Minor updates (see https://github.com/nasa/cFS-GroundSystem/pull/26) - - Released as part of cFE 6.7.0, Apache 2.0 +- Updated build instructions for Python 3 +- See -### ***OFFICIAL RELEASE 2.0.90a*** - - Released as part of cFE 6.6.0a, Apache 2.0 +### Development Build: 2.1.4 + +- Finish conversion to python 3 +- cmdutil now accepts --word as alias to --long +- See + +### Development Build: 2.1.3 + +- Minor updates to work with python 3 +- No longer compatible with python 2.7 +- Note issue #50 is to update the related documentation +- See + +### Development Build: 2.1.2 + +- Minor updates (see ) + +### Development Build: 2.1.1 + +- Minor updates (see ) + +### **_OFFICIAL RELEASE 2.1.0_** + +- Minor updates (see ) +- Released as part of cFE 6.7.0, Apache 2.0 + +### **_OFFICIAL RELEASE 2.0.90a_** + +- Released as part of cFE 6.6.0a, Apache 2.0 ## Known issues @@ -50,6 +65,6 @@ As a lab application, extensive testing is not performed prior to release and on ## Getting Help -For best results, submit issues:questions or issues:help wanted requests at https://github.com/nasa/cFS. +For best results, submit issues:questions or issues:help wanted requests at . -Official cFS page: http://cfs.gsfc.nasa.gov +Official cFS page: diff --git a/RoutingService.py b/RoutingService.py index 34ddfbb..eaad8f5 100644 --- a/RoutingService.py +++ b/RoutingService.py @@ -33,7 +33,7 @@ udpRecvPort = 1235 # -# Receive telemetry packets, apply the appropiate header +# Receive telemetry packets, apply the appropriate header # and publish the message with zeroMQ # class RoutingService(QtCore.QThread): diff --git a/Subsystems/cmdGui/CHeaderParser.py b/Subsystems/cmdGui/CHeaderParser.py index 7c14a23..1f5b58d 100644 --- a/Subsystems/cmdGui/CHeaderParser.py +++ b/Subsystems/cmdGui/CHeaderParser.py @@ -42,7 +42,7 @@ # the user for necessary information, and parsing the cFS header files, this # program will generate up to two different "pickle" files for the ground # system to use (for information about pickle files and the pickle python -# libary, see the link here: https://docs.python.org/2/library/pickle.html). +# library, see the link here: https://docs.python.org/2/library/pickle.html). # These files will be placed in CommandFiles/ or ParameterFiles/. # # Usage: @@ -422,7 +422,7 @@ def getFileList(self, filename='CHeaderParser-hdr-paths.txt'): # Add original data type (C data type) to list dataTypesOrig.append(line_split[0]) - # Get rid of any occurance of ';' (at the end of the line) + # Get rid of any occurrence of ';' (at the end of the line) paramNames.append(re.sub(';','',line_split[1])) # Not sure about why we are keeping track of this yet diff --git a/Subsystems/cmdGui/CommandSystem.py b/Subsystems/cmdGui/CommandSystem.py index a656a24..6dac4e8 100644 --- a/Subsystems/cmdGui/CommandSystem.py +++ b/Subsystems/cmdGui/CommandSystem.py @@ -253,7 +253,7 @@ def ProcessQuickButton(self, idx): Command = CommandSystem() # - # Read in the contents of the telemetry packet defintion + # Read in the contents of the telemetry packet definition # cmdPageIsValid = [] cmdPageDesc = [] diff --git a/Subsystems/cmdGui/Parameter.py b/Subsystems/cmdGui/Parameter.py index 7f53f14..79244d5 100644 --- a/Subsystems/cmdGui/Parameter.py +++ b/Subsystems/cmdGui/Parameter.py @@ -122,7 +122,7 @@ def ProcessSendButton(self): elif opt in ("-d", "--descrip"): cmdDesc = arg # command name, eg No-Op elif opt in ("-i", "--idx"): - idx = int(arg) # comand index in command definition file + idx = int(arg) # command index in command definition file elif opt in ("-h", "--host"): pageAddress = arg # send to address elif opt in ("-p", "--port"): diff --git a/Subsystems/cmdUtil/cmdUtil.c b/Subsystems/cmdUtil/cmdUtil.c index 4e458b8..9328e5c 100644 --- a/Subsystems/cmdUtil/cmdUtil.c +++ b/Subsystems/cmdUtil/cmdUtil.c @@ -404,13 +404,15 @@ int main(int argc, char *argv[]) { { case 'H': printf("Host: %s\n",(char *)optarg); - strncpy(CommandData.HostName, optarg, HOSTNAME_SIZE); + strncpy(CommandData.HostName, optarg, HOSTNAME_SIZE-1); + CommandData.HostName[HOSTNAME_SIZE-1] = 0; CommandData.GotHostName = 1; break; case 'P': printf("Port: %s\n",(char *)optarg); - strncpy(CommandData.PortNum, optarg, PORTNUM_SIZE); + strncpy(CommandData.PortNum, optarg, PORTNUM_SIZE-1); + CommandData.PortNum[PORTNUM_SIZE-1] = 0; CommandData.GotPortNum = 1; break; diff --git a/Subsystems/tlmGUI/EventMessage.py b/Subsystems/tlmGUI/EventMessage.py index 13ed50e..e264f36 100644 --- a/Subsystems/tlmGUI/EventMessage.py +++ b/Subsystems/tlmGUI/EventMessage.py @@ -97,15 +97,30 @@ def processPendingDatagrams(self, datagram): self.ui.sequenceCount.setText(str(self.pktCount)) # - # Not accounting for endian right now! + # Get App Name, Event ID, Type and Event Text! # - appName = datagram[12:32].decode('utf-8','ignore') - eventText = datagram[44:].decode('utf-8','ignore') + appName = datagram[16:36].decode('utf-8','ignore') + EventID = int.from_bytes(datagram[36:38], byteorder='little') + EventType = int.from_bytes(datagram[38:40], byteorder='little') + eventText = datagram[48:].decode('utf-8','ignore') + EventID = str(EventID) + EventType = str(EventType) appName = appName.split("\0")[0] eventText = eventText.split("\0")[0] - eventString = "EVENT ---> "+ appName + " : " + eventText - self.ui.eventOutput.append(eventString) + if ( EventType == "1" ): + EventType = "DEBUG" + elif ( EventType == "2" ): + EventType = "INFORMATION" + elif ( EventType == "3" ): + EventType = "ERROR" + elif ( EventType == "4" ): + EventType = "CRITICAL" + else: + EventType = "Invalid Event Type" + + eventString = "EVENT --> "+ appName + "-" + EventType + " Event ID: " + EventID + " : " + eventText + self.ui.eventOutput.append(eventString) # Subscribes and receives zeroMQ messages class TlmReceiver(QtCore.QThread): diff --git a/Subsystems/tlmGUI/GenericTelemetry.py b/Subsystems/tlmGUI/GenericTelemetry.py index cb2cf57..7b194bb 100644 --- a/Subsystems/tlmGUI/GenericTelemetry.py +++ b/Subsystems/tlmGUI/GenericTelemetry.py @@ -219,7 +219,7 @@ def usage(): Telem.ui.packetId.display(appId) # - # Read in the contents of the telemetry packet defintion + # Read in the contents of the telemetry packet definition # tlmItemIsValid = [] tlmItemDesc = [] diff --git a/Subsystems/tlmGUI/TelemetrySystem.py b/Subsystems/tlmGUI/TelemetrySystem.py index 8504acd..6cf43c5 100644 --- a/Subsystems/tlmGUI/TelemetrySystem.py +++ b/Subsystems/tlmGUI/TelemetrySystem.py @@ -301,7 +301,7 @@ def run(self): print ('Telemetry System started. Subscribed to ' + subscription) # - # Read in the contents of the telemetry packet defintion + # Read in the contents of the telemetry packet definition # tlmPageIsValid = [] tlmPageDesc = []