You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ev3dev + rpi3 + brickpi + python - how to setup ? #279
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?
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.
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.
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?
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.
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
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.
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...
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
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.
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 ?
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.
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?
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.
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
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.
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'
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.
Activity
dlech commentedon Dec 23, 2016
Did you edit
config.txton 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.dlech commentedon Dec 23, 2016
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.
MikeDabrowski commentedon Dec 23, 2016
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?
dlech commentedon Dec 23, 2016
It would boot, but you could not use the BrickPi.
Yes, it should. Be sure to look for the info/warning boxes about Raspberry Pi.
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.
MikeDabrowski commentedon Dec 23, 2016
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
MikeDabrowski commentedon Dec 23, 2016
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
dlech commentedon Dec 23, 2016
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.
MikeDabrowski commentedon Dec 23, 2016
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...
MikeDabrowski commentedon Dec 23, 2016
:) reflashed, botted and still stucks on UTMP
dlech commentedon Dec 23, 2016
It is probably right. Do you have another card to try?
MikeDabrowski commentedon Dec 23, 2016
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
dlech commentedon Dec 23, 2016
Yes, that is the best way to attach to start with.
There is not currently a way to do this with ev3dev.
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.
MikeDabrowski commentedon Dec 23, 2016
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 ?
dlech commentedon Dec 23, 2016
OK, so you can log in as
robotpasswordmakerand setup wifi withconnmanctl.dlech commentedon Dec 23, 2016
If your host computer is Windows, using hostname of
ev3devshould work. on Mac/Linuxssh robot@ev3dev.localshould connect.MikeDabrowski commentedon Dec 23, 2016
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.
MikeDabrowski commentedon Dec 23, 2016
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?
dlech commentedon Dec 23, 2016
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.
MikeDabrowski commentedon Dec 24, 2016
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
MikeDabrowski commentedon Dec 26, 2016
LED.py:
motor.py:
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.
ddemidov commentedon Dec 26, 2016
When you are on brickpi, you should
import ev3dev.brickpi as ev3. BrickPI and EV3 have different leds and input/output port address names.MikeDabrowski commentedon Dec 26, 2016
Okay, but why motors start to run on boot?
ddemidov commentedon Dec 26, 2016
Sorry, that I have no idea about 🐑
MikeDabrowski commentedon Dec 26, 2016
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.
MikeDabrowski commentedon Dec 26, 2016
I also got "Started BrickPi Line Discipline" is that predefined program ? Maybe that is why it turns motors?
dlech commentedon Dec 27, 2016
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.