-
Notifications
You must be signed in to change notification settings - Fork 0
feature/PI/raspbian-dockerfile-taskrunner #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
colton-smith
merged 11 commits into
master
from
feature/PI/raspbian-dockerfile-taskrunner
Mar 8, 2020
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
08da1a0
Add raspbian dockerfile from compV
colton-smith 579a9f2
Add script+cpp file for testing xcompile in docker
colton-smith 4c56ebc
Add pi development+docker readmes
colton-smith de6bc07
Add settings+extensions to node gitignore
colton-smith 9e1c9ff
Negate the gitignore of tasks.json in pi folder
colton-smith 4604dd2
Add CMD to dockerfile so run defaults to shell
colton-smith 4993665
Fix typo in pidaq root readme, tasks->takes
colton-smith db2b8a4
Fix typo in gitignore
colton-smith 9480e0e
Add ! back to .gitignore
colton-smith 3463481
gitignore contents of .vscode instead of folder
colton-smith 38d9a53
Handled gitignore at higher level, emptied lowlevel
colton-smith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 @@ | ||
!important vscode/tasks.json | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be .vscode/tasks.json? I think that directory is still getting gitignored, just noticed this when following the instructions on the README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct, fixed