dj_janker
Posts: 59
Joined: Thu Jan 08, 2015 6:15 pm

Re: DHT11 readings onto a web page!

Wed May 27, 2015 3:48 pm

danjperron wrote:Put a sleep of 30 second between readings . It will be more easier to debug. Don't forget a minimum of 2 seconds between readings.

In your jeedom() function add a print for req and value. You will see if you send the right thing.
Like this?

Code: Select all

 # Ajout pour Jeedom
   import urllib
   def Jeedom(id, value):
     base = "https://192.168.1.20/jeedom/core/api/jeeApi.php?api="
     key = "tbqnp35fitq07tqf08ch"
     type = "virtual"
     req = base + key + "&type=" + type + "&id=" + str(id) + "&value=" + str(value)
     urllib.urlopen(req)
     print "Req Virtuel : " + req
   id = 1035
   value = s.temperature()
   Jeedom(print(req,value))
The result:

Code: Select all

root@raspberrypi:~# python DHT22_.py
  File "DHT22_.py", line 299
    Jeedom(print(req, value))
               ^
SyntaxError: invalid syntax
root@raspberrypi:~#

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Wed May 27, 2015 4:59 pm

The best way will be to left the DHT22.py alone and create a new script.

This way the DHT22.py will be an import . A class object and you could build with it.

Create a new script in the same directory where DHT22.py is.
Be sure that it is the original DHT22.py file.

nano readDHT.py

Code: Select all

#!/usr/bin/python
import pigpio
import DHT22
import time
import urllib

# Intervalle minimal est de deux secondes entre chaque prise de donnee
INTERVAL = 3
RETRY = 3

# Le DHT capteur est sur quelle broche
SENSOR_GPIO = 22

#est-ce un DHT11 ou DHT22
ISDHT11 =True

# Creation de l'objet pigpio
pi=pigpio.pi()

# Creation du capteur DHT22
probe = DHT22.sensor(pi,SENSOR_GPIO,DHT11=ISDHT11)

# Fonction pour lire la capteur avec la librairie DHT22
# retourne [humidity temperature] 
# retourne None si erreur.
def readDHT_sensor():
  global pi
  global probe
  # Nombre d'essaie si erreur
  for loop in range(RETRY):

    # Attendre le temps minimal de stabilisation
    if loop!=0:
      time.sleep(INTERVAL)
    # Enclenchement du transfer

    probe.trigger()

    # Attendre pour la fin du transfer
    time.sleep(0.2)
    # lire les donnees
    temperature = probe.temperature()
    humidity = probe.humidity()
    if temperature == (-999):
      continue
    if humidity == (-999):
      continue
    return [temperature,humidity]
  # Ok le nombre d'essai pour erreur a ete depasse Retournons None
  return [None , None]

def Jeedom(id, value):
   base = "https://192.168.1.20/jeedom/core/api/jeeApi.php?api="
   key = "xxxx"
   type = "virtual"
   req = base + key + "&type=" + type + "&id=" + str(id) + "&value=" + str(value)
   print "Req Virtuel : " + req + " Value : {}".format(value)
   urllib.urlopen(req)

##### MAIN #######

# Lire le capteur la premiere fois.  Les valeurs sont possiblement pas bonnes.
readDHT_sensor()

# Lire le capteur apres le delai minimum.
time.sleep(INTERVAL)
sensorData = readDHT_sensor()

if sensorData[0]!=None:
  print("temp:{} Celsius  humidity:{}%".format(sensorData[0],sensorData[1],))
  #envoi des donnees sur le serveur
  Jeedom(1035,sensorData[0])
  Jeedom(1036,sensorData[1])
else:
  print("Unable to read sensor")
The readDHT.py script will only run once. I didn't put an inside loop but it will read the sensor twice and toss the first reading .

This is how I used the DHT22.py with my readTemp.py script.

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Wed May 27, 2015 5:31 pm

@dj_janker

I'm downloading Jeedom image for the Raspberry pi .

It supports MQTT!

I will see how it behaves with my RF24 sensors.

I'm from Québec so the french is not an issue.

dj_janker
Posts: 59
Joined: Thu Jan 08, 2015 6:15 pm

Re: DHT11 readings onto a web page!

Wed May 27, 2015 6:47 pm

You are my idol!
Amazing work !!! :D :D :D :D :D :D
Thank you for your help and for all your time .
You do not know how I appreciate ...

A question , you must pass the script to crontab -e so that it starts with each restart of the Rpi ?
I would like include a infinite loop that make a mesure every 30 min, for example.
Any idea?

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Wed May 27, 2015 7:12 pm

Yes use crontab

First make the script runable

Code: Select all

chmod +x readDHT.py
and put a line into crontab

Code: Select all

sudo crontab -e
*/30 * * * *     /home/pi/readDHT.py

Subternal
Posts: 3
Joined: Wed May 27, 2015 7:45 pm

Re: DHT11 readings onto a web page!

Fri May 29, 2015 5:40 am

So I've been following along with your phenomenal writeup on how to get sensor (DHT22) readings onto a webpage. But as a noob, I've run into some issues. I've managed to get the sensor to read (DHT22.py) and with your readtemp.py scripts. The readtemp script does get a reading but leaves me with "watchdog errors". Was hoping some one could gimme some advice

here's my code (only slightly modified)

Code: Select all

#!/usr/bin/python
import pigpio
import sys
sys.path.append('/home/pi/pigpio_dht22')
import DHT22
import time
import os
import sys
import datetime
import subprocess
import shlex

# Intervals of about 2 seconds or less will eventually hang the DHT22.
INTERVAL=3
RETRY = 3
SENSOR_GPIO = 4
ISDHT11 =False
Valid=False

pi=pigpio.pi()
probe = DHT22.sensor(pi,4)



#Function to read cpu temperature
def readCpuTemperature():
   fichier = open("/sys/class/thermal/thermal_zone0/temp","r")
   texte =  fichier.readline()
   fichier.close()
   return  (float(texte)/1000.0)




#read the DHT22/11 Sensor at corresponding pin
#return None if it can't
#return [humidity temperature]

def readDHT_sensor():
  global pi
  global probe
  #retry at least RETRY times if something wrong
  for loop in range(RETRY):

    #put a minimum of interval stabilization 
    if loop!=0:
      time.sleep(INTERVAL)   

    #start transfer
    #Be aware that the reading will be from the last conversion
    #It is wise to read it twice and keep the last one
  
    probe.trigger()

    #wait for completion
    time.sleep(0.2)

    temperature = probe.temperature()
    humidity    = probe.humidity()

    if temperature == (-999):
      continue

    if humidity == (-999):
      continue

    return [temperature,humidity]

  #if we are here it is because with retry and it didn't work
  #just return None
  return [None , None]




##### MAIN #######


#read sensor once to capture the current temp
readDHT_sensor()

#read sensor again but now keep the data
time.sleep(INTERVAL)
sensorData = readDHT_sensor()
cpuTemp = readCpuTemperature()

now = datetime.datetime.now()

webdata = "/webdata/"


#put current value into a file
def TempS(value):
  if value == None :
    return "---"
  return value

try:
  file = open(webdata+"CurrentData.txt","w")
  file.write("{}\t{}\t{}\t{}\n".format(now,TempS(cpuTemp),TempS(sensorData[0]),TempS(sensorData[1])))
  file.close()
except:
  pass


########rddtool 

def Validate(value):
  if value == None:
    return ":U"
  else:
    return ":{}".format(value)

#create text string to insert data

rdata = "N" + Validate(cpuTemp) + Validate(sensorData[0]) + Validate(sensorData[1])

#now let insert it into the rddtool data

fileRrdtool = "/home/pi/temperatures.rrd"

subprocess.Popen(["/usr/bin/rrdtool","update",fileRrdtool,rdata])

#and now let's extract data to create data file for the web page

def rrdExport(start , step , sortieXML):
  texte = "rrdtool xport -s {0} -e now --step {1} ".format(start, step)
  texte += "DEF:a={0}:th_cpu:AVERAGE ".format(fileRrdtool)
  texte += "DEF:b={0}:th_dht22:AVERAGE ".format(fileRrdtool)
  texte += "DEF:c={0}:hm_dht22:AVERAGE ".format(fileRrdtool)
  texte += "XPORT:a:""th_cpu"" "
  texte += "XPORT:b:""th_dht22"" "
  texte += "XPORT:c:""hm_dht22"" "

  fileout = open(webdata+sortieXML,"w")
  args = shlex.split(texte)
  subprocess.Popen(args, stdout=fileout)
  fileout.close()


# ok extact 3 hours data
rrdExport("now-3h",300, "temperature3h.xml")

#ok 24 hours
rrdExport("now-24h",900, "temperature24h.xml")

#ok 48 hours
rrdExport("now-48h",1800, "temperature48h.xml")

#ok 1 week
rrdExport("now-8d",3600, "temperature1w.xml")

#ok 1 month
rrdExport("now-1month",14400, "temperature1m.xml")

#ok 3 month
rrdExport("now-3month",28800, "temperature3m.xml")

#ok 1 year
rrdExport("now-1y",43200, "temperature1y.xml")



if sensorData[0]!=None:
  print("temp:{} Celsius  humidity:{}%".format(sensorData[0],sensorData[1],))
else:
  print("Unable to read sensor")


#probe.cancel()
pi.stop()
but this is the error I get:

Code: Select all

udo python readtemp1.py
temp:21.7 Celsius  humidity:33.0%
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/home/pi/DHT22.py", line 238, in cancel
    self.pi.set_watchdog(self.gpio, 0)
  File "/usr/local/lib/python2.7/dist-packages/pigpio.py", line 1395, in set_watchdog
    self.sl, _PI_CMD_WDOG, user_gpio, int(wdog_timeout)))
  File "/usr/local/lib/python2.7/dist-packages/pigpio.py", line 791, in _pigpio_command
    sl.s.send(struct.pack('IIII', cmd, p1, p2, 0))
AttributeError: 'NoneType' object has no attribute 'send'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/home/pi/DHT22.py", line 238, in cancel
    self.pi.set_watchdog(self.gpio, 0)
  File "/usr/local/lib/python2.7/dist-packages/pigpio.py", line 1395, in set_watchdog
    self.sl, _PI_CMD_WDOG, user_gpio, int(wdog_timeout)))
  File "/usr/local/lib/python2.7/dist-packages/pigpio.py", line 791, in _pigpio_command
    sl.s.send(struct.pack('IIII', cmd, p1, p2, 0))
AttributeError: 'NoneType' object has no attribute 'send'
the DHT22 script is the same only changed for pin 4 instead of 22. Any advice? The webpage also works but no data is present, I assume because of the errors


****Update**** There IS data on the webpage now (guess I didn't wait long enough. So its seems to be functional but still have the errors

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Fri May 29, 2015 11:29 am

Which pigpio DHT22 version are you using?

You have a "sys.path.append('/home/pi/pigpio_dht22')" but the code use /home/pi/DHT22.py.
Is it what you want?
If you want to run the DHT22.py script from pigpio_dht22 you should remove the DHT22.py from /home/pi

The code error looks like to be from /home/pi/DHT22.py python script library? (That is where the error is from)

It is possible that you have a time out from your dht22 sensor.

if you run the DHT22 python script for a long time does it reports an error.

Just run it for a long time !

Code: Select all

sudo python DHT22.py
Be sure that you are running the correct DHT22.py. ( '/home/pi' or '/home/pi/pigpio_dht22' folder)

P.S. Python will look at the current directory first and after it will check the PATH.

Daniel

Subternal
Posts: 3
Joined: Wed May 27, 2015 7:45 pm

Re: DHT11 readings onto a web page!

Sat May 30, 2015 12:54 am

Well I thought it was the new version of DHT22.py. I downloaded it from the links in this write-up. The script was actually changed and I removed the 'sys.path.append' line. Now it just reads "import DHT22", however the error is still the same. (I dont remember why I had that sys.path.append in there...)

I've ran the DHT22.py script for over 200 lines...no hangups and steady readout. and by steady I mean consistent within a few degrees +/- 2. I just cant figure out the rest of the error

samip537
Posts: 32
Joined: Sat Aug 02, 2014 5:06 pm
Location: Turku, Finland

Re: DHT11 readings onto a web page!

Wed Jun 03, 2015 4:26 pm

I was wondering that as the Pi is storing the data for the readings to /webdata which is inside RAM. How long can it be without power without the data being corrupted/decated?

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Wed Jun 03, 2015 5:09 pm

All depends on how many process write to the sd cards.

This is why I wrote the dynamic webpage into ram. This way I don't use the SD card.

My first trial was on my pond temperature controller. I use pratically the same setup with 5 DS18B20 sensors. But I mount the SD card read only. The /var was on ramdrive also and every day the message log was clear. It ran for two full winters without any problem! Last winter I did'nt instal the Pi and I lost my fish (;-. They froze and died.


B.T.W. If you remove the power , any folder wich are mount "tmpfs" will be clean(empty) on power up.

samip537
Posts: 32
Joined: Sat Aug 02, 2014 5:06 pm
Location: Turku, Finland

Re: DHT11 readings onto a web page!

Wed Jun 10, 2015 5:29 pm

danjperron wrote:All depends on how many process write to the sd cards.

This is why I wrote the dynamic webpage into ram. This way I don't use the SD card.

My first trial was on my pond temperature controller. I use pratically the same setup with 5 DS18B20 sensors. But I mount the SD card read only. The /var was on ramdrive also and every day the message log was clear. It ran for two full winters without any problem! Last winter I did'nt instal the Pi and I lost my fish (;-. They froze and died.


B.T.W. If you remove the power , any folder wich are mount "tmpfs" will be clean(empty) on power up.
That's not true. I did power off the Pi and yet, over the power up, there's still the same data on /webdata.

I have now an problem with my new DS18B20 sensor. Using an 4.7k ohm resistor between data and VCC, but yet RPi shows only this in /sys/bus/w1/devices/:

Code: Select all

root@RPi2:/# ls
w1_bus_master1
/var/log/kern.log tell me the following:

Code: Select all

Jun 10 19:56:16 RPi2 kernel: [    4.220481] w1-gpio onewire@0: gpio pin 4, external pullup pin -1, parasitic power 0
Jun 10 19:56:16 RPi2 kernel: [    4.232719] w1_add_master_device: set_pullup requires write_byte or touch_bit, disabling
Jun 10 19:56:16 RPi2 kernel: [    4.565206] w1-gpio onewire@0: gpio pin 4, external pullup pin -1, parasitic power 0
Jun 10 19:56:16 RPi2 kernel: [    4.639025] w1_add_master_device: set_pullup requires write_byte or touch_bit, disabling
Jun 10 20:04:23 RPi2 kernel: [   66.724294] w1_master_driver w1_bus_master1: w1_search: max_slave_count 64 reached, will continue next search.
Jun 10 19:56:16 RPi2 kernel: [    4.597512] w1-gpio onewire@0: gpio pin 4, external pullup pin -1, parasitic power 0
Jun 10 19:56:16 RPi2 kernel: [    4.627835] w1_add_master_device: set_pullup requires write_byte or touch_bit, disabling
Does this mean that the resistor is faulty?

P.S Does every sensor need it's unique pull-up resistor?

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Wed Jun 10, 2015 6:38 pm

That's not true. I did power off the Pi and yet, over the power up, there's still the same data on /webdata.
Well something wrong then because /webdata is suppose to be a tmpfs files. Is the stamp date the same?

Don't forget that the file in /webdata are overwritten all the time and they should look the same but not their time stamp!

That post was about the DHT11/22 and we did overboard with the DS18B20.

But could you check this webpage to see if your setting are okay?
http://www.reuk.co.uk/DS18B20-Temperatu ... rry-Pi.htm

samip537
Posts: 32
Joined: Sat Aug 02, 2014 5:06 pm
Location: Turku, Finland

Re: DHT11 readings onto a web page!

Wed Jun 10, 2015 7:40 pm

I'll check the timestamps of the files when I need the next time power it down.

I did check that my settings are okey, but I'm using the one with the metal casing aka http://www.reuk.co.uk/OtherImages/dalla ... ensors.jpg .

I don't know what could be the problem then, should I check with an multimeter?

EDIT: Wasen't able to include the quote.
Last edited by samip537 on Wed Jun 10, 2015 9:23 pm, edited 2 times in total.

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Wed Jun 10, 2015 8:19 pm

For webdata you should check if you have it into the fstab.

Item 6 on this post
viewtopic.php?p=672576#p672576

P.S. Please correct your BBCode in your previous post.
One quote missing the square and one quote too much!

samip537
Posts: 32
Joined: Sat Aug 02, 2014 5:06 pm
Location: Turku, Finland

Re: DHT11 readings onto a web page!

Wed Jun 10, 2015 9:23 pm

danjperron wrote:For webdata you should check if you have it into the fstab.

Item 6 on this post
viewtopic.php?p=672576#p672576

P.S. Please correct your BBCode in your previous post.
One quote missing the square and one quote too much!

I do:

Code: Select all

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
tmpfs      /webdata   tmpfs   defaults,nosuid,uid=www-data,gid=www-data  0      0
# a swapfile is not a swap partition, so no using swapon|off from here on, use  dphys-swapfile swap[on|off]  for that
P.S Should I try to check the resistor with the multimeter?

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Wed Jun 10, 2015 11:59 pm

You could use my C code to check if your DS18B20 sensor is working,

If the pull up resistor doesn't work the ds18B20Scan application will complain.


Clone the github into your Pi.

Code: Select all

git clone https://github.com/danjperron/BitBangingDS18B20
and compile it

Code: Select all

cd BitBangingDS18B20
gcc -o DS18B20Scan DS18B20Scan.c
Install your sensor with the pull up resistor to another unused GPIO. Please use one which is not an alternate function (i2c,SPI, etc..)

I just change my code and I add the priority boost. You won't need to overclock the Pi.

Just run the program and specify which GPIO your sensor is connected To. Don't use GPIO4 since it is set to 1 wire.

Code: Select all

pi@FirstPi ~/BitBangingDS18B20 $ sudo ./DS18B20Scan -gpio 17
28-000004575F0A : 12 bits  Temperature:  22.56 +/- 0.06 Celsius
P.S. You need to change the define BCM2708_PERI_BASE if you have a Pi 2 version .

samip537
Posts: 32
Joined: Sat Aug 02, 2014 5:06 pm
Location: Turku, Finland

Re: DHT11 readings onto a web page!

Fri Jun 12, 2015 8:40 pm

danjperron wrote:You could use my C code to check if your DS18B20 sensor is working,

If the pull up resistor doesn't work the ds18B20Scan application will complain.


Clone the github into your Pi.

Code: Select all

git clone https://github.com/danjperron/BitBangingDS18B20
and compile it

Code: Select all

cd BitBangingDS18B20
gcc -o DS18B20Scan DS18B20Scan.c
Install your sensor with the pull up resistor to another unused GPIO. Please use one which is not an alternate function (i2c,SPI, etc..)

I just change my code and I add the priority boost. You won't need to overclock the Pi.

Just run the program and specify which GPIO your sensor is connected To. Don't use GPIO4 since it is set to 1 wire.

Code: Select all

pi@FirstPi ~/BitBangingDS18B20 $ sudo ./DS18B20Scan -gpio 17
28-000004575F0A : 12 bits  Temperature:  22.56 +/- 0.06 Celsius
P.S. You need to change the define BCM2708_PERI_BASE if you have a Pi 2 version .

What do I need to change it to as I actually do have Pi 2?

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Fri Jun 12, 2015 10:25 pm

Replace

#define BCM2708_PERI_BASE 0x20000000

with


#define BCM2708_PERI_BASE 0x3F000000

samip537
Posts: 32
Joined: Sat Aug 02, 2014 5:06 pm
Location: Turku, Finland

Re: DHT11 readings onto a web page!

Fri Jun 12, 2015 10:43 pm

danjperron wrote:Replace

#define BCM2708_PERI_BASE 0x20000000

with


#define BCM2708_PERI_BASE 0x3F000000
Okey, changed & compiled and tested.

Result:

Code: Select all

pi@RPi2 ~/BitBangingDS18B20 $ sudo ./DS18B20Scan -gpio 22
*** Error Unable to detect any DS18B20 sensor
EDIT: The sensor seems to be dead.

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Fri Jun 12, 2015 11:02 pm

Could you post a picture of your setup!


On My Pi2 it works!

Code: Select all

pi@Pi2 ~/BitBangingDS18B20 $ sudo ./DS18B20Scan -gpio 22
28-000004575F0A : 12 bits  Temperature:  21.25 +/- 0.06 Celsius
pi@Pi2 ~/BitBangingDS18B20 $ sudo ./DS18B20Scan -gpio 22
28-000004575F0A : 12 bits  Temperature:  21.25 +/- 0.06 Celsius
pi@Pi2 ~/BitBangingDS18B20 $ 
Image

Did you change the define into the DS18B20Scan.c and recompile. This is not python! You need to recompile.

samip537
Posts: 32
Joined: Sat Aug 02, 2014 5:06 pm
Location: Turku, Finland

Re: DHT11 readings onto a web page!

Sat Jun 13, 2015 12:09 am

danjperron wrote:Could you post a picture of your setup!


On My Pi2 it works!

Code: Select all

pi@Pi2 ~/BitBangingDS18B20 $ sudo ./DS18B20Scan -gpio 22
28-000004575F0A : 12 bits  Temperature:  21.25 +/- 0.06 Celsius
pi@Pi2 ~/BitBangingDS18B20 $ sudo ./DS18B20Scan -gpio 22
28-000004575F0A : 12 bits  Temperature:  21.25 +/- 0.06 Celsius
pi@Pi2 ~/BitBangingDS18B20 $ 
Image

Did you change the define into the DS18B20Scan.c and recompile. This is not python! You need to recompile.
I did change & recompile it, but didin't mention it.

I'll take a picture of the setup tomorrow/later today.

samip537
Posts: 32
Joined: Sat Aug 02, 2014 5:06 pm
Location: Turku, Finland

Re: DHT11 readings onto a web page!

Sat Jun 13, 2015 12:59 pm

The setup:
Image

GPIO:
Image

It's currently connected to GPIO Pin 4 as I need to show the seller as I'm relally positive that it's faulty.

If you want a video version, here:
https://youtu.be/2Zl588rTiXQ

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Sat Jun 13, 2015 2:27 pm

It will never work!

I wonder why your raspberry pi is still working!


Normal breadboard have abcde connect together and each numbers correspond to a new set of pins connect together.
It is the same for the fghij!


check this website!

https://learn.sparkfun.com/tutorials/ho ... breadboard

samip537
Posts: 32
Joined: Sat Aug 02, 2014 5:06 pm
Location: Turku, Finland

Re: DHT11 readings onto a web page!

Sat Jun 13, 2015 3:46 pm

danjperron wrote:It will never work!

I wonder why your raspberry pi is still working!


Normal breadboard have abcde connect together and each numbers correspond to a new set of pins connect together.
It is the same for the fghij!


check this website!

https://learn.sparkfun.com/tutorials/ho ... breadboard
Umm, could you clearify why you are wondering why my RPi still works?

Should I connect them to abcde rather even though there's the other sensor also connected as I don't see the problem in the wiring?

EDIT: Problem solved, it works now.
Last edited by samip537 on Sat Jun 13, 2015 6:16 pm, edited 1 time in total.

danjperron
Posts: 3974
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: DHT11 readings onto a web page!

Sat Jun 13, 2015 6:12 pm

Image

I mark all the row which are connect together!

Row 27 which all pins connected together is where your sensor is. All wires of the sensor together and not connected anywhere else.

Row 26 which is the Resistor and a yellow wire. I suppose it is the GPIO. Both resistor ends together on the GPIO and nothing else connect on it.

Row 25 a blue wire , I suppose is the 3.3V connected to a yellow wires (another GPIO) and nothing else connect to it.


Did you look at the url I sent to you! You have the picture of your breadboard and how it is made in the back.


Row with numbers have 5 pins and the pins are connected together.
The thing is that you set your DHT sensor the correct way using different row numbers .

Look at my picture on previous post!
Last edited by danjperron on Sat Jun 13, 2015 6:55 pm, edited 1 time in total.

Return to “Python”