[PYTHON] Make a thermometer with Raspberry Pi and make it visible on the browser Part 3



If you think it's about soldering a sensor normally, you need to use resistors and capacitors, and you need to understand GPIO to some extent. Reference URL (electronic circuit) http://avr.gawakaru.jp/archives/tag/raspberry-pi-2/page/2 Reference URL (GPIO) http://deviceplus.jp/hobby/raspberrypi_entry_009/ Reference URL (electronic parts) http://www.kita-colle.com/culturati/646

As a result of reference, I notice that there are not enough parts.

The electronic parts store is really good, the selected hard-line man's store. Purchase additional items while being afraid

A total of about 1500 yen. I'm already stubborn. I noticed that I forgot to buy male and female here. Purchased at Rakuten (about 1000 yen) Abandoned.

Construction of development environment

For the time being, Raspberry Pi seems to want python. However, it seems that the processing is unclear with python, so It seems to be a python extension in C language. At last, the main subject started to smell, but it is still a long way to go.

1. Install Git on the pie

Get text for preparation (it seems to solve language problems)

$ wget http://ftp.gnu.org/gnu/gettext/
$ gettext-0.19.3.tar.gz
$ tar xvf gettext-0.19.3.tar.gz
$ cd gettext-0.19.3
$ ./configure && make && sudo make install

I'm drinking beer during this time Well, should I specify the installation location? Well, I don't care. Because there is no inconvenience. Install Git

$w get http://git-core.googlecode.com/files
$ git-
$ tar xvfz git-
$cd git-
$ ./configure && make && sudo make install

2. Compile the library

For the time being, please have a library pack!

$ mkdir liblary
$ cd library
$ wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.38.tar.gz
$ tar zxvf bcm2835-1.38.tar.gz
$ cd bcm2835-1.38
$ ./configure
$ make
$ sudo make check
$ sudo make install

3. Creating an extension module

For the time being, please create a directory!

$ mkdir thermo_module
$ cd thermo_module
$ git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
$ cd Adafruit-Raspberry-Pi-Python-Code
$ cd Adafruit_DHT_Driver_Python
$ python setup.py build

It seems that there is no python.h, so install the standard development environment

$ sudo apt-get install python-dev build-essential


$ python setup.py build

The hierarchy was deep, but I found dhtreader.so. Preparation on the software side is complete

4. Read from python code

Next time due to a defect in the jumper cable

Command used this time

This reflection

While I was doing it, I cut all my hair and made it a shaven. Once upon a time, a bar master "My wife has a mental illness, but it was hard to cut out her hair while laughing at midnight." I remembered saying that. The bar moved somewhere and became estranged, but when I saw the mixi page after a long time, my daughter's name was the same as my friend's child.


Recommended Posts

Make a thermometer with Raspberry Pi and make it visible on the browser Part 3
Make a thermometer with Raspberry Pi and make it viewable with a browser Part 4
Make a BLE thermometer and get the temperature with Pythonista3
Control the motor with a motor driver using python on Raspberry Pi 3!
[Raspberry Pi] Add a thermometer and a hygrometer
Make a Kanji display compass with Raspberry Pi and Sense Hat
Make a wash-drying timer with a Raspberry Pi
Building a distributed environment with the Raspberry PI series (Part 2: PiServer analysis and alternative system design)
Make a wireless LAN Ethernet converter and simple router with Raspberry Pi
[Personal memo] Get data on the Web and make it a DataFrame
Build a distributed environment with Raspberry PI series (Part 3: Install and configure dnsmasq)
Use python on Raspberry Pi 3 and turn on the LED when it gets dark!
Record temperature and humidity with systemd on Raspberry Pi
Specify the volume on linux and make a sound
Try to visualize the room with Raspberry Pi, part 1
Make a breakpoint on the c layer with python
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
Troubleshoot with installing OpenCV on Raspberry Pi and capturing
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
A story about getting the Atom field (XML telegram) of the Japan Meteorological Agency with Raspberry Pi and tweeting it
Play with the Raspberry Pi Zero WH camera module Part 1
Create a web surveillance camera with Raspberry Pi and OpenCV
Associate Python Enum with a function and make it Callable
Create a partition and then install the Raspberry Pi OS
Get the matched string with a regular expression and reuse it when replacing on Python3
Make a note of what you want to do in the future with Raspberry Pi
Easily make a TweetBot that notifies you of temperature and humidity with Raspberry Pi + DHT11.
It's getting cold, so I tried to make it possible to turn on / off the AC heater automatically with Raspberry Pi!
MQTT on Raspberry Pi and Mac
Using a webcam with Raspberry Pi
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)
Christmas classic (?) Lighting a Christmas tree with Raspberry Pi and Philips Hue
Let's make an IoT shirt with Lambda, Kinesis, Raspberry Pi [Part 1]
Install a tact switch on the Raspberry Pi to make daily "Good morning Yosoro !!" tweets comfortable
A program that receives the servo command of the radio control, interrupts the Raspberry Pi and logs it
Measure temperature, humidity, etc. with SensorTag and send it to Ambient via Raspberry Pi 3 to graph it Part 2
Finally ... Make a radio control using python on Raspberry Pi 3! (When the magnet is brought closer, the motor moves and stops automatically)
2. Make a decision tree from 0 with Python and understand it (2. Python program basics)
A memo to simply use the illuminance sensor TSL2561 with Raspberry Pi 2
"Honwaka Notification Lamp" on Raspberry Pi Part 2
Detect analog signals with A / D converter using python on Raspberry Pi 3!
Deploy a Python app on Google App Engine and integrate it with GitHub
"Honwaka Notification Lamp" on Raspberry Pi Part 1
Build a Tensorflow environment with Raspberry Pi [2020]
Finally ... Make a radio control using python on Raspberry Pi 3! (The motor moves while the button is pressed)
Use python on Raspberry Pi 3 to light the LED with switch control!
A memo with Python2.7 and Python3 on CentOS
Scrap the published csv with Github Action and publish it on Github Pages
Get GrovePi + sensor value with Raspberry Pi and store it in kintone
Programming normally with Node-RED programming on Raspberry Pi 3
[Python + PHP] Make a temperature / humidity / barometric pressure monitor with Raspberry Pi
Use the Grove sensor on the Raspberry Pi
I tried to make a traffic light-like with Raspberry Pi 4 (Python edition)
"Honwaka Notification Lamp" on Raspberry Pi Part 3
Working with sensors on Mathematica on Raspberry Pi
Make a DNN-CRF with Chainer and recognize the chord progression of music
Operate an oscilloscope with a Raspberry Pi
Create a car meter with raspberry pi
Make a decision tree from 0 with Python and understand it (4. Data structure)