Skip to content

1‐31‐2024 ‐ Setup Ground Station Software

L42ARO edited this page Feb 4, 2024 · 1 revision

As of 1/31/2024 the complete ground station for launch comprises of a laptop and 2 Arduino Unos each, connected to two USB ports on the laptop. Work is in progress to create a advanced ground station, but until then, the components necessary for this prototype ground station are as follows:

  • 1 Arduino Uno with a Reyax LoRa RYLR998 transceiver connected to it with wires. Note the digital pins that the transceiver is connected to, and which pin is for Rx and Tx
  • 1 Arduino Uno with an Adafruit RFM95W 900MHz Transceiver (Note: This transceiver will be swapped in the future for a 433MHz version, in the advanced ground station). Utilize the following wiring diagram to connect the transceiver to the Arduino Uno. It is imperative that this wiring diagram be followed exactly as it is, including the power supply being precisely 3.3V. The transceiver will not function if it has 5V of power.

image

  • 2 USB Type A to Type B cables as is custom to connect an Arduino Uno to a laptop

image

Procedures for setting up the Prototype Ground Station:

  1. Ensure that the transceivers are connected to their respective Arduino Unos as described above.
  2. Using the USB cables, connect each Arduino Uno to the laptop.
  3. Make sure you have the Arduino IDE installed and the ENTIRE repository cloned to your computer locally.
  4. Locate the LoRa_sender.ino file located in /SOAR_Echo_Base/Microcontrollers/LoRa_sender/LoRa_sender.ino
  5. Using the Arduino IDE, upload this code to BOTH of the Arduinos connected to the laptop. SPECIAL NOTE: For operation of the Ground Station it is necessary to know the COM port of each Arduino that is connected to the laptop. In the Arduino IDE it will say in the top left corner the COM port that the specific peripheral is connected to. This is essentially a "hardware address" that we use to tell the software "This Arduino is connected to that specific USB port on the laptop, humans can see that it's the USB port on the right side, but software-wise it is called COM4", with each COM port having a number to identify it like COM11 or COM3. Please write down the COM ports of each Arduino.
  6. Open a command line or console session in the SOAR_Echo_Base folder. This means that your terminal must look like this:

image

In my command line, I had the repository cloned and stored in the RECOVERY CODE folder. From there I navigated, in the terminal, to the SOAR_Echo_Base folder.

  1. Using either the GUI (your mouse and something like File Explorer) or the command line, open the requirements.txt file in this folder and make sure that you have installed each of the modules that are in this file. You can run the following command in the terminal from Step 6 to have the NPM (Node Package Manager) install all of the packages for you: (Insert the command here) Or you can manually run the npm install (blank) command for each module that you see in the requirements.txt file. For example, in the file there is the Flask module. To manually install this I would type into the command line the following: npm install flask (This command is not case sensitive). This can be continued for each of the modules in the file.

Then, repeat this process by manually installing, and cross checking that you have installed the modules listed in the package.json file. In this file scroll down until you see the dependencies and the devDependencies. Install each of the dependencies using the npm install (blank) command as shown previously, (but replace (blank) with the module name). Yes this does mean, that when installing the ESRI ArcGIS Feature Service module it means you must type the command as following: npm install @esri/arcgis-rest-feature-service . For installing the devDependencies you must modify the command slightly. As of 1/31/2024 there is only one dev dependency, and that is Webpack. To install Webpack and Webpack CLI you must enter the following commands: npm install webpack --save-dev npm install webpack-cli --save-dev This concludes the installation part of the Prototype Ground Station.

  1. Ensure that your terminal is located in the `SOAR_Echo_Base folder. Your terminal should look something like this:

image

  1. Locate the app.py python file. Run this file in the terminal. Note: A relatively new version of Python is required. At least 3.9 is recommended.

  2. Your terminal should now look something like this:

image

This output is relatively straightforward:

  • You can access the server on the URLs provided
  • You can stop the server by pressing CTRL+C (Note: You may have to press the shortcut several times to stop the server)
  • At the bottom, it shows HTTP logs for every time a client requests resources from the server (aka, you go to the website and click stuff)

This completes setup of the Prototype Ground Station.

Developer Notes

In order to use any node module that can be installed with NPM, you must first install the module to the SOAR_Echo_Base. We have the default node_modules folder on gitignore by default. Once the module is installed to the SOAR_Echo_Base folder and appears in the local node_modules folder, then you can proceed to write your code that uses the node module ONLY IN THE npm_functions.js FILE. AS OF 1/31/2024 THE ONLY WAY TO USE NODE MODULES IS TO ADD FUNCTIONS TO THE npm_functions.js FILE. We use Webpack to provide this functionality. This is because Flask requires the JavaScript to be "compiled" so to speak (this author is unsure of the exact term), and this brings us to the next step for development. But first, this npm_functions.js file is located in /SOAR_Echo_Base/src/npm_functions.js .

Flask requires the JavaScript file to be built, so the npm run build command must be run EACH AND EVERY TIME after the desired changes to the npm_functions.js file are made. This will rebuild the bundle.js file located at /SOAR_Echo_Base/static/bundle.js . This way, the changes will be saved and visible when viewed online.

To simplify things for development, a second terminal instance can be opened and navigated to the SOAR_Echo_Base folder. Then, execute npm run watch . This command tells NPM to run the webpack -- watch script automatically (located in package.json). What this will do is, each and every time npm_functions.js is saved, it will AUTOMATICALLY rebuild the bundle.js file and log a completed message in the terminal.

In short, and to summarize To develop with NPM modules the steps are as follows:

  1. Only make your changes to the npm_functions.js file
  2. Run npm run watch
  3. Wait for the log in the terminal saying it has recompiled bundle.js (it usually takes 0.5 to 1 second on average)
  4. Test and view the results of your code.

If you desire to write your npm functions in a different file, then you can work with configuring the webpack.config.js file and modify it in a way so it can, in the end, compile two bundle/build JS files.