Nick1965
Posts: 5
Joined: Fri May 27, 2016 1:05 pm

Programming a BBC Microbit with Raspberry Pi

Fri May 27, 2016 1:36 pm

As you'll know, all Year 7 pupils have been issued with a BBC Microbit. It is meant to be possible to program it using the Raspberry Pi, and integrating these two great educational tools would make a lot of sense, but I can't get it to work because I can't get the required Mu program to install on the Pi.

https://www.raspberrypi.org/learning/ge ... /software/

On this page it says one can simply type in the following code to install Mu

Code: Select all

sudo apt-get update && sudo apt-get install mu -y
But I just cannot get it to install. I get an error message saying it can't find the location of the package:
E: Unable to locate package mu
Then I tried to install Mu another way, by visiting this site and downloading a bin file.

http://codewith.mu/#download

But despite entering the code

Code: Select all

chmod +x mu.bin
as directed, the bin file does not become executable and so Mu will still not install. Some code activity happens (very fast, before disappearing from view before I can read it) but still Mu does not appear as an app in the Programming folder on the Pi.

Finally I tried this page, but as a relative newbie was groping about in the dark because there are no instructions. I ended up wrecking my Raspbian installation and having to reinstall.

https://github.com/ntoll/mu

Can anybody help? Has anyone managed to code the Microbit using Raspberry Pi?

I've put a poll on this post, to see if others are having more success.

texy
Forum Moderator
Forum Moderator
Posts: 5157
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Programming a BBC Microbit with Raspberry Pi

Fri May 27, 2016 2:49 pm

Hi and welcome to the forum.
I removed the poll - it really isn't necessary - you only need 1 person to tell you yes ;)

Are you sure you have an internet connection to the pi. What if you break down that install command like so :

Code: Select all

sudo apt-get update
sudo apt-get install mu -y
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Nick1965
Posts: 5
Joined: Fri May 27, 2016 1:05 pm

Re: Programming a BBC Microbit with Raspberry Pi

Fri May 27, 2016 3:15 pm

Hi. Yes, I accessed the websites mentioned using the Pi itself. It's got a wifi dongle that always connects very readily.

And yes, I've tried breaking the code into those two parts. Only the update runs.

hippy
Posts: 5973
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Programming a BBC Microbit with Raspberry Pi

Fri May 27, 2016 4:33 pm

"sudo apt-get install mu" works for me on Pi 1 B+ though I did not actually proceed to install it.

You might need to do an update/upgrade/dist-upgrade.

User avatar
B.Goode
Posts: 8604
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Programming a BBC Microbit with Raspberry Pi

Fri May 27, 2016 5:05 pm

The installation worked OK for me a few minutes ago..

Code: Select all

pi@rpi2b ~ $ sudo apt-get install mu -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  mu
0 upgraded, 1 newly installed, 0 to remove and 33 not upgraded.
Need to get 621 kB of archives.
After this operation, 1,634 kB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian/ jessie/main mu all 0.1-1 [621 kB]
Fetched 621 kB in 6s (99.6 kB/s)
Selecting previously unselected package mu.
(Reading database ... 113688 files and directories currently installed.)
Preparing to unpack .../apt/archives/mu_0.1-1_all.deb ...
Unpacking mu (0.1-1) ...
Processing triggers for gnome-menus (3.13.3-6) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.58) ...
Setting up mu (0.1-1) ...
pi@rpi2b ~ $

Nick1965
Posts: 5
Joined: Fri May 27, 2016 1:05 pm

Re: Programming a BBC Microbit with Raspberry Pi

Fri May 27, 2016 5:11 pm

Thanks chaps. I've done a dist upgrade. It just can't find the Mu package. Do I have to be on Jessie and not Wheezy? Can I code that change without a clean install?

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Programming a BBC Microbit with Raspberry Pi

Fri May 27, 2016 5:12 pm

Nick1965 wrote:Thanks chaps. I've done a dist upgrade. It just can't find the Mu package. Do I have to be on Jessie and not Wheezy? Can I code that change without a clean install?
Yes, you have to be on Jessie. viewtopic.php?t=121880
There are 10 types of people: those who understand binary and those who don't.

Nick1965
Posts: 5
Joined: Fri May 27, 2016 1:05 pm

Re: Programming a BBC Microbit with Raspberry Pi

Fri May 27, 2016 7:40 pm

Wow - the polar opposite of a user-friendly update, with limited chances of success to boot!

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Programming a BBC Microbit with Raspberry Pi

Fri May 27, 2016 8:00 pm

Nick1965 wrote:Wow - the polar opposite of a user-friendly update, with limited chances of success to boot!
Huh? It's easy and only a few steps. That's why you keep files on a USB stick so you easily flash a new OS. The Pi isn't a commercial product and as such everything isn't as easy as pie.
There are 10 types of people: those who understand binary and those who don't.

hippy
Posts: 5973
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Programming a BBC Microbit with Raspberry Pi

Sat May 28, 2016 1:01 pm

Nick1965 wrote:Wow - the polar opposite of a user-friendly update, with limited chances of success to boot!
Agreed it does not look simple to me. It may instead be worth grabbing a new SD card (or backing up anything you have added to your wheezy setup ) and installing Jessie from the latest NOOBS. That was the path I took which was just as easy as having initially installed Wheezy.

User avatar
carlosperate
Posts: 3
Joined: Sun Jan 17, 2016 1:01 pm
Location: Cambridge, UK
Contact: Website

Re: Programming a BBC Microbit with Raspberry Pi

Sat May 28, 2016 2:15 pm

Then I tried to install Mu another way, by visiting this site and downloading a bin file.

http://codewith.mu/#download

But despite entering the code

Code: Select all
chmod +x mu.bin

as directed, the bin file does not become executable and so Mu will still not install. Some code activity happens (very fast, before disappearing from view before I can read it) but still Mu does not appear as an app in the Programming folder on the Pi.
Just wanted to clarify that the Linux download from http://codewith.mu is meant for Desktop version of Linux (running on x86/64-bit processors), not for ARM Linux. Also, that file is a "self-contained" executable, so executing the file runs the application, it would not install itself.

Nick1965
Posts: 5
Joined: Fri May 27, 2016 1:05 pm

Re: Programming a BBC Microbit with Raspberry Pi

Sat May 28, 2016 9:51 pm

Thanks chaps. The update was an interesting learning process, but I got there in the end and subsequently was indeed able to install Mu. Now it can be used to program the BBC Microbit. Excellent!

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Programming a BBC Microbit with Raspberry Pi

Wed Jun 01, 2016 12:49 pm

You can install mu, relatively easily by getting the code direct from github.

Open a Terminal (Menu > Accessories > Terminal):

Code: Select all

cd ~
sudo apt-get install python3-pyqt5 python3-pyqt5.qtserialport python3-pyqt5.qcsi
git clone https://github.com/ntoll/mu
chmod +x ~/mu/run.py
Run using the command:

Code: Select all

~/mu/run.py
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

Return to “Staffroom, classroom and projects”