Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BrickPi3 example #728

Open
dlech opened this issue Mar 18, 2020 · 9 comments · Fixed by ev3dev/ev3dev-lang-python-demo#50 · May be fixed by #731
Open

BrickPi3 example #728

dlech opened this issue Mar 18, 2020 · 9 comments · Fixed by ev3dev/ev3dev-lang-python-demo#50 · May be fixed by #731

Comments

@dlech
Copy link
Member

dlech commented Mar 18, 2020

  • 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.

@WasabiFan
Copy link
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
Copy link
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
Copy link
Member Author

dlech commented Mar 19, 2020

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
Copy link
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
Copy link
Member

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

@dlech
Copy link
Member Author

dlech commented Mar 19, 2020

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
Copy link
Member Author

dlech commented Mar 19, 2020

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
Copy link
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
Copy link
Member Author

dlech commented Mar 23, 2020

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
Labels
None yet
Projects
None yet
2 participants