Raspberry Pi 3 B+ connection configuration


#1

I am trying to install a Raspberry Pi 3 B+ onto my Makeblock Ultimate 2.0 MegaPi 2560 board as shown here.


image
image
image
image

I am following the instructions from …



http://learn.makeblock.com/python-for-megapi/

https://scribles.net/disabling-bluetooth-on-raspberry-pi/
and
http://download.makeblock.com/Instruction.zip

I have and learned about . . .
Linux raspberrypi 4.14.79-v7+ #1159 Sun Nov 4 GM 2018 armv7l GNU/Linux
Python 3.5.3 Sep 27 2018 GCC 6.3.0 20170516 on Linux
GNU nano 2.7.4
Minicom 2.7 Apt 22 2017

I am trying to run the GitHub sample program encoderMotorRun.py! The problem that I am having is that I get the error message
“ImportError: No module named ‘megapi’

I have followed the instructions and done …
enable_uart=1
dtoverlay=pi3-disable-bt
sudo systemctl disable hciuart
sudo pip install megapi

The sample RPi 3 Python code follows . . .
from megapi import *
if name == ‘main’:
bot = MegaPi()
bot.start()
bot.encoderMotorRun(4,0);
sleep(1);
while 1:
bot.encoderMotorRun(4,-200);
sleep(5);
bot.encoderMotorRun(4,0);
sleep(5);

And then I get . . .
“ImportError: No module named ‘megapi’
All of the reading did not show me the exact solution to my problem!

PS And by the way, What program should be running in the MegaPi?

1/6/2019
More reading has reminded me that there is Python2 and Python3. Apparently Python2 packages are installed with the pip command and Python3 packages with the pip3 command. I have both Python2 and Python3, but the default is Python3. So I did

sudo pip3 install megapi

Which leaves me with the question
"Is the megapi library written in Python2 or Python3 ?


#2

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