Skip to content

ev3dev + rpi3 + brickpi + python - how to setup ? #279

Closed

Description

@MikeDabrowski
  • ev3dev version: none
  • ev3dev-lang-python version: none
  • python version 2.7.6 and 3.4

I want to use ev3dev library on rpi3 and brickpi setup. I can't find any tutorial though. I do not have ev3 brick, just rpi3 and brickpi. Last month I tried to flash sd with image from ev3dev main site but for some reasons it couldn't boot so I abandoned it and focused on brickpi solutions. That solutions are completely unusable so I'm back to ev3dev.

Is it possible to use raspbian for robots and somehow install ev3dev library for python on my rpi3? If yes then how?

Activity

  1. dlech commented on Dec 23, 2016

    @dlech
    Member

    Did you edit config.txt on the SD card before booting? You have to enable BrickPi there and there are some special considerations for RPi 3 since the Bluetooth tries to use the same UART/serial port as the BrickPi by default.

  2. dlech commented on Dec 23, 2016

    @dlech
    Member

    Is it possible to use raspbian for robots and somehow install ev3dev library for python on my rpi3?

    You could, but it won't work because the ev3dev python library requires a hardware driver. If you are comfortable with compiling the driver (and possibly your own device tree) you could in theory make ev3dev stuff work using Raspbian for Robots.

  3. MikeDabrowski commented on Dec 23, 2016

    @MikeDabrowski
    Author

    Would it boot without configuring config.txt? I can't remember modifying that file. I don't and won't need bluetooth for my robot. Guess I'm gonna need to start again. Will following tutorial on http://www.ev3dev.org/docs/getting-started/ suffice? I can't quite grasp what ev3dev actually is - ev3 system or it also works on rpi?

  4. dlech commented on Dec 23, 2016

    @dlech
    Member

    Would it boot without configuring config.txt?

    It would boot, but you could not use the BrickPi.

    Will following tutorial on http://www.ev3dev.org/docs/getting-started/ suffice?

    Yes, it should. Be sure to look for the info/warning boxes about Raspberry Pi.

    I can't quite grasp what ev3dev actually is - ev3 system or it also works on rpi?

    It is a Debian Linux based operating system for LEGO MINDSTORMS and LEGO MINDSTORMS compatible devices. Since BrickPi and PiStorms are LEGO compatible, we have a Raspberry Pi version of the OS and there is also a BeagleBone cape called the EVB that is LEGO compatible, so we have a BeagleBone version of the OS.

  5. MikeDabrowski commented on Dec 23, 2016

    @MikeDabrowski
    Author

    It would boot, but you could not use the BrickPi.

    Then I must've done something else wrong. Mine didn't boot at all. Stuck in the middle. I'm finishing flash right now and will test it

  6. MikeDabrowski commented on Dec 23, 2016

    @MikeDabrowski
    Author

    It is booting almost 25minutes. Stuck on "Started Update UTMP about system runlevel changes" Green activity led is blinking. Two BrickPi blue led's are on. I have modified config.txt. Disabled BT (left commented) and enabled brickpi

  7. dlech commented on Dec 23, 2016

    @dlech
    Member

    The blue lights are a good sign. Have you tried making a network connection with ssh? I've never actually used an HDMI display with RPi, so I don't know what to expect there.

  8. MikeDabrowski commented on Dec 23, 2016

    @MikeDabrowski
    Author

    I'm afraid ssh wont work. I had fail on setting up network connection (wifi password not set for wpa suppl.) After 2h it is still in the same state. I will reflash using another tool and try again. Etcher said my card may be corrupted...

  9. MikeDabrowski commented on Dec 23, 2016

    @MikeDabrowski
    Author

    :) reflashed, botted and still stucks on UTMP

  10. dlech commented on Dec 23, 2016

    @dlech
    Member

    Etcher said my card may be corrupted...

    It is probably right. Do you have another card to try?

  11. MikeDabrowski commented on Dec 23, 2016

    @MikeDabrowski
    Author

    I sacrificed other card for that. Etcher said its ok.
    And uncommented this lines:
    dtoverlay=brickpi
    init_uart_clock=32000000
    dtoverlay=pi3-disable-bt

    Do I need to plug Ethernet cord ? Or should I place my wifi password somewhere on the card so it could load it during boot? Bit weird but maybe it will help.
    Well so far 2minutes stuck on UTMP

  12. dlech commented on Dec 23, 2016

    @dlech
    Member

    Do I need to plug Ethernet cord ?

    Yes, that is the best way to attach to start with.

    Or should I place my wifi password somewhere on the card so it could load it during boot?

    There is not currently a way to do this with ev3dev.

    Well so far 2minutes stuck on UTMP

    The Pi 3 boots in about 5 seconds, so no need to wait this long. I'm not really sure that it is stuck. Try ssh via Ethernet or press ALT+CTRL+F6 to try a different console.

  13. MikeDabrowski commented on Dec 23, 2016

    @MikeDabrowski
    Author

    Connectinv ethernet didnt help but after switching to console f6 i got logging screen
    Edit: I can log in. Does rpi image has inbuilt gui? Can I install one ?

  14. dlech commented on Dec 23, 2016

    @dlech
    Member

    OK, so you can log in as robot password maker and setup wifi with connmanctl.

  15. dlech commented on Dec 23, 2016

    @dlech
    Member

    Connectinv ethernet didnt help

    If your host computer is Windows, using hostname of ev3dev should work. on Mac/Linux ssh robot@ev3dev.local should connect.

  16. MikeDabrowski commented on Dec 23, 2016

    @MikeDabrowski
    Author

    Okay, I managed to do this all. I've set up /var/lib/connman/wifi.config to autoconnect to wifi at boot. Dont know if that works yet. Now I will try if nxt stuff works with python.

  17. MikeDabrowski commented on Dec 23, 2016

    @MikeDabrowski
    Author

    Huh so... running example led or motor from here gets me "device not connected" . And after rebooting and plugging in battery pack motors connected to B and C run continuously
    Do you have any validation script to make sure all installing was done correctly?

  18. dlech commented on Dec 23, 2016

    @dlech
    Member

    BrickPi motors will not run without using the BrickPi power connector. That is to say, back-powering the BrickPi from the RPi via USB or some other means is not supported. It sounds like the script work (at least partly) and left the motors running, which didn't actually start until you powered them.

    Also, please post your code if you would like more help with it.

  19. MikeDabrowski commented on Dec 24, 2016

    @MikeDabrowski
    Author

    Nxt motors connected to brick pi connected to rpi will only work if i power up brickpi with battery pack. Let me clarify: After first boot I opened python console and tried to run motor b. Didn't work (device not connected) after that I noticed I switched off battery so I switched it on. Script was not running and I was out of python console amd motors (both ) were running non stop. So I rebooted and switched battery on. Still running continuously. I will paste that script on Monday but it is described I that link I gave in previous post. I used python 3

  20. MikeDabrowski commented on Dec 26, 2016

    @MikeDabrowski
    Author

    LED.py:

    import ev3dev.ev3 as ev3
    ts = ev3.TouchSensor()
    while True:
            ev3.Leds.set_color(ev3.Leds.LEFT, (ev3.Leds.GREEN, ev3.Leds.RED)[ts.value()])
    

    motor.py:

    import ev3dev.ev3 as ev3
    m = ev3.LargeMotor('outB')
    m.run_timed(time_sp=3000, speed_sp=500)
    

    Files are located in home directory /home/robot
    Few seconds after powering on brickPi (with battery on) motors start tor run. I can't ssh before that point, nor run any script.

  21. ddemidov commented on Dec 26, 2016

    @ddemidov
    Member

    When you are on brickpi, you should import ev3dev.brickpi as ev3. BrickPI and EV3 have different leds and input/output port address names.

  22. MikeDabrowski commented on Dec 26, 2016

    @MikeDabrowski
    Author

    Okay, but why motors start to run on boot?

  23. ddemidov commented on Dec 26, 2016

    @ddemidov
    Member

    Sorry, that I have no idea about 🐑

  24. MikeDabrowski commented on Dec 26, 2016

    @MikeDabrowski
    Author

    I just reflashed card and booted it up with battery power on. I got few lines like this, which I've not seen before:
    lego-port port1: Registered 'ttyAMA0:S2' on 'ttyAMA0'

    But motors still run cont.

  25. MikeDabrowski commented on Dec 26, 2016

    @MikeDabrowski
    Author

    I also got "Started BrickPi Line Discipline" is that predefined program ? Maybe that is why it turns motors?

  26. dlech commented on Dec 27, 2016

    @dlech
    Member

    "Started BrickPi Line Discipline"

    This is the ev3dev hardware driver for BrickPi, so this message is expected.

    I'm not sure why the motors would be running continuously at boot though. Please open an new issue at https://github.com/ev3dev/ev3dev/issues and list the exact model of Raspberry Pi and BrickPi you are using as well as the image file that your are using and I will try to reproduce the problem.

    If you are not completely removing all power when you reboot, I imagine that the BrickPi is not being rebooted and it is in a bad state when the Raspberry Pi is rebooted.

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