0
$\begingroup$

Rosanswers logo

Can some one help me find the correct instructions for installing python with GPIO on my Pi. I'm running ubuntu and I just finally got ROS to install and really don't want to screw it up.... Right now if I run a python script GPIO does not work.


Originally posted by swilker on ROS Answers with karma: 51 on 2016-01-09

Post score: 0


Original comments

Comment by nickw on 2016-01-09:
What have you installed so far. What version of ubuntu are you using. You say it doesn't work, can you provide an example of what you do and what happens - do you get errors - if you do please post them

Comment by NEngelhard on 2016-01-09:
How do you talk to the Pins? I'd bet on missing privileges. I'm using the wiringPi library that provides ways to access to Pins also as normal user.

Comment by swilker on 2016-01-09:
I've installed a button on the Pi-2. Example at: http://iot-projects.com/index.php?id=raspberry-pi-shutdown-button, worked fine on my Raspbian copy. When I run it on my Ubuntu Ros version I get Import Error no Module named RPi.GPIO the basic python commands work... I believe I have Ubuntu 13.10

Comment by swilker on 2016-01-09:
Tried this, no luck http://askubuntu.com/questions/295937/how-to-install-python-3-2-in-ubuntu-13-04

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It works on raspbian because that has raspberry pi specific things like RPI.GPIO already installed. You will need to install that yourself on a more generic ubuntu system.

This is something that I think you will get more help from asking on the raspberry pi forums as it is a raspberry pi issue, not a ROS one. For RPI.GPIO you need device tree support enabled in ubuntu, I don't know whether it is in 13.10 - there is a post here about getting it working with ubuntu 14.04 that might help https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=113014&p=773725 http://askubuntu.com/questions/621134/gpio-on-raspberry-pi

All the examples I have seen use 14.04 and upwards, and ROS support is better on 14.04. Is there a reason for using 13.10 (if that is what you have) ?

version 15.10 here https://ubuntu-mate.org/raspberry-pi/ comes with RPI.GPIO pre-installed


Originally posted by nickw with karma: 1504 on 2016-01-10

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by nickw on 2016-01-10:
I was getting mixed up - you need device tree support for the newer underlying mechanism that means you can use gpio with being root.

Comment by swilker on 2016-01-10:
Ok Yes spent the 2 hours plus redoing everything in Ubuntu 14.04, that's not the solution. 15.10 is made for Intel x86 and AMD64 the Pi is CPU: 900 MHz quad-core ARM Cortex A7 not sure they are compatible. I'm thinking there is no solution. Perhaps Raspbian with ROS... shoot!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.