So, basically, I've been trying to get my raspberry pi to get the room temperature from a DS18B20 1-wire temperature sensor.
I've read only GPIO 4 is capable of this, and I think for some reason GPIO 4 is not working.
I've tried connecting the sensor there, it is connected as it should, I've been checking the connections since I connected the sensor and couldn't read it...
I've tried connecting an led (using the proper resitor) to GPIO 4 and using wiringpi to turn it on and off, but I got nothing...
My question is, is there a way I can know for sure if the pin is okay and it is just some software issue?
NOTE: I don't really know how this is supposed to work, but when I do:
~ $ cd /sys/class/gpio ~ $ ls
What I get is:
export gpio17 gpio18 gpio21 gpio22 gpio23 gpio24 gpio25 gpiochip0 unexport
The GPIO 4 doesn't show up... Now, I don't know if only the pins in use show, but if that's the case, none of the above should show, because i'm not using any pins right now...
EDIT: I have connected the DS18B20 like it says in the datasheet, like in this picture:
For the modules I have loaded:
modprobe w1-gpio modprobe w1-therm
Superuser privileges, obviously.
I also tried:
modprobe w1-gpio pullup=1 modprobe w1-therm super_pullup=1
When I try:
sudo echo "4" > /sys/class/gpio/export
echo: write error: Device or resource busy
Just tried the pigpio test program and the results are:
Skipped non-user gpios: 0 1 28 29 30 31 Tested user gpios: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Failed user gpios: None
I assume it is supposed to skip those non-user pins, right? Other than that I have no doubts about all the pins working... Which intrigues me, because I still can't read temperature...
I'm at work, I will take the pi home and test it there again with a simple LED turning on and OFF, if I discover anything, I will post it here...
I've been experimenting a lot with the pi, it is probably cluttered with stuff I wanted to test but never really used, do you think it would be wise to try a fresh Raspbian install?