Raspberry pi Megapi, not working


Hi, I’m trying to control to control a mega pi through a raspberry pi via python.

I’m trying to activate the encoder motors from the raspberry pi so I can setup a websocket server where it listens to and then use that as a control panel, but the the motors never activate.

I have already updated the firmware, it works via the bluetooth from my phone.

Its connected via the included jumper thingy (the black rectangle that you put on the raspberry pi pins and into the bottom of the mega pi), but i have also tried it via a usb cable with the same results

In the rpi i have this python script atm
i run it via sudo python3 filename.py
non sudo has the same results

from megapi import *

def onForwardFinish(slot):

def onBackwardFinish(slot):

if __name__ == '__main__':
	bot = MegaPi()
	while 1:

and it outputs this

[GCC 8.3.0]
init MegaPi
<megapi_python3.mSerial object at 0x76128db0>


If you are having trouble using these libraries and packages I suggest to write your own “easy” code.
What I did was look at example sketches from makeblock to control the motors and set-up a serial connection through which the bot will receive it’s commands.
In Python I use Pyserial to establish a serial connection to the bot.

I will post my code in the next couple of days on Github.

Let me know if you need help or if you succeeded. If you do need help tell me something more about your project and your ultimate goal. Often there are many ways to Rome…


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.