From c64d3012e3e82ab7510536a0537fdd961a350f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Thelander=20Andr=C3=A9n?= <marcus.thelander_andren@control.lth.se> Date: Mon, 15 Apr 2019 14:41:16 +0200 Subject: [PATCH] Changes in instructions to transfer LabConnections and serbus to BB --- Project.toml | 2 +- docs/src/man/installation.md | 29 ++++++++++++++++------------- util/flash_BB.sh | 13 +++++++------ 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/Project.toml b/Project.toml index 221164a..a4e5270 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "LabConnections" uuid = "e9ebaa62-f26d-11e8-0a59-692f6511a9a1" -authors = ["Mattias Fält <mattiasf@control.lth.se>", "Marcus Greiff", "Marcus Thelander Andrén"] +authors = ["Mattias Fält <mattiasf@control.lth.se>", "Marcus Greiff", "Marcus Thelander Andrén <marcus@control.lth.se>"] version = "0.1.0" [deps] diff --git a/docs/src/man/installation.md b/docs/src/man/installation.md index 4000395..3fd4520 100644 --- a/docs/src/man/installation.md +++ b/docs/src/man/installation.md @@ -52,29 +52,32 @@ If the Julia REPL starts up correctly, then you have a functioning BBB ready for ### Getting LabConnections.jl and serbus on the BeagleBone -To update the BBB with the latest revision of the code, open up a terminal and type +To update the BBB with the latest revision of the code, open up a terminal on the host computer and begin by cloning the `serbus` and `LabConnections.jl` repositories to a common directory ``` -cd ~/.julia/packages/LabConnections/<version id>/util +git clone https://github.com/mgreiff/serbus +git clone --branch julia1 https://gitlab.control.lth.se/labdev/LabConnections.jl.git +``` +Then proceed by navigating to `LabConnections.jl/util` and run the `flash_BB.sh` shell script +``` +cd LabConnections/util ./flash_BB.sh ``` This scripts bundles the current code in LabConnections.jl and serbus on the host computer and transfers it to the BBB and puts it in the directory `/home/debian/juliapackages`. <a id='Setting-up-automatic-communication-1'></a> -### Setting up automatic communication -To setup automatic start of Julia server on the BB, make sure to have completed all prior installation instructions, and that the latest revision of the LabConnections package is located on the BB. SSH to the BeagleBone and copy the julilaserver.service to the systemd/system - +### Setting up a Julia server on the BeagleBone +To setup automatic start of Julia server on the BBB, make sure to have completed all prior installation instructions, and that the latest revision of the LabConnections package is located on the BBB. SSH into the BBB, and copy the file `juliaserver.service` to the folder `systemd/system` ``` ssh debian@192.168.7.2 -sudo cp -r /home/debian/juliapackets/LabConnections/src/BeagleBone/startup/juliaserver.service /lib/systemd/system/juliaserver.service` (on the BeagleBone) +sudo cp -r /home/debian/juliapackets/LabConnections/src/BeagleBone/startup/juliaserver.service /lib/systemd/system/juliaserver.service ``` - - -Then execute the commands - -`sudo systemctl enable juliaserver` (on the BeagleBone) `sudo systemctl start juliaserver` (on the BeagleBone) - -After a while, the BeagleBone should start blinking on SysLED 2: on-off-on-sleep-repeat. The server should now start automatically on restart of the BeagleBone, and you should be able to run the examples in in /Examples on the host computer. +Then, still SSH:d into the BBB, execute the commands +``` +sudo systemctl enable juliaserver +sudo systemctl start juliaserver +``` +After a while, the BBB should start blinking onboard LED 2 in the following pattern: on-off-on-sleep-repeat. This indicates that the server on the BBB is now running, and server should now start automatically every time you restart the BBB. With this setup ready, you should be able to run the examples in the `/Examples` folder from the host computer. ## Debugging diff --git a/util/flash_BB.sh b/util/flash_BB.sh index af7a7a2..867cf10 100755 --- a/util/flash_BB.sh +++ b/util/flash_BB.sh @@ -1,15 +1,15 @@ #!/bin/bash -#Run in this file in util folder, copies to BB +#Run in this file un util folder, copies to BB BLUE='\033[0;34m' GREEN='\033[0;32m' RED='\033[0;31m' NC='\033[0m' -BASEDIR=../../../$(dirname "$0") +BASEDIR=../../$(dirname "$0") # Dependencies -# LabConnections.jl package -# serbus - a fork of a SPI communication interface -packages=(LabConnections serbus) +# LabConnections - main repository +# serbus - a fork of a SPI communicaiton interface +packages=(LabConnections.jl serbus) # Create an empty directory to bundle packages if [ -d ${BASEDIR}/juliapackages ]; then @@ -23,12 +23,13 @@ printf "${GREEN}Bundling...${NC}\n\n" for (( i=0; i<${#packages[@]}; i++ )); do { printf "${BLUE} * ${packages[$i]}${NC}\n" - cp -r ../../../${packages[$i]} ${BASEDIR}/juliapackages + cp -r ../../${packages[$i]} ${BASEDIR}/juliapackages } || { printf "${BLUE}WARNING.${NC} Could not bundle package ${packages[$i]}${NC}\n" flag=false } done +mv ${BASEDIR}/juliapackages/LabConnections.jl ${BASEDIR}/juliapackages/LabConnections # Transfer files if [ "$flag" = true ] ; then -- GitLab