quitte74
Posts: 5
Joined: Mon Aug 13, 2018 1:40 pm

Controlling my Mindstorms ev3 via Python from Raspberry Pi

Mon Aug 13, 2018 7:40 pm

Hi all,

I want to make a simple Python program that is running on my Raspberry P3 b+ controlling my Lego MIndstorms EV3.

How do I get started? And how should I connect, via Bluetooth? Does someone have a sample script that I can use as a starting point?

Thanx in advance

User avatar
topguy
Posts: 4914
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Controlling my Mindstorms ev3 via Python from Raspberry Pi

Mon Aug 13, 2018 8:20 pm

Instructions for connecting EV3 to Windows indicate that the bluetooth is used as a serial connection so for tips on setting that up on the Pi, google "bluez rfcomm"

I'm not an expert on that hardware but some googling very quickly ended up with "ev3dev" which is a linux for the EV3 for development of software to run on the EV3. If the standard firmware has limited support for handling bluetooth ( or wifi ) communication maybe using this firmware gives you better control/features.

quitte74
Posts: 5
Joined: Mon Aug 13, 2018 1:40 pm

Re: Controlling my Mindstorms ev3 via Python from Raspberry Pi

Tue Aug 14, 2018 8:09 am

topguy wrote: Instructions for connecting EV3 to Windows indicate that the bluetooth is used as a serial connection so for tips on setting that up on the Pi, google "bluez rfcomm"
Thank you, I will do that.
topguy wrote: I'm not an expert on that hardware but some googling very quickly ended up with "ev3dev" which is a linux for the EV3 for development of software to run on the EV3. If the standard firmware has limited support for handling bluetooth ( or wifi ) communication maybe using this firmware gives you better control/features.
Yes I saw that. But I'd rather avoid installing that on the brick. The kids are programming too via the official MIindstorms software

Thank you for your answer.

User avatar
OutoftheBOTS
Posts: 662
Joined: Tue Aug 01, 2017 10:06 am

Re: Controlling my Mindstorms ev3 via Python from Raspberry Pi

Thu Aug 16, 2018 7:52 am

It really depends upon what your want to do.

EV3DEV is a linux OS that you put on an SD card and stick into the EV3 and it boots up on it and you can program it then in many different languages but most people use python as it tends to have the most advanced developed libraries fro EV3. This will allow you to program the EV3 brick in python but not sure about programming it from RPi.

I have a BrickPi3 hat for my RPi3 and it allows me to replace the EV3 brick with a RPi and the BrickPi hat. Then of course the RPi is controlling all the Lego components directly not the EV3 brick. See https://www.dexterindustries.com/brickpi/ The RPi is of course a much more powerful processor thna the EV3 brick and of course python is much more powerful language than EV3-G. The BrickPi3 hats are also stackable so if you need more ports u just add another hat :)

Return to “Python”