Skip to content
Snippets Groups Projects
Select Git revision
  • de0b9dc8c4c32723e36f5c73973c4782ca1e3859
  • master default protected
  • julia1
  • device_rewrite
  • bufferandcomedi
  • v0.1.0
6 results

installation.md

Blame
  • Installation instructions

    In these instructions we explain how to set up a working environment on a host computer and a BeagleBone Black (BBB).

    Host computer setup

    Installing Julia and LabConnections.jl

    To get started, first install Julia v1.0.X on the host computer running a Linux distribution by following the instructions specified here. Once Julia is installed, open up a Julia REPL and add LabConnections.jl using the package manager by typing

    ] add https://gitlab.control.lth.se/labdev/LabConnections.jl#julia1

    You now have the LabConnections.jl package available on the host computer. Note that for Julia v1.0.X it is the branch julia1 of the package that should be used.

    BeagleBone setup

    Preparing a micro-SD card

    First, we will prepare a micro-SD card with an image of Debian and a binary of Julia, which we then can flash onto the BBB.

    Start by downloading the Debian image here (Debian 9.5 2018-10-07 4GB SD IoT) and write the image onto a micro-SD card (this guide is helpful). Proceed by downloading the Julia v1.0 binary for 32-bit ARMv7 found here. Put the .tar-file of the Julia binary on the micro-SD card containing the Debian image under /home/debian, and unzip it. Make sure that the Julia folder has the correct name by typing

    mv /home/debian/julia-<distro specific tag>/bin/julia /home/debian/julia/bin/julia

    The file structure on the micro-SD now has the correct structure.

    The final step is to make sure that the micro-SD will automatically flash the Debian image onto the BBB when booting up. To do this, follow the instructions found here. Congratulations, you now have a prepared micro-SD card ready for flashing a BBB.

    Flashing the BeagleBone

    Insert a prepared micro-SD card in the slot on the BBB, and press down the boot button S2 (the button closest to the micro-SD slot) and hold it down while you plug in the USB-cable to the BBB. Keep the S2 button held down for a couple of seconds, until the onboard LEDs start to blink. After a short while the onboard LEDs should start to blink in a wave pattern, indicating that the BBB is being flashed. After a while (can vary between 5-45 minutes) the BBB will be turn off automatically, indicating that the flashing is complete. Remove the micro-SD before powering on the BBB again (otherwise it will start to flash the BBB again).

    Accessing the BeagleBone

    Now your BBB should be ready to use. Log on to the BeagleBone via SSH by opening a terminal and typing

    ssh debian@192.168.7.2

    The default password is temppwd. You are now logged in to the BBB running Debian. If the micro-SD was prepared correctly, the Julia binary should be located at /home/debian/julia/bin/julia. You can now start a Julia REPL on the BBB by typing

    /home/debian/julia/bin/julia

    If the Julia REPL starts up correctly, then you have a functioning BBB ready for use with the LabConnections.jl package.

    Getting LabConnections.jl on the BeagleBone

    To update the BBB with the latest revision of the code,

    `cd && cd .julia/v0.6/LabConnection/util'
    `./flash_BB.sh'

    This scripts bundles the current code in LabConnections (and serbus, see SPI development below) on the host computer and transfers it to the /home/debian/juliapackages directory on the BBB.

    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

    `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)

    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.

    Debugging

    No errors will be seen on the BeagleBone when the automatic startup is used. For debugging purposes it might be useful to start the service manually on the beagle bone. Start julia as root:

    sudo /home/debian/julia/bin/julia

    and run the startup script:

    include("/home/debian/juliapackages/LabConnections/src/BeagleBone/startup/startup.jl")