CubeSat Ground Station Module: Transmitting

0 downloads 0 Views 466KB Size Report
Oct 14, 2016 - telemetry data over time and search through previ- ously received data ... lite, using a CCSDS-based link protocol [8–10]. By employing the fully ...
67th International Astronautical Congress (IAC), Guadalajara, Mexico, 26-30 September 2016. c Copyright 2016 by the International Astronautical Federation (IAF). All rights reserved.

CubeSat Ground Station Module: Transmitting, Receiving and Displaying CubeSat Data Through a Web-based Graphical User Interface Håkon Wiik Ånes1 , Thomas Haraldsen Evang1,2 , Ole Martin Skafså1 , and Roger Birkeland1 1

Norwegian University of Science and Technology Corresponding author, [email protected]

2

October 14, 2016 Abstract

The work performed in this project is part of the Test Satellite student project at the Norwegian University of Science and Technology (NTNU). Setting up a ground station for CubeSats is a complex task requiring considerable resources and knowledge in several fields. Extensive work and time is required if all modules and parts of the base station are developed from scratch. This work is an effort to simplify the development process by creating a module/building block for receiving, sending and displaying CubeSat data. Communication with the satellites is achieved through a software defined radio. A network protocol called CubeSat Space Protocol is used. The protocol unwrapping software will run as a background process on a web server, continuously listening for data transmissions from the satellite. Communication between the software defined radio framework and the server will use User Datagram Protocol or Transmission Control Protocol. Whenever a packet is received its content should be written to the server, either to a database or to a text file, ensuring a persistent data structure. The data stored to the server shall be accessed through a graphical user interface taking the form of a web page. It is written in Python using the Django web framework, making it easy to extend and maintain. The GUI will also have the ability to send simple commands to the satellite, requesting data transfers or in other ways command the satellite. The commands will be stored as a time tag list and transferred when the satellite is in range. Commands, defined through Django’s administrative pages, are given via a text field. Even though the project is part of the NTNU Test Satellite project the framework is developed to be accessible and allow for uncomplicated integration into other projects. The only required protocols are CubeSat Space Protocol and User Datagram Protocol or Transmission Control Protocol. Our goal is that a module of this kind, if user-friendly in its interface and implementation, may boost the motivation for creating a global network of base stations. Such a network which would ensure continuous contact with CubeSats through their orbits.

needed. Its main tasks include sending commands and receiving telemetry and payload data. The A CubeSat is a standardized form factor for pico work presented here is part of the NTNU Test Satelsatellites, often used as the base of university stu- lite (NUTS) CubeSat project. The GS will be based dent satellite projects. The CubeSat standardiza- on a software defined radio (SDR) from Ettus Retion may help reduce the project cost and develop- search, the USRP E310 [2]. The on-air link protoment time, as well as give an increased accessibility col used is the NGHam [3] which encapsulates the data packets containing the CubeSat Space Profor launch [1]. To communicate with the satellite during test tocol (CSP) [4] to/from the satellite. CSP is an and once it is in orbit, a Ground Station (GS) is IP-like network protocol that simplifies end-to-end

1. Introduction

IAC–16,B4,3,7,x34398

Page 1 of 7

67th International Astronautical Congress (IAC), Guadalajara, Mexico, 26-30 September 2016. c Copyright 2016 by the International Astronautical Federation (IAF). All rights reserved.

transmissions between submodules in the satellite as well as to and from the GS. To ease monitoring of the satellite’s condition during tests and while the satellite is in orbit, it is desirable to compare telemetry data over time and search through previously received data packets. In this paper we propose a GS module for receiving, sending and displaying CubeSat data. Data packets will be written to a MySQL database [5] and accessed through a web interface written in Python using the Django web framework [6]. The emphasis in this paper is on the software implementation. Setting up a GS is a complex task requiring considerable resources and knowledge in several fields. Even though our solution is part of the NUTS project, it is developed to be accessible and allow for uncomplicated integration into similar CubeSat projects. The implementation’s source code is maintained in an online public repository at BitBucket https://bitbucket.org/nuts_ ntnu/gs-interface.

configured to match the projects needs through the different project stages, or even support entirely different satellite missions with little or no hardware change needed. The use of SDR also opens up for easy reception of satellite signals at other locations, either as pure logging stations or live decoding of open data.

2.2. A module for interfacing the SDR

Data packets received through the SDR are usually encapsulated using various protocols, so in order to make the information readable for a human operator these packets must be processed. We propose a software module which is able to process both outgoing and incoming data packets, write the packets to a database and display them through a web interface. We will achieve this by dividing the module into three submodules with specialized tasks: A CSP module, a server and web interface module. The module presented in this paper is tested to work with the SDR at the NUTS ground station, 2. System Description however, it is designed to allow for easy customiza2.1. A Fully Software Defined Ground Sta- tion and integration into other projects. tion All data packets to and from the satellite are encapsulated using CSP. Our proposed CSP module Many CubeSat projects use amateur radio (HAM) takes care of both the wrapping and unwrapping of frequencies in the VHF and UHF-bands for comdata packets. In order to detect when a packet is munication between their satellite and their ground received or sent the module acts as both a server station. Due to this, much of the ground station and a client. All outgoing or incoming data is sent hardware is also traditionally based on HAM rato the database module where they are written to dio equipment. Even if this is usually high quala database. The local communication between the ity equipment, it can be difficult to maintain and CSP module and SDR is handled using either the modify. A modem or a Terminal Node Controller Transmission Control Protocol (TCP) or the User (TNC) is often required in order to decode the reDatagram Protocol (UDP). ceived data from the radio signal. This equipment The web interface is where the human operators usually only supports one link protocol. In order to can access recent and historical satellite data. We overcome this obstacle, the NUTS team has built have designed the interface as a web page built in the ground station around an SDR from Ettus RePython using the Django framework. In order to search. The model currently used is the E310 [2], access data the user will have to log in with a userbut other models can also be used. The RF frontname and password. Once logged in the operator end is similar to a traditional HAM ground station, will have access to the most recent satellite status as in addition to an extra amplifier for transmission. well as a log of previously received data. It will also By using an SDR, several frequencies and several be possible to send commands to the satellite using link protocols can be supported and easily changed the web interface. If a command cannot be sent as needed. The open source GNURadio frameimmediately it will be stored in a queue and sent work [7] is used to control the SDR and implement when the satellite is within communication range. the radio functionality. In the current implementation, the link protocol NGHam [3] is implemented. The database module ensures persistency of NGHam is a robust link protocol, featuring forward satellite data and command history. All data packerror correction. However, the SDR setup has also ets going through the CSP or web module is written been tested to receive data from an operative satel- to the database, ensuring that a complete history of lite, using a CCSDS-based link protocol [8–10]. the data is always available. In our implementation By employing the fully software defined philos- we have chosen the popular MySQL database sysophy, the ground station can be more easily re- tem. IAC–16,B4,3,7,x34398

Page 2 of 7

67th International Astronautical Congress (IAC), Guadalajara, Mexico, 26-30 September 2016. c Copyright 2016 by the International Astronautical Federation (IAF). All rights reserved.

Module Boundary

Satellite

User Interface

Database

Figure 2: CSP header version 1.0+ [13]. Software Defined Radio

CSP Module

Figure 1: A simplified overview of the software module and ground station.

3. Software Framework In order to fully appreciate the work presented it is instructive to understand the free software used. 3.1. MySQL MySQL [5] is an open-source Structured Query Language (SQL) database migration system. It is licensed under the GNU General Public License (GPL) [11]. SQL is a programming language used to manage data held in a relational database management system ( [5]). 3.2. Django web framework The Django web framework [6] was designed to make common web development tasks fast and easy. It is written in the programming language Python [12]. Django comes with an object-relational mapper in which the database layout is described in so-called applications. Within each application, so-called models can be defined containing different attributes corresponding to database columns. With these models, Django offers a rich application programming interface (API) to access the data. After the models are defined, Django can set up the database tables automatically. Also, Django can automatically create a professional, production ready administrative interface, in which authenticated users can populate the database tables. When a request for a web page is made, Django matches the URL to a Python function. The function makes a call to the database and returns the data as well as an HTML template describing how the data, and the web page, is to be represented.

4. Implementation 4.1. Data processing The SDR communicates with the rest of the ground station by using TCP or UDP. IAC–16,B4,3,7,x34398

The CSP module will encapsulate commands to be sent and remove encapsulation from telemetry data or other received information. Fig. 2 shows the header in a CSP packet. It is a 32 bit header containing information about priority, source and destination addresses and ports. Finally, 8 bits are available to support other features such as authentication (HMAC), encryption (XTEA), reliability (RDP) and checksum (CRC). The maximum payload size of one packet is set to 65535 bytes [13]. After the encapsulation of a received message is removed, the message is ready to be written to the database. The interpretation of the messages is user defined, which means it may be altered through Django’s administration tool if necessary. The user will also be able to add new message formats as there will likely be several types of messages. Using Django’s administration tool means it is easy to change message formats without altering the source code. Fig. 6a and 6b shows the admin pages where you add message formats and alter them. Also Fig. 6c shows the adding/editing of a new command represented by name and value. Sending commands is done through a named pipe, also known as a first in first out method (FIFO), which the CSP module directly reads from. The CSP module encapsulates the command and then sends it to the SDR. It also writes the sent command to the database, which may serve as a confirmation that the command was received by the CSP module and sent further. 4.2. CSP module The CSP module is a headless process written in C. It uses CSP to handle incoming communication. The module acts as a server waiting for incoming connections from satellites. It can handle ten connections through a queue, where each connection is handled one by one. It is expected that the satellite first sends some data to initiate a connection with the CSP module, before it begins listening for commands. After receiving messages the module may send available commands from the FIFO before closing the connection. Then it is up to the satellite to initiate a connection again. Fig. 3 shows how the communication is done in a sequence diagram. The module is implemented with different timeouts if sending or reading takes too long time to Page 3 of 7

67th International Astronautical Congress (IAC), Guadalajara, Mexico, 26-30 September 2016. c Copyright 2016 by the International Astronautical Federation (IAF). All rights reserved. CSP module

In order to convert each byte in a string in the database correctly, three models are defined, termed Server thread Client thread Message, MessageFormat and MessageField. A message has a message type or format and consists of message fields. Each field has a name, Loop Test connection a length, a specific operation for converting from Establish connection byte to ASCII, a position in the message (index), Send data a unit (e.g. ampere or voltage) and a message Read command format. If the satellite sends a simple telemetry message, every byte in the string could represent Send command one message field of length 1, the message format Close connection could be TM_SIMPLE, and each field’s name and unit could represent a physical value. Tab. 1 shows an overview of the models, their attributes and their Figure 3: Sequence diagram showing communica- data type. tion between server and client. Table 1: The models of the messages application. The first column represents the attributes, while the MySQL Database second column shows the data types. Tables: CubeSat Receive commands Send messages

commands

messages_message command_history commands_command

receive new store received messages messages and sent commands Django Web Server Apps: forward commands messages commands from user

messages

CSP module / SDR Receive messages Send commands

Figure 4: System diagram.

finish. These timeouts, routing of data and other variables must be changed in the source code before compilation. The current implementation has only been tested in loop-back mode where the module itself acts as a client. TCP and UDP connections have been made for use with the ground station.

Message Data Binary Timestamp DateTime MessageFormat Name String MessageID Int MessageField Name String Length Int Function String Index Int Unit String MessageFormat ForeignKey

The commands application consists of one model termed Command. It assures the behavior explained in Sec. 4.1 with receiving commands by the user, 4.3. Web interface saving them to the database and passing them on to the CSP module via FIFO. The application conThe web interface is based on a web server using the sists of one model termed Command. It is defined Django web framework. The server is an interface by a name and a number value, which is what will between the user and the CSP module, communibe transmitted to the satellite. Tab. 2 shows an cating both directly with the module when sendoverview of the model with attributes and their data ing commands to it and indirectly via the MySQL types. database. The user can see which messages are received and written to the database. At the same time new commands can be sent to the satellite. Table 2: The model of the commands application. The implementation is represented in the system The first column represents the attributes, while the second column shows the data types. diagram in Fig. 4. Two applications are implemented, messages Command and commands. messages displays and makes the Name String messages that are written to the database searchCommand Int able. The implementation assumes that the data packets are received in the form of a string of bytes. IAC–16,B4,3,7,x34398

Page 4 of 7

67th International Astronautical Congress (IAC), Guadalajara, Mexico, 26-30 September 2016. c Copyright 2016 by the International Astronautical Federation (IAF). All rights reserved.

module will simplify the process of setting up a fully functional ground station by providing essenThe web interface is accessed through a web tial functions for communicating with an SDR and browser. The home page consists of two main parts, displaying satellite data. Our module will be availas seen in Fig. 5a. The top part shows the latest able to the community as open source software, messages written to the database, and an input field thereby enabling other projects to customize the for specifying the number of messages to display. system to their needs or contribute to its developThe bottom part shows an input field for sending ment. commands to the satellite. On the left is a navigation menu for jumping to one of the two parts, or refreshing the home page. Each message can be expanded to display the contents of the message, as seen in Fig. 5b. The example of the simple telemetry message from Sec. 4.3 is used. The first two bytes are the header bytes, followed by the up time of the satellite and various voltages and currents. If a valid command is entered and the pipe exists, the user receives feedback as seen in Fig. 5c. Fig. 6a, 6b and 6c shows screenshots of the Django admin pages. The two latter are used for defining the for(a) Web interface home page. mat of a data packet and defining a command to be sent to the satellite, respectively. The CSP module acts as a server, waiting for connections and then unwraps received CSP packets. All received packets are written to the database by the module. Sent commands are wrapped with CSP and also written to the database in a command history table. As shown in Fig. 3 the connection is opened by a client/satellite and closed after the GS has sent available commands. Initiating contact is the satellite’s way of notifying the GS that it is within communication range and that two-way (b) Simple telemetry message expanded. communication is possible. This is why the module waits for a satellite status update before sending commands. However, this also means that how often commands can be sent is limited by the status update frequency. In its current version it has only been tested in loop-back mode, meaning it emulates the communication between itself and the satellite by generating example data. The system should therefore be further tested using a satellite prototype or a satellite already in orbit. This will verify whether our module is robust against incomplete messages, corrupted messages or other fault modes associated (c) Command successfully sent to satellite. with satellites. It would also verify whether sent Figure 5: Screenshots of the web interface. commands are encapsulated and sent properly. The next step in the development is to link the module with the E310 SDR [2] used by the NUTS project. Also, time could be taken to test the sys6. Conclusion tem using other SDR models. This would show whether customizing and integrating the module In this project we have implemented modules to be with other hardware is as easy as intended. used in a ground station for the NUTS project. A Our contribution to the CubeSat community is goal has been to simplify the development process a small building block for use in ground stations by creating modules for receiving, sending and disutilizing SDR communication. We hope that our playing CubeSat data.

5. Results and discussion

IAC–16,B4,3,7,x34398

Page 5 of 7

67th International Astronautical Congress (IAC), Guadalajara, Mexico, 26-30 September 2016. c Copyright 2016 by the International Astronautical Federation (IAF). All rights reserved.

Acknowledgements We would like to thank fellow students Bård Flugon and Viktor Zoric from NTNU for contributing to the work of this paper is based upon. The attendance at IAC was made possible by support from Norwegian Space Center and the Faculty of Information Technology, Mathematics and Electrical Engineering at NTNU.

(a) Django admin home page, http:///admin.

accessed through

References [1] NASA, CubeSat Launch Initiative. http://www.nasa.gov/directorates/heo/ home/CubeSats_initiative#.VD0zdkuSMrs. Accessed: 2016-08-29. [2] Ettus Research. Usrp e310 embedded sdr. Online, 2015. Accessed 16-12-2015. [3] Jon Petter Skagmo. Ngham radio packet protocol - rev. b, 2015. Accessed: 28-05-2015.

(b) Admin pages for editing message format.

[4] GomSpace, the CubeSat Space Protocol GitHub repository. https://github.com/ GomSpace/libcsp. Accessed: 2016-08-29. [5] MySQL. MySQL 5.7 Reference Manual. http: //dev.mysql.com/doc/refman/5.7/en/. Accessed: 2016-09-01. [6] Django Software Foundation. Django documentation. https://docs.djangoproject. com/en/1.10/. Accessed: 2016-09-01. [7] GNURadio. The free & open software radio echosystem. online, 2016.

(c) Admin pages for editing commands.

Figure 6: Screenshots of the admin interface.

The web interface that is accessible with a web browser, shows information from the satellite, and stores the data in the database. An input field for sending commands is also available in the interface. All the messages are sent through the CSP module which handles wrapping with CSP. The module has only been tested in loop-back mode and must therefore be further tested using a satellite prototype.

[8] André Løfaldli and Roger Birkeland. Implementation of a software defined radio prototype ground station for cubesats. In Proceedings of the ESA Small Satellites and Services Symposium, 2016. [9] André Løfaldli. Design of Ground Station Receiver for Kongsberg Satellite Services based on Software Defined Radio. Master’s thesis, NTNU - Norwegian University of Science and Technology, 2016.

[10] André Løfaldli. Git repository for gnuradio The intention of this paper has been to make module for the nuts project groundstation. a contribution to the CubeSat community and the Online. https://github.com/lofaldli/ NUTS project. A simple building block for retrievgr-nuts, 2016. ing and displaying satellite data has been made and released as open source software. Thereby enabling [11] Gnu general public licence. https://www. the community or other projects to further develop gnu.org/licenses/gpl-3.0.html. Accessed: and customize the module. 2016-09-07. IAC–16,B4,3,7,x34398

Page 6 of 7

67th International Astronautical Congress (IAC), Guadalajara, Mexico, 26-30 September 2016. c Copyright 2016 by the International Astronautical Federation (IAF). All rights reserved.

[12] About python. https://www.python.org/ about/. Accessed: 2016-09-07. [13] CubeSat Space Protocol. https: //en.wikipedia.org/wiki/Cubesat_Space_ Protocol. Aksessert: 2016-04-27.

IAC–16,B4,3,7,x34398

Page 7 of 7

Suggest Documents