-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ParadigmHyperloop/feature/PI/raspbian-dock…
…erfile-taskrunner feature/PI/raspbian-dockerfile-taskrunner
- Loading branch information
Showing
9 changed files
with
138 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.vscode | ||
.vscode/* | ||
!important .vscode/tasks.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
.vscode/c_cpp_properties.json | ||
.vscode/launch.json | ||
.vscode/ipch | ||
.vscode/settings.json | ||
.vscode/extensions.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "echoTest", | ||
"type": "shell", | ||
"command": "echo 'Hello taskrunner test good.'", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
}, | ||
{ | ||
"label": "buildPiImage", | ||
"type": "shell", | ||
"command": "docker build -t pidaq:v1 docker/.", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
}, | ||
{ | ||
"label": "compileRunPiHelloWorld", | ||
"type": "shell", | ||
"command": "docker run -it -v /c/Hyperloop/testing-software/Pidaq:/home/data --entrypoint helloTest.sh pidaq:v1", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
# Pidaq (Rasp Pi Data Aquisitor) | ||
|
||
This directory contains all of the code that will run on the raspberry pi. The pi will receive and parse CAN messages containing raw telemetry, apply calculations, and create a packet(s) containing either a JSON or protobuf message to send to the control laptop via ethernet (UDP) | ||
*** | ||
## Examples | ||
|
||
# Development | ||
We will be using docker to cross compile c++ for the raspberry pi | ||
|
||
Includes relevant examples | ||
*** | ||
Ensure docker is installed and running on your machine. Windows 10 Home does not have proper support for docker, however MUN offers a free upgrade to windows 10 education which is fully featured. The update is easy, unintrusive, and takes less than 1 hour. | ||
|
||
## Taskrunner Setup Code for VsCode | ||
* Install vscode extension "Tasks" by actboy 168 | ||
|
||
* Open testing-software/Pidaq folder with vscode | ||
|
||
* Replace the folder path in .vscode/tasks.json line 28 command: `compile and run Pidaq HelloWorld`, with your path. replace this -> `/c/Hyperloop/testing-software/Pidaq ` | ||
|
||
* Try the task buttons in blue taskbar at bottom of vscode window: | ||
* `echoTest` should print Hello taskrunner good. | ||
* `buildPiImage` should build docker image `pidaq:v1` | ||
* `compileRunPiHelloWorld` should print "---Hello Paradigm!!!---" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM raspbian/stretch:latest | ||
|
||
LABEL build-date="2020-03-01" \ | ||
name="Raspi + Clang for xcompiling" | ||
|
||
RUN sudo apt update -y && \ | ||
sudo apt upgrade -y | ||
|
||
RUN sudo apt-get install -y \ | ||
git \ | ||
make \ | ||
curl \ | ||
xz-utils \ | ||
libstdc++6-4.6-dev | ||
|
||
RUN cd ~ && \ | ||
wget http://releases.llvm.org/9.0.0/clang+llvm-9.0.0-armv7a-linux-gnueabihf.tar.xz && \ | ||
tar -xvf clang+llvm-9.0.0-armv7a-linux-gnueabihf.tar.xz && \ | ||
rm clang+llvm-9.0.0-armv7a-linux-gnueabihf.tar.xz && \ | ||
mv clang+llvm-9.0.0-armv7a-linux-gnueabihf clang_9.0.0 && \ | ||
sudo mv clang_9.0.0 /usr/local && \ | ||
echo 'export PATH=/usr/local/clang_9.0.0/bin:$PATH' >> ~/.bashrc && \ | ||
echo 'export LD_LIBRARY_PATH=/usr/local/clang_9.0.0/lib:$LD_LIBRARY_PATH' >> ~/.bashrc && \ | ||
. ~/.bashrc && \ | ||
clang++ --version | ||
|
||
COPY helloTest.sh /usr/local/bin | ||
|
||
RUN sed -i.bak 's/\r$//' /usr/local/bin/helloTest.sh && \ | ||
chmod +x /usr/local/bin/helloTest.sh | ||
|
||
CMD /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Raspbian Docker Setup | ||
**Developed by Mark Duffett for CompV Software** | ||
|
||
Building and running the raspbian docker container: | ||
|
||
* Docker build | ||
``` | ||
docker build -t pidaq:v1 . | ||
``` | ||
|
||
* Docker Run (open to bash prompt) | ||
``` | ||
docker run -it -v path-to-PIDAQ-dir:/home/data pidaq:v1 /bin/bash | ||
``` | ||
|
||
* Docker Run (launch script) | ||
``` | ||
docker run -it -v path-to-PIDAQ-dir:/home/data --entrypoint helloTest.sh pidaq:v1 | ||
``` | ||
|
||
*Where path-to-PIDAQ-dir = `/c/Hyperloop/testing-software/Pidaq on my machine* | ||
|
||
## General Docker Commands | ||
* `docker --version` // Check docker version/ ensure docker is installed | ||
* `docker image ls` // list docker images | ||
|
||
## Remote Pi SSH Setup | ||
* `sudo systemctl enable ssh` | ||
* `sudo systemctl start ssh` | ||
* `ifconfig` // to get IP address of raspi | ||
|
||
Default: user=pi, password=raspberry | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# Custom aliases | ||
# Test C++ Compilation | ||
. ~/.bashrc | ||
cd ~ | ||
clang++ /home/data/docker/test_main.cpp | ||
./a.out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Raspi cross compiling test program | ||
#include<iostream> | ||
|
||
int main() | ||
{ | ||
std::cout << "---Hello Paradigm!!!---"; | ||
|
||
return 0; | ||
} |