ValBal SHITL

From Stanford SSI Wiki
Revision as of 02:50, 10 May 2018 by Johnldean (talk | contribs) (→‎Running a SHITL test)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

SHITL stands for Some Hardware In The Loop. SHITL testing is a method of testing things before launch, similarly other forms of testing are Hardware in the Loop (HITL) or Hardware Out Of the Loop (HOOTL). The best test is a HITL, which tests all hardware and software components, while a HOOTL is mostly just for software and is a simulation, and a SHITL is somewhere in the middle. It's like shitty version of HITL.

For Valbal, we use a Raspberry Pi to both flash new code to the valbal board, and run tests, all from the comfort of our beds.

Connecting to the Pi

We use SSH to connect to the pi (more info on how to setup SSH on the client side aka your laptop can be fount under section 4 of this guide). Rather than set up a static IP address for the pi, which can be a pain to do properly, we have the pi publish it's ip address whenever it changes to slack to the channel #what-is-valbals-ip. The user name for the defaul user is pi. So an example command to get in is ssh pi@10.34.195.142

In order to get in, you will need an an authorized RSA key. So, before trying to log in message either @johndean or @jcreus to add your public key. For more info on RSA key's refer to here

After that, you should be good to go to SSH into the Pi

Uploading Code

Be in the platformio project folder you want to upload code for, and just run the command push. This calls a short script to do the necessary things.

Running a SHITL test

First, you have to make sure that the code is configured to actually run the test. In Avionics.h, un-comment out the line #define SERIALSHITL. Once reprogrammed, this will put valbal in SHITL mode.

Next, run the script shitl/shitl.py with python3 (you must used the command python3 since the pi defaults to python2 (I think)). You'll want to do this as soon as platformio is done uploading the code to valbal.

After shitl is running, a bunch of variables will be output to a file in test shitl/test-outputs . The date and time is appended to each file, so find the most recent one. I think the pi is on UTC time or something so it wont match local time.

Notes

You'll want to run the shitl.py from a screen session so that you can logout and it will stay running. To do this, run the command screen and then do things normally as you would. Refer to the manpages of screen for more info.

SD Card (joan cough cough)