npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mh_z19

v0.1.7

Published

<p align="center"> <img src="img/mhz19c_omote.png" width="300"> </p>

Downloads

12

Readme

概要(Overview)

MH-Z19で二酸化炭素濃度を図るためのプログラムです。モジュールですが単体での起動が可能です。(This is a program for measuring carbon dioxide concentration with MH-Z19. Although it is a module, it can be started by itself.)

sudo mh_z19 <Serial port to Use ("/dev/ttyS0" etc.)>

テスト環境(Testing Environment)

  • Raspberry Pi 4 modelB 4GB(UART1、UART2、UART4)
  • Winsen MH-Z19C

ここに書いてある事はわたしが設定した内容であり、動作を保証するものではありません。(What is written here is what I have set, and I do not guarantee the operation.) もしかしたら他の環境でも動くかもしれません。

配線図 (Wiring diagram)

事前設定 (Preparation settings)

① シリアルポートの有効化 (Enable serial port)

メニューの『設定>Raspberry Pi の設定>インターフェイス』のシリアルポートを有効にします。(SerialPort ⇒ enable)

この際、シリアルコンソールは無効のままにしてください。(Serial console ⇒ Disable)

再起動を促されるので再起動します。(You will be prompted to reboot, so reboot.)

② UART2,UART4を使用する場合 (When using UART2 and UART4)

/boot/config.txt を編集します。(Edit)

例えば(For example)、 sudo nano /boot/config.txt

・・・・

[all]

・・・・

dtoverlay=uart2
dtoverlay=uart4

一番最後に上記の2行を追加します。(Add the above two lines at the very end.)

UART4を使用しない場合は、UART2の行だけを追加します。(If you are not using UART4, add only the UART2 line.)

保存したら再起動します。(After saving, reboot.)

再起動が完了したら /dev を確認してください。(Check /dev when the reboot is complete.)

下記の項目が追加されていたらUART2,UART4の解放は成功です。(Release of UART2 and UART4 is successful if the following items exist.)

③ RaspberryPiを再起動する度に必要な作業 (Work required every time you restart the Raspberry Pi)

  • 起動時にserial-gettyがシリアルポートを占有してしまう為、STOPする。(Stop because serial-getty occupies the serial port at startup.)
  • プログラムがsudo無しにシリアルポートにアクセスできるようにパーミッションを変更します。再起動する度に元に戻ります。(Change the permissions so that the program can access the serial port without sudo. It will be restored every time you restart.)

具体的には、

UART1の場合、

sudo systemctl stop [email protected]
sudo chmod 666 /dev/ttyS0

UART2の場合、

sudo systemctl stop [email protected]
sudo chmod 666 /dev/ttyAMA1

UART4の場合、

sudo systemctl stop [email protected]
sudo chmod 666 /dev/ttyAMA2

UART2,UART4は開放状況、環境によってずれる可能性があります。(UART2 and UART4 may shift depending on the open status and environment.)

最後に(Finally)

I can't speak English, so I use Google Translate for everything. I'm sorry if there is a rude wording.