Skip to content

How to get a motor to run on a Brickpi3 with ev3dev with Python3? #525

Closed

Description

@coffeedood
  • ev3dev version: Stretch Beta raspberry pi model 2/3
  • ev3dev-lang-python version: INSERT ALL VERSIONS GIVEN BY dpkg-query -l python3-ev3dev* HERE

I have been trying to figure out how to get a Brickpi3 to work with ev3dev. I notice when I first turn it on the yellow LED is not blinking at all but is just solid yellow (is it not supposed to blink when you run ev3dev?). I have cloned the Brickpi3 repository into both the robot and the home folder. I am able to establish an ssh connection with:
sudo ssh robot@ev3dev.local
My main question is how do you run a motor on a Brickpi3 running ev3dev? I consistently get an error message saying the motor is not connected to in1. What should I do next? I guess I'd like a list of steps of how to get a simple EV3 Large Motor to run on a Brickpi3 running ev3dev.

Activity

  1. WasabiFan commented on Sep 19, 2018

    @WasabiFan
    Member

    With recent ev3dev-stretch images, you shouldn't need to install any extra software or clone additional repos. Without seeing your code I can't tell what exactly is wrong, but it seems to be something with port names. Please see our README for a getting started guide: https://github.com/ev3dev/ev3dev-lang-python#usage

    As shown there, running a motor should look like:

    m = LargeMotor(OUTPUT_A)
    m.on_for_rotations(SpeedPercent(75), 5)
  2. coffeedood commented on Sep 20, 2018

    @coffeedood
    Author

    thank you so much. It seems crazy but yeah I was working a long time trying to figure out something that simple. I guess now I am trying to get stuff like this to work with two Brickpi3's stacked on top of eachother. Do you know what the python code would be for multiple brickpi3's stacked on top of eachother to run a motor on the 2nd one?

  3. dlech commented on Sep 20, 2018

    @dlech
    Member

    You need to configure the multiple BrickPi3s in config.txt

    https://github.com/ev3dev/docker-library/blob/master/ev3dev-stretch/layers/rpi-common/boot/flash/config.txt#L27

    Additional ports need to use 'spi0.1:ME' instead of OUTPUT_A. The last letter (E in this case) is the name of the port where the first BrickPi3 is A, B, C or D, the second is E, F, G, or H and so on.

  4. coffeedood commented on Sep 20, 2018

    @coffeedood
    Author

    Hello, so I think I'm close to getting the 2nd brickpi3 to work. But yeah I am a little confused by your statement above.
    Additional ports need to use 'spi0.1:ME' instead of OUTPUT_A. The last letter (E in this case) is the name of the port where the first BrickPi3 is A, B, C or D, the second is E, F, G, or H and so on."
    so how do you "use 'spi0.1:ME' instead of OUTPUT_A"?
    I typed this into python3 and I get this error.

    from ev3dev.brickpi3 import *
    m = LargeMotor(OUTPUT_E)
    Traceback (most recent call last):
    File "", line 1, in
    NameError: name 'OUTPUT_E' is not defined

    when i type in spi0.1:ME I get

    from ev3dev.brickpi3 import *
    m = LargeMotor(spi0.1:ME)
    File "", line 1
    m = LargeMotor(spi0.1:ME)
    ^
    SyntaxError: invalid syntax

    I guess I mostly just need to know how to "use 'spi0.1:ME' instead of OUTPUT_A"

  5. dlech commented on Sep 21, 2018

    @dlech
    Member

    Delete one and type the other in its place. Like this:

    m = LargeMotor('spi0.1:ME')
    
  6. coffeedood commented on Sep 21, 2018

    @coffeedood
    Author

    sweet! Thanks again! Yeah I will probably have more questions soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions