Skip to content

BrickPi3 example #728

@dlech

Description

@dlech
Member
  • ev3dev version: PASTE THE OUTPUT OF uname -r HERE
  • ev3dev-lang-python version: INSERT ALL VERSIONS GIVEN BY dpkg-query -l {python3,micropython}-ev3dev* HERE

We get a fairly steady stream of people trying to use BrickPi3 and failing because it cannot automatically detect sensors and motors. It would be super-helpful if the docs here had an example that people could copy and paste to get started.

Despite the constant questions, I still cannot find any known working example in any of the ev3dev GithHub issues.

Activity

WasabiFan

WasabiFan commented on Mar 18, 2020

@WasabiFan
Member

Good call. I don't personally have a BrickPi but I can certainly try to write some code if someone else can test it.

WasabiFan

WasabiFan commented on Mar 19, 2020

@WasabiFan
Member

I'm trying to test manually setting port modes on my EV3. This works with tacho motors, but when I have a US sensor connected I see the following behavior:

robot@ev3dev:~$ cat /sys/class/lego-port/port0/address   
ev3-ports:in1
robot@ev3dev:~$ echo ev3-uart > /sys/class/lego-port/port0/mode        
robot@ev3dev:~$ echo lego-ev3-us > /sys/class/lego-port/port0/set_device 
-bash: echo: write error: Operation not supported

Is there something obvious I'm doing wrong here, or do you have suggestions for where I should look? This should be supported on the EV3, right?

ev3dev-stretch-ev3-generic-2019-05-29
Kernel version:     4.14.117-ev3dev-2.3.4-ev3
dlech

dlech commented on Mar 19, 2020

@dlech
MemberAuthor

Since EV3 can automatically detect UART sensors, it doesn't let you pick a different one. BrickPi3 and PiStorms (and mindsensors EV3 sensor multiplexer) on the other hand can't automatically detect sensors, so you have explicitly tell them which sensor is attached.

WasabiFan

WasabiFan commented on Mar 19, 2020

@WasabiFan
Member

Ah, got it -- I didn't realize it wasn't supported on the EV3 ports. I opened a PR on the python demo repo with a sample program; would you be able to test it?

WasabiFan

WasabiFan commented on Mar 19, 2020

@WasabiFan
Member

I'll link to this example in docs and maybe quote some of it too.

dlech

dlech commented on Mar 19, 2020

@dlech
MemberAuthor

I opened a PR on the python demo repo with a sample program; would you be able to test it?

Yeah, I'll try it tomorrow.

dlech

dlech commented on Mar 19, 2020

@dlech
MemberAuthor

Perhaps another tip for the documentation, if you get this error...

Starting: brickrun --directory="/home/robot/brickpi3" "/home/robot/brickpi3/main.py"
----------
Traceback (most recent call last):
  File "/home/robot/brickpi3/main.py", line 11, in <module>
    from ev3dev2.motor import OUTPUT_A, LargeMotor, SpeedPercent
  File "/usr/lib/python3/dist-packages/ev3dev2/motor.py", line 77, in <module>
    raise Exception("Unsupported platform '%s'" % platform)
Exception: Unsupported platform 'None'
----------
Exited with error code 1.

Then you probably forgot to edit config.txt.

WasabiFan

WasabiFan commented on Mar 23, 2020

@WasabiFan
Member

@dlech Do you have any particular recommendations for where that should go? I am tempted to put it in our FAQ but no one reads the FAQ 😢

dlech

dlech commented on Mar 23, 2020

@dlech
MemberAuthor

The more places the better 😄

Maybe add some links to the FAQ from different places? e.g. at the top of the sensor docs, say "If you are using BrickPi3, also see the FAQ"

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

      Participants

      @dlech@WasabiFan

      Issue actions

        BrickPi3 example · Issue #728 · ev3dev/ev3dev-lang-python