Git Product home page Git Product logo

bitcraze-vm's Introduction

Bitcraze Virtual Machine

This project contains scripts and templates to automatically create the Bitcraze VM with Packer. It's also used for tracking issues and improvements.

The Bitcraze VM contains everything you need for running the Bitcraze projects and doing development for them. It's a great way to quickly get started without having the hassle of installing dependencies and setting up the development environment.

Here is a non-exhaustive list of what's included:

  • Ubuntu live server 22.04 pre-configured
  • VirtualBox guest additions pre-installed
  • udev rules and pre-configured USB filtering for the Crazyradio and it's bootloader (NRF BOOT)
  • Most of our projects pre-cloned
  • QTCreator
  • Firefox
  • vscode prepared for compiling/debugging/flashing the Crazyflie firmware
  • SDCC 3.2 for compiling of Crazyradio firmware

Downloading

The Bitcraze VM can be downloaded via the Github Release Page

Installing

Note: Since the VM is an AMD64 install of Linux, it does not work on Apple-silicon Mac (M1/2/... processors). On an apple silicon mac you need to install the tools natively.

The virtual appliance can be imported into VirtualBox. You will need the extention package of virtual box to be able to use the USB device. Go to Oracles download page to install both virtual box and the expansion pack.

It can be used with other virtual machine managers, however setting up the guest addition might be required. The following have been tested

Using the virtual machine

After importing just run the machine. Log in with the following credentials:

User: bitcraze
Pass: crazyflie

In the virtual machine double click the “update all projects” icon on the desktop. This pulls down the latest source code from GitHub for all projects.

install hardware

Insert Crazyradio PA in a USB port. Insert game controller in a USB port.

Optimizing for Use

For faster USB connection with the Crazyradio PA it is advised to filter the USB device at startup of the VM. Go to settings->USB, make sure that USB 3.0 is enabled and add a USB device filter for the Crazyflie PA, which should be called 'Bitcraze Crazyradio PA USB Dongle [9955]'.

For the rest of the performance of your VM, you can try to increase the base memory (Settings/System/Motherboard), the CPU's available (Settings/System/Processor), enable hardware acceleration and select Hyper-V (Settings/System/Acceleration) or increase the video memory with 3D acceleration enabled (Settings/Display/Screen). This requires some adjusting as this could be different per system you are running the VM from.

How to build the Bitcraze VM image

Pre-requisites

  • This script has only been tested on a Linux machine, therefore it's recommended to use Linux to build the Bitcraze VM
  • VirtualBox must be installed as well as the VirtualBox Extension Pack
  • Virtual box guest additions
  • Packer (can be installed with apt install packer)

Local build

  1. Run createBitcrazeVM.sh
  2. Wait 40-60 minutes depending on machine and internet connection speed

The resulting .ova can be found in output-virtualbox-ovf/BitcrazeVM.ova.

What does createBitcrazeVM.sh do?

Run the two Packer templates * Create the VM and run a preseeded installation (bitcrazeVM_createVM.json) * Provision the VM (bitcrazeVM_provisionVM.json)

Why are there two packer templates?

To separate the VM creation and installation from the provisioning. If there is a problem during provisioning, the whole process does not have to start from scratch again. This saves a lot of time.

What do the packer templates do?

bitcrazeVM_createVM.json

  1. Download an ISO and create a VirtualBox image
  2. Start the so-called "preseeding", which automatically runs the Ubuntu installer
  3. Export VM image to OVA file

bitcrazeVM_provisionVM.json

Copy the files specified in the JSON template to the VM and run the provision.sh script so setup the image.

Help! Something does not work.

Please take a look at the log files packerlog_create.txt and packerlog_provision.txt.

Contribute

Go to the contribute page on our website to learn more.

bitcraze-vm's People

Contributors

ataffanel avatar evoggy avatar fredg02 avatar jonasdn avatar knmcguire avatar krichardsson avatar tobbeanton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitcraze-vm's Issues

VM Extremely slow

The VM image seems to be extremely slow these days, but no idea why that is exactly.. We recently updated packer, maybe that is due to that? Or we have to indicate in the instructions that people need to increase the recourses given to the VM from virtual box? Still to be figured out!

Upgraded VM running 64bit (?)

Will the upgraded VM run XUbuntu 18.04 LTS 64 bit?

I think the tools in use are available and / or running on a 64bit system, however, e.g. Gitkraken is not available for 32bit.

USB problem in the VM

We have seen USB communication problems in the virtual machine. When using the python client, the Crazyradio and a Crazyflie the symptoms are loss of connectivity and general communication problems between the client and the Crazyflie.
The problem has been observed on Windows, OSX and linux when using Virtual Box as the virtualization environment. As far as we know this problem is related to Virtual Box and seems to have been introduced at some point the last few months. It has not been observed in native installations.

Workaround: Run the client natively without the VM. See instruction in the getting started and https://github.com/bitcraze/crazyflie-clients-python/blob/master/README.md.

This problem needs further investigation to reach a better understanding.

How to upgrade to the 2021.01 release

The VM is unfortunately becoming old and is in need of an upgrade (#49).

Updating the source code to the 2021.01 release is unfortunately not as easy as running the "update all projects" script, the purpose of this issue is to document how to do it.

If something is wrong or missing, please contribute!

From a terminal window:

  1. upgrade pip pip3 install --upgrade pip
  2. Uninstall cfclient pip3 uninstall cfclient
  3. Re-install cfclient pip3 install cfclient

if You want to run the client from source, first run the "update all projects" script and use pip3 install -e ~/projects/crazyflie-clients-python/ and pip3 install -e ~/projects/crazyflie-lib-python/ instead to install the client

Version Mismatch

Hello,

Is there any specific Oracle VM version I should download? I am getting an error below.
error_running _vm
Then I can see a version_mismatch detail below
version_mismatch

vm import error

Mac OSX 10.14.4
VirtualBox 6.06
When I double click the 2018.12.ova.
ERROR
Result Code: | NS_ERROR_INVALID_ARG (0x80070057)
how can I fix this bug.

Missing dependency to save plots in client

One dependency is missing and it prevents saving plots from the client. Can be installed with:

sudo apt-get install python3-pyqt5.qtsvg

This should be added to the VM provisioning script.

VM could not build

gnclab@system76-pc:~/bitcraze-vm$ ./createBitcrazeVM.sh 
Packer already installed. Continuing...
contentForVM/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 not found. Starting download...
--2020-05-30 00:30:56--  https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
Resolving developer.arm.com (developer.arm.com)... 104.72.63.64
Connecting to developer.arm.com (developer.arm.com)|104.72.63.64|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 [following]
--2020-05-30 00:30:57--  https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
Resolving armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)... 52.239.137.100
Connecting to armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)|52.239.137.100|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 100600407 (96M) [application/octet-stream]
Saving to: ‘contentForVM/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2’

gcc-arm-none-eabi-7 100%[===================>]  95.94M  1.74MB/s    in 55s     

2020-05-30 00:31:52 (1.76 MB/s) - ‘contentForVM/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2’ saved [100600407/100600407]

contentForVM/eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz not found. Starting download...
--2020-05-30 00:31:52--  http://ftp.halifax.rwth-aachen.de/eclipse//technology/epp/downloads/release/2018-09/R/eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz
Resolving ftp.halifax.rwth-aachen.de (ftp.halifax.rwth-aachen.de)... 137.226.34.46, 2a00:8a60:e012:a00::21
Connecting to ftp.halifax.rwth-aachen.de (ftp.halifax.rwth-aachen.de)|137.226.34.46|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 236908195 (226M) [application/octet-stream]
Saving to: ‘contentForVM/eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz’

eclipse-cpp-2018-09 100%[===================>] 225.93M  5.80MB/s    in 42s     

2020-05-30 00:32:35 (5.35 MB/s) - ‘contentForVM/eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz’ saved [236908195/236908195]

contentForVM/ilg.gnuarmeclipse.repository-2.12.1-201604190915.zip found. Continuing...
contentForVM/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz not found. Starting download...
--2020-05-30 00:32:35--  https://github.com/gnuarmeclipse/openocd/releases/download/gae-0.9.0-20150519/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz
Resolving github.com (github.com)... 140.82.113.3
Connecting to github.com (github.com)|140.82.113.3|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/ilg-archived/openocd/releases/download/gae-0.9.0-20150519/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz [following]
--2020-05-30 00:32:35--  https://github.com/ilg-archived/openocd/releases/download/gae-0.9.0-20150519/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/40920267/bda9e806-49d3-11e5-8254-64fd7ae3ff98?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200530T053235Z&X-Amz-Expires=300&X-Amz-Signature=59ebe30ee99189f6804276fdf7cef5a5c08e298dacdcf960865913c2f37f3889&X-Amz-SignedHeaders=host&actor_id=0&repo_id=40920267&response-content-disposition=attachment%3B%20filename%3Dgnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz&response-content-type=application%2Foctet-stream [following]
--2020-05-30 00:32:35--  https://github-production-release-asset-2e65be.s3.amazonaws.com/40920267/bda9e806-49d3-11e5-8254-64fd7ae3ff98?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200530T053235Z&X-Amz-Expires=300&X-Amz-Signature=59ebe30ee99189f6804276fdf7cef5a5c08e298dacdcf960865913c2f37f3889&X-Amz-SignedHeaders=host&actor_id=0&repo_id=40920267&response-content-disposition=attachment%3B%20filename%3Dgnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.171.27
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.171.27|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2381724 (2.3M) [application/octet-stream]
Saving to: ‘contentForVM/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz’

gnuarmeclipse-openo 100%[===================>]   2.27M  5.55MB/s    in 0.4s    

2020-05-30 00:32:36 (5.55 MB/s) - ‘contentForVM/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz’ saved [2381724/2381724]

~/bitcraze-vm ~/bitcraze-vm
Compressing eclipse-project-files.tar.gz
~/bitcraze-vm
Running packer...
OVA file not found. Starting VM creation...
virtualbox-iso output will be in this color.

Build 'virtualbox-iso' errored: Failed creating VirtualBox driver: exec: "VBoxManage": executable file not found in $PATH

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Failed creating VirtualBox driver: exec: "VBoxManage": executable file not found in $PATH

==> Builds finished but no artifacts were created.
Starting VM provisioning...
virtualbox-ovf output will be in this color.

1 error(s) occurred:

* source_path is invalid: stat output-virtualbox-iso/BitcrazeVM.ova: no such file or directory

ISO not downloaded

$ISO_FILE and $ISO_URL was not specified and used in
https://github.com/bitcraze/bitcraze-vm/blob/master/createBitcrazeVM.sh#L24-L31

So Packer ends with an error

Running packer...
OVA file not found. Starting VM creation...
virtualbox-iso output will be in this color.

Build 'virtualbox-iso' errored: Failed creating VirtualBox driver: exec: "VBoxManage": executable file not found in $PATH

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Failed creating VirtualBox driver: exec: "VBoxManage": executable file not found in $PATH

==> Builds finished but no artifacts were created.
Starting VM provisioning...

Change crazyflie-firmware branch to "master"

The 0.6 VM currently has the crazyflie-firmare repository clone with "crazyflie2" branch checked out. This can be confusing to new users since they have to checkout master, especially if they're looking to create deck driver code, before running the "Update all projects" script.

The VM cannot build the Crazyflie firmware using GCC7

The version of arm-none-eabi-gcc contained in the VM 2018.12 is not able to compile the Crazyflie firmware.

The solution is to update to gcc8 when we make a new version of the VM

In the mean-time the current VM can be updated to use GCC8 by typing the following commande in a console:

cd ~
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2?revision=c34d758a-be0c-476e-a2de-af8c6e16a8a2?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,8-2019-q3-update -O gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2
sudo tar --strip-components=1 -xf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2

GDB hardware debugging configuration for STM is broken

Produces the folowing error: --target-select remote localhost:3333 timed out. We should check if this configuration file is still valid or that we should remove the configuration file.

This is with issue #40 applied as a fix for the broken link for gdb

LPS tab prints a lot of warnings and slow down the Crazyflie client

The pyqtgraph version installed in the VM is too old which causes warnings to be printed very fast when the client is running and the LPS tab is displayed.

The following commands solves the problem and should most likely be run during VM build:

cd projects/crazyflie-clients-python
sudo pip3 install -e . --upgrade

The client is tracking the wrong branch

The client is tracking develop instead of master. This means that out of the box the client is not updated to the latest version even if the 'update all' script is executed.

Add submodule init/update to update script

When adding a submodule to a project, the project will stop compiling in Eclipse requiring to lauch two git commands on command line.

This could be detected and done automatically in the update-all script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.