Make a thermometer with Raspberry Pi and make it viewable with a browser Part 4

reading

I read it for the time being, but I will manage the source with git. From Wai's repository to reference.

$ git clone https://github.com/kaepa3/Thermo_PI.git

The sauce looks like the sample.

input.py


import dhtreader

type = 11
pin = 4

dhtreader.init()
print dhtreader.read(type, pin)

If you look at the previous map, you can choose the location of the pin. I actually move it and do something about it. But at point 4, you'll know the answer.

So the problem. It doesn't work that way. However, it is recorded when the pull-up resistor is removed. As a result of the examination, the shape of the hardware is slightly different from that of the reference site. (No holes when viewed from above) On the back side, it is recorded as "strong sales". It's a lot of trouble, so I interpret it as a version that I bought without any resistance. Interpret ↓ very conveniently. http://www.myu.ac.jp/~xkozima/lab/raspTutorial3.html (I'm not sure how to do this, so I'll postpone this issue.)

Then, the temperature and humidity collection is completed. The source at the moment changes as follows.

import dhtreader
import os
import time

type = 11
pin =26

while True:
  os.system("clear")
  if 0 == dhtreader.init():
    print("init error")

  sensor_val = dhtreader.read(type, pin)
  if sensor_val:
    t,h = sensor_val
    print("{0} {1}".format(t,h))
  else:
    print("error") 

  time.sleep(3)  

I get quite an error. Did I not have to have such a hard time if I bought a proper sensor?

Once you get here, all you have to do is how to put it in the DB The Pyraz is over. Think after making an app on the rails side.

Summary about Raspberry Pi

Just a personal computer.

Recommended Posts

Make a thermometer with Raspberry Pi and make it viewable with a browser Part 4
Make a thermometer with Raspberry Pi and make it visible on the browser Part 3
[Raspberry Pi] Add a thermometer and a hygrometer
Make a wash-drying timer with a Raspberry Pi
Make a Kanji display compass with Raspberry Pi and Sense Hat
Make a wireless LAN Ethernet converter and simple router with Raspberry Pi
Build a distributed environment with Raspberry PI series (Part 3: Install and configure dnsmasq)
Associate Python Enum with a function and make it Callable
Make a BLE thermometer and get the temperature with Pythonista3
Using a webcam with Raspberry Pi
Easily make a TweetBot that notifies you of temperature and humidity with Raspberry Pi + DHT11.
Let's make a cycle computer with Raspberry Pi Zero (W, WH)
Make a simple CO2 incubator using Raspberry PI and CO2 sensor (MH-Z14A)
Let's make an IoT shirt with Lambda, Kinesis, Raspberry Pi [Part 1]
Pet monitoring with Rekognition and Raspberry pi
Building a distributed environment with the Raspberry PI series (Part 2: PiServer analysis and alternative system design)
Operate an oscilloscope with a Raspberry Pi
Measure temperature, humidity, etc. with SensorTag and send it to Ambient via Raspberry Pi 3 to graph it Part 2
Create a car meter with raspberry pi
2. Make a decision tree from 0 with Python and understand it (2. Python program basics)
Get GrovePi + sensor value with Raspberry Pi and store it in kintone
[Python + PHP] Make a temperature / humidity / barometric pressure monitor with Raspberry Pi
I tried to make a traffic light-like with Raspberry Pi 4 (Python edition)
Make a decision tree from 0 with Python and understand it (4. Data structure)
Get temperature and humidity with DHT11 and Raspberry Pi
Let's make a nervous breakdown application with Vue.js and Django-Rest-Framework [Part 3] ~ Implementation of nervous breakdown ~
Source compile Apache2.4 + PHP7.4 with Raspberry Pi and build a Web server --2 PHP introduction
Cross-compiling Raspberry Pi and building a remote debugging development environment with VS Code
Source compile Apache2.4 + PHP7.4 with Raspberry Pi and build a Web server ―― 1. Apache introduction
Let's make a nervous breakdown app with Vue.js and Django-Rest-Framework [Part 2] ~ Vue setup ~
Let's make a nervous breakdown app with Vue.js and Django-Rest-Framework [Part 1] ~ Django setup ~
Let's make a nervous breakdown application with Vue.js and Django-Rest-Framework [Part 6] ~ User Authentication 2 ~
Creating a temperature control system with Raspberry Pi and ESP32 (3) Recipient Python file
[For beginners] I made a motion sensor with Raspberry Pi and notified LINE!
Load a photo and make a handwritten sketch. With zoom function. Tried to make it.
Let's make a nervous breakdown application with Vue.js and Django-Rest-Framework [Part 5] ~ User authentication ~
Record temperature and humidity with systemd on Raspberry Pi
Machine learning with Raspberry Pi 4 and Coral USB Accelerator
Create a color sensor using a Raspberry Pi and a camera
Draw a weakness graph in Python and save it in various formats (Raspberry Pi, macOS)
Easy IoT to start with Raspberry Pi and MESH
GPGPU with Raspberry Pi
Control music playback on a smartphone connected to Raspberry Pi 3 and bluetooth with AVRCP
Build a server on Linux and local network with Raspberry Pi NextCloud and desktop sharing
Try to visualize the room with Raspberry Pi, part 1
Let's make a Makefile and build it (super beginner)
How to make a shooting game with toio (Part 1)
Detect mask wearing status with OpenCV and Raspberry Pi
Let's make a simple game with Python 3 and iPhone
Measure temperature and humidity with Raspberry Pi3 and visualize with Ambient
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
Let's make a Mac app with Tkinter and py2app
Make an umbrella reminder with Raspberry Pi Zero W
A story about getting the Atom field (XML telegram) of the Japan Meteorological Agency with Raspberry Pi and tweeting it
DigitalSignage with Raspberry Pi
Getting Started with Yocto Project with Raspberry Pi 4 and WSL2
Distributed environment construction with Raspberry PI series (Part 4: NFS server construction and client OS import)
Troubleshoot with installing OpenCV on Raspberry Pi and capturing
A memorandum when making a surveillance camera with Raspberry Pi
Make a note of what you want to do in the future with Raspberry Pi
Make an autonomous driving robot car with Raspberry Pi3 B + and ultrasonic distance sensor HC-SR04