✨ประเภทบทความ

ทดสอบการอ่านค่า PZEM ด้วย Raspberrypi

 

https://github.com/JhonControl/PZEM-004t-basic-ESP32-Arduino-ESP8266-Python-RPi/blob/master/PZEM_Python/PZEM-004-python.py

 

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
Average: 5 (1 vote)

ทดสอบส่งข้อมูล Protocal MQTT AWSIOT and Raspberrypi

 

 

เริ่มด้วยการเข้าไปใช้ AWS Iot แล้ว สร้าง Thing นั้นก็คืออุปกรณ์ Raspberry pi

ทดสอบส่งข้อมูลด้วย Protocal MQTT ระหว่าง AWSIOT และ Raspberry pi

โดยใช้ python script ตัวอย่างการติดต่อที่ได้จาก AWSIOT

 

aws

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
Average: 5 (1 vote)

Raspberry Pi (MQTT Server)

การทำ Raspberry Pi (MQTT Server)

อ้างอิงจาก

1.การติดตั้ง Mosquitto ให้กับ Raspberry Pi 3 Model B+ เพื่อใช้เป็น MQTT Server

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
Average: 5 (1 vote)

ลงโปรแกรม Raspberry Pi ให้ Pi Zero W

1. ให้ download Raspberry Pi Imager v1.8.1 มา เพื่อเป็นตัวโปรแกรม OS ลงใน micro SD card

2. ให้ดูวิธีทำตาม https://learn.adafruit.com/raspberry-pi-zero-creation/using-rpi-imager

ขั้นตอนในตัวโปรแกรม  Raspberry Pi Imager v1.8.1 จะบอกอยู่แล้วดูไม่ยาก

Raspberry Pi Imager

 

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
Average: 5 (1 vote)

Check CPU cat /proc/cpuinfo

The Raspberry Pi has a lot of system information available like details about the CPU, the current temperature of the processor, the amount of memory and so on. Not all of the information is available in one place; however, if you know where to look, you can discover quite a lot of interesting data about your Pi.

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

Configuring UART /RPI UART Speeds/ Baud rate

Configuring UART

Verify physical UART is enabled in /boot/config.txt

enable_uart=1

Configure clock and speed where necessary in /boot/config.txt

init_uart_clock=1627604
init_uart_baud=460800

Serial Aliases On the Raspberry Pi 3 the second serial port is called /dev/ttyS0 and is by default mapped to the GPIO pins 14 and 15. So immediately, if you have code that references /dev/ttyAMA0 you’re going to have problems and things aren’t going to work.

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

Linux command อ่านค่า host name

Check Kernel version
pi@raspberrypi:/usr/src $ uname -srm
Linux 4.19.75+ armv6l

pi@raspberrypi:/ $ uname -a
Linux raspberrypi 4.19.75+ #1270 Tue Sep 24 18:38:54 BST 2019 armv6l GNU/Linux

 

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

Swapping the Serial Ports on Raspberry Pi 3

Swapping the Serial Ports on Raspberry Pi 3

If you don’t want to use the Bluetooth and you want that high performance /dev/ttyAMA0 back on the GPIO, you can do this via a device overlay called “pi3-miniuart-bt” i.e. use the mini-uart (/dev/ttyS0) for Bluetooth.

To use add the following line to the /boot/config.txt

sudo nano /boot/config.txt

and add (at the end of the file):

dtoverlay=pi3-miniuart-bt

Save and reboot for changes to take effect.

sudo reboot

You can check that it has worked by:

ls -l /dev

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

ทดสอบการ อ่านข้อมูล Virtual UART

Here is method to make virtual GPIO UART

http://abyz.me.uk/rpi/pigpio/download.html

Download and install (latest version)

wget https://github.com/joan2937/pigpio/archive/master.zip
unzip master.zip
cd pigpio-master
make
sudo make install

--------------------------------------------------------------

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

ตัวแปลง USB เป็น UART version เก่า (PL2303HXA)

วิธีการติดตั้งดูจากลิงค์ข้างล้างนี้ ให้ดาวโหลด์ไดร์เวอร์ตัวเก่ามาลง

http://wp.brodzinski.net/hardware/fake-pl2303-how-to-install/

 

USB to UART ที่ซื้อมาจากอเมซอล ดันเป็นเวอร์ชั้นเก่า window 10 มองไม่เห็นไดร์เวอร์

https://www.amazon.co.uk/gp/product/B00KAE2EL4/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1

 

 

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

How to Handle Raspberry Pi Serial Reading and Writing

How to Handle Raspberry Pi Serial Reading and Writing

https://pimylifeup.com/raspberry-pi-serial/

 

3 Ways to Write Text to a File in Python

https://cmdlinetips.com/2012/09/three-ways-to-write-text-to-a-file-in-python/

September 25, 2012 by cmdline

 

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

How does the USB protocol work?

https://www.raspberrypi.org/forums/viewtopic.php?t=165203

https://electronics.stackexchange.com/questions/200233/how-does-the-usb-...

 

I have always wondered about how USB devices actually communicate. When I stripped a usb cable, I noticed that there were four different wires. Two of them being for power (positive and ground) and also two other wires.

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

คำสั่ง Check CPU and ram Linux, GPIO

คำสั่ง Check CPU and ram Linux, GPIO ใน raspberry pi

1. free command

The free command is the most simple and easy-to-use command to check memory usage on Linux. Here is a quick example

 

1

 

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

การใช้ UART ผ่าน GPIO Pin ใน Raspberry Pi ด้วย Software Serial

You can use the standard, HW UART on the Raspberry Pi to capture UART data. 

In addition to this standard UART, as demonstrated below, you can use two GPIO pins on the Raspberry Pi to “Bit Bang” data in or as a “Software Serial” port rather than needing a 2nd Hardware one (that isn’t broken out).

The below software Serial port utilizes the great PIGPIO Library which you can download and install for free at the following URL: PIGPIO Library

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

ตัวอย่างการอ่านค่า GPS ผ่าน Raspberry Pi UART port

 

https://www.instructables.com/id/Raspberry-Pi-the-Neo-6M-GPS/

ติดตั้ง gpsd program parsing the raw GPS data

Open a terminal session and type sudo apt-get install gpsd gpsd-clients and press Enter.

After that installs, let's start the serial port:

Type stty -F /dev/ttyAMA0 9600 and press Enter.

Now start GPSD:

Type sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock and press Enter.

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
Average: 3 (1 vote)

How to set Raspberry UART

Introduction to the UART setup

In this article, we will try to set up the UART on the Raspberry Pi 3 and Raspberry Pi Zero W running the latest debian “Jessy” release of the kernel.

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

UART Speed for Raspberry Pi Zero / Processor Spec

  • UART Port ใช้ไฟ 3.3V logic level
  • PL011 คือ ตัวประมวลผลหลักที่ใช้
  • Linux directory path -> /dev/ttyAMA0 for the PL011 UART.
  • Maximum speed = 921600 bps  refer PrimeCell UART (PL011) Technical Reference Manual

setting -> refer https://www.raspberrypi.org/forums/viewtopic.php?t=73673

           -> refer  document in attach file UART at Raspberry Pi GPIO Pinout.pdf

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
No votes yet

เขียนโปรแกรม Raspberry Pi 1 (อ่านค่า Temperature Sensor)

เขียนโปรแกรม Raspberry Pi 1 (อ่านค่า Temperature Sensor)

Programming the DHT11

I’ll explain how to use both C and Python to get temperature and humidity from the DHT11.

 

Programming the DHT11 With Python

We’ll be using the Adafruit DHT11 Python library. You can download the library using Git, so if you don’t have Git installed on your Pi already, enter this at the command prompt:

sudo apt-get install git-core

Note: If you get an error installing Git, run sudo apt-get update and try it again.

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
Average: 3 (1 vote)

วิธีการใช้งาน Raspberry Pi ด้วย USB หรือ Wifi

วิธีการใช้งาน Raspberry Pi Zero W บน window ผ่านโปรแกรม Putty

1) ดาวน์โหลดและติดตั้ง ระบบปฏิบัติการ Raspbian ตัวล่าสุดลง micro SD ให้เรียบร้อย

2) สร้างไฟล์เปล่า ssh โดยลบนามสุกลออกใส่เพิ่มเติมลงใน micro SD card

3) แก้ไฟล์ config.txt ด้วย notepad++ และเพิ่ม dtoverlay=dwc2 ที่ด้านล่างสุดของไฟล์

4) แก้ไฟล์ cmdline.txt ด้วย notepad++ หาคำว่า rootwait  เวันวรรคและใส่คำว่า modules-load=dwc2,g_ether เพิ่ม

5) ดาวน์โหลดโปรแกรม  Putty ติดตั้งบน Windows

ประเภทเนื้อหาของ article
Raspberry Pi Zero
Rating
Average: 3 (1 vote)