1

In trying to debug a project, I want to verify that my rpi is recognizing the connection of the jumper cable to the GPIO pin. I can see with my eyes that it is connected. However, I want to rule out any connection problems that may not be able to be seen. (Please assume for purposes here that my suspicion of the connection is reasonable.)

Is there a command that will tell whether or not something is connected to a certain pin and if that something is, in some basic sense, functioning correctly?

If not, is there any other simple way (python one-liner, etc.) to verify that a connection has been made properly?

1

Leave one end of the jumper wire connected to the GPIO.

Connect the other end of the jumper to 3V3 and check it reads back as high (1). Then connect the other end of the jumper to ground and check the GPIO reads back as low (0).

Using my pigs utility the procedure would be (assuming GPIO4).

pigs m 4 r # set GPIO4 as input
pigs r 4 # read GPIO4

Alternatively connect the other end of the jumper to another GPIO and set the other GPIO as a high then low output. That should be reflected on the input GPIO.

Using pigs the procedure would be (assuming writing from GPIO17 to GPIO4).

pigs m 4 r # set GPIO4 as input
pigs m 17 w # set GPIO17 as output
pigs w 17 1 # write 1 to GPIO17
pigs r 4 # read GPIO4
pigs w 17 0 # write 0 to GPIO17
pigs r 4 # read GPIO4
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.