Cov txheej txheem:

Nyeem thiab Sau Los Ntawm Serial Port Nrog Raspberry Pi Siv Wemos: 5 Kauj Ruam
Nyeem thiab Sau Los Ntawm Serial Port Nrog Raspberry Pi Siv Wemos: 5 Kauj Ruam

Video: Nyeem thiab Sau Los Ntawm Serial Port Nrog Raspberry Pi Siv Wemos: 5 Kauj Ruam

Video: Nyeem thiab Sau Los Ntawm Serial Port Nrog Raspberry Pi Siv Wemos: 5 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Nyeem thiab Sau Los Ntawm Serial Port Nrog Raspberry Pi Siv Wemos
Nyeem thiab Sau Los Ntawm Serial Port Nrog Raspberry Pi Siv Wemos
Nyeem thiab Sau Los Ntawm Serial Port Nrog Raspberry Pi Siv Wemos
Nyeem thiab Sau Los Ntawm Serial Port Nrog Raspberry Pi Siv Wemos

Sib tham nrog Raspberry Pi siv Wemos D1 mini R2.

Kauj Ruam 1: Kauj Ruam 1: Flash Wemos D1 R2 Mini

Kauj Ruam 1: Flash Wemos D1 R2 Mini
Kauj Ruam 1: Flash Wemos D1 R2 Mini

Tshaj tawm cov cai hauv qab no rau Wemos D1 R2 mini:

/ * * ESP8266 Hom pw tsaug zog

*/

void teeb tsa () {

ESP.deepSleep (0);

}

void voj () {

}

Kauj Ruam 2: Kauj Ruam 2: Xiam Kev Pabcuam Console ntawm Raspberry Pi

Lov tes taw kev pabcuam serial-getty.

sudo systemctl lov tes taw [email protected]

Qhib "/boot/cmdline.txt".

sudo nano /boot /cmdline.txt

Tshem tawm "console = serial0, 115200", tom qab ntawd khaws cov ntawv.

Rov pib dua.

sudo rov pib dua

Kauj Ruam 3: Kauj Ruam 3: Txuas Raspberry Pi Nrog Wemos D1 R2 Mini

Kauj Ruam 3: Txuas Raspberry Pi Nrog Wemos D1 R2 Mini
Kauj Ruam 3: Txuas Raspberry Pi Nrog Wemos D1 R2 Mini

RX RX os

TX TX TX

GND GND

Kauj Ruam 4: Kauj Ruam 4: Upload Python Script

Khiav cov cai hauv qab no ntawm koj Raspberry Pi:

ntshuam sij hawm ntshuam serial

cov = serial. Serial (chaw nres nkoj = '/dev/ttyUSB0', baudrate = 9600, parity = serial. PARITY_NONE, stopbits = serial. STOPBITS_ONE, bytesize = serial. EIGHTBITS, timeout = 1) counter = 0

thaum 1:

x = ser.readline () print x

ssssss

Kauj Ruam 5: Kauj Ruam 5: Cov Ntaub Ntawv Teev Npe Hauv Putty

Kauj Ruam 5: Cov ntaub ntawv Serial hauv Putty
Kauj Ruam 5: Cov ntaub ntawv Serial hauv Putty

Sau cov ntaub ntawv tseem ceeb hauv Putty thiab pom cov ncha ntawm Raspberry Pi.

Pom zoo: