Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Raspberry Pi #5

Open
bennuttall opened this issue Dec 14, 2015 · 8 comments
Open

Support Raspberry Pi #5

bennuttall opened this issue Dec 14, 2015 · 8 comments

Comments

@bennuttall
Copy link

Current status: urepl fails to open on Raspberry Pi.

ImportError: cannot import name comports

I'll do some more digging and post my findings here.

@bennuttall
Copy link
Author

Ok by installing the latest version of Serial I seem to have got it working.

I uninstalled the apt packages for Serial for py2 & py3:

sudo apt-get purge python-serial python3-serial -y

And installed the latest serial from PyPI:

sudo pip install pyserial --upgrade
sudo pip3 install pyserial --upgrade

I thought it would be harder than that but ok.

I will pass this on to my team and get it packaged for Raspbian.

@bennuttall
Copy link
Author

On a related note, how do you reset the microbit? I have one running some code created using the web interface, I think, and I can't connect to it using urepl. Is there a method of reflashing it?

@ntoll
Copy link
Owner

ntoll commented Dec 14, 2015

Hi @bennuttall great stuff!

The only thing urepl brings to the party is that it auto-discovers the correct USB-serial port for the micro:bit. You could just use a "regular" tool like picocom (see the bottom of the README here: https://github.com/bbcmicrobit/micropython).

In terms of re-flashing the device, try this file as a very recent build from master with "vanilla" MicroPython (i.e. no Python script automatically installed with it).

https://github.com/ntoll/upyed/raw/master/firmware.hex

Give me a couple of days and we'll have this working in "mu". ;-)

@bennuttall
Copy link
Author

Great - thanks. I'm keen to write code in Python on the Pi that can talk to the microbit but also do regular Python stuff like GPIO and requests! I'll have a play

@bennuttall
Copy link
Author

Agh I'm giving this another try and failing to get it running again.

@ntoll Can you give it a try and let me know how you get on?

@bennuttall
Copy link
Author

On a Pi, I mean

@ntoll
Copy link
Owner

ntoll commented Jan 12, 2016

Will do.

@ntoll
Copy link
Owner

ntoll commented Jan 12, 2016

Here's how to make it work:

git clone https://github.com/ntoll/microrepl.git
cd microrepl
sudo apt-get install python3-serial
python3 microrepl.py

However, I suggest this tool if not used - rather it's better to use, say, picocom like this:

sudo apt-get install picocom
picocom /dev/ttyACM0 -b 115200

Or even better, just use the REPL built into Mu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants