Skip to content

BrickPi+ EV3motor, sensors python cannot connect  #282

@jhconning

Description

@jhconning

System information:

  • Hardware

    • RaspberryPi 3 Model B
    • BrickPi+ (with battery pack on)
    • EV3 motors and sensors
  • I installed ev3dev using image: ev3dev-jessie-rpi2-generic-2016-12-21.zip

  • kernel: 4.4.32-17-ev3dev-rpi2

  • My host computer is running: Windows10

  • I am connecting using: ethernet (SSH)

  • ev3dev-lang-python version: python 3.4.2

My changes to config.txt (only enabled options):

dtoverlay=brickpi
init_uart_clock=32000000
dtparam=brickpi_battery=okay
dtoverlay=pi3-disable-bt

My issue:

I cannot control motors using ev3dev.brickpi methods even though I can control them via command line using examples from Using the Tacho-Motor Class

For example the following:

import ev3dev.brickpi as ev3
m = ev3.LargeMotor('outB')
m.connected

produces output False. I get 'not connected' errors when I try other methods.

As mentioned, I can control the same LargeMotor on port B directly from the command line as described here http://www.ev3dev.org/docs/tutorials/tacho-motors/

The motors appear to be assigned like this:

robot@ev3dev:~$ for f in /sys/class/tacho-motor/*; do echo -n "$f: "; cat $f/address; done
/sys/class/tacho-motor/motor0: ttyAMA0:MA
/sys/class/tacho-motor/motor1: ttyAMA0:MB
/sys/class/tacho-motor/motor2: ttyAMA0:MC
/sys/class/tacho-motor/motor3: ttyAMA0:MD

From reading issues #279 and #115 I suspect that because I'm on a BrickPi (no autodetection of sensors... and perhaps also motors) I may have to somehow tell python what ports/devices to use manually. Those discussions talk of using the LegoPort class but from the documentation and with my pretty limited understanding I cannot find a simple clear example to guide me on how to do just that for motors. I have the motors and sensors that came with the retail Lego EV3 kit. Any suggestions about how to proceed? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions