01 Jan 2018

How to compile mBlock on Ubuntu

mBlock

mBlock is an IDE to program Arduino via the scratch language. The same project is used to program mBot robot. Unfortunately, mBlock is not released in its latest version for Linux so I had to recompile it from scratch. This post is about the procedure I had to do in order to get everything right.

Install nodejs

First thing is to install nodeJS. There is already a trick to know

1
2
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Reference is from https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

Install npm

From Ubuntu packages

1
sudo apt install npm

Install necessary development libraries

1
2
sudo apt install libbluetooth-dev
sudo apt install libusb-1.0-0-dev

Follow installation from mBlock github

Reference: https://github.com/Makeblock-official/mBlock

First clone mBlock

1
git clone https://github.com/Makeblock-official/mBlock.git

Then compile everything with npm

1
2
3
4
npm install
npm run rebuild-serialport
npm run rebuild-hid
npm run rebuild-bluetooth

Install extra dependencies

1
npm install --save-dev electron-prebuilt

Start mBlock

1
npm start
Thank You For Reading
Laurent Carlier

Do not hesitate to contact me via e-mail ([email protected]) if you have any question or comment. If see an error, you can issue a pullme request om my github