Changes

Jump to navigation Jump to search
1,956 bytes added ,  02:50, 10 May 2018
Line 3: Line 3:  
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.
 
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===
 
===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 [https://www.raspberrypi.org/documentation/remote-access/ssh/ 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 <code> ssh pi@10.34.195.142 </code>
 +
 +
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 [https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key here]
 +
 +
After that, you should be good to go to SSH into the Pi
    
===Uploading Code===
 
===Uploading Code===
 +
 +
Be in the platformio project folder you want to upload code for, and just run the command <code>push</code>. This calls a short script to do the necessary things.
    
===Running a SHITL test===
 
===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 <code>#define SERIALSHITL</code>. Once reprogrammed, this will put valbal in SHITL mode.
 +
 +
Next, run the script shitl/shitl.py with python3 (you must used the command <code>python3</code> 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 <code>shitl/test-outputs</code> . 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 <code>screen</code> and then do things normally as you would. Refer to the manpages of screen for more info.
    
===SD Card (joan cough cough)===
 
===SD Card (joan cough cough)===
77

edits

Navigation menu