Skip to content
Snippets Groups Projects
Commit c64d3012 authored by Marcus Thelander Andrén's avatar Marcus Thelander Andrén
Browse files

Changes in instructions to transfer LabConnections and serbus to BB

parent 52b6b29e
No related branches found
No related tags found
No related merge requests found
Pipeline #703 failed
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]
......
......@@ -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
......
#!/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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment