Robotics StackExchange | Archived questions

Issues with running ROS Indigo and using the pigpio I2C library

I am running ROS Indigo on a Raspberry Pi 2 with Raspbian Jessie. I need to use PWM to control some motors and I2C to communicate with a fuel gauge. I am utilizing the pigpio library, since I can start the pigpio daemon with sudo and not have to worry about needing root access to use GPIO pins.

I wrote individual scripts to perform these functions, and they both produce the expected output. When I call the functions inside ROS, the PWM works fine, but the I2C comms fail.

If I remove the I2C code from the ROS node, and run the test script, I get the expected output until I start ROS. Even after killing ROS, the I2C comms do not return to normal. Any ideas?

Never mind. The pinout diagram I was looking at for the Pi 2 had a mistake. I'm using pin 13 on the Pi as an alert signal from the fuel gauge. This is GPIO 27, but the diagram said it was GPIO 2 which is actually the SDA line for I2C. So, when I set GPIO 2 as an input I killed I2C. I am now using the correct pin number, and everything works as expected.

Asked by aland_t on 2016-05-29 13:55:02 UTC

Comments

Suggestion: post your last edit as an answer and accept your own answer. That way it is clear that this question has been answered.

Asked by gvdhoorn on 2016-05-29 14:45:08 UTC

I decided to close this, stumbling upon it, as the answer is actually in the question, as pointed out above.

Asked by mgruhler on 2019-12-04 04:56:42 UTC

Answers