Cov txheej txheem:
- Kauj ruam 1: QHOV TSEEB
- Kauj ruam 2: Kev sib txuas
- Kauj ruam 3: CODING:
- Kauj Ruam 4: QHOV TSEEB:
- Kauj ruam 5: GRAPHIC
- Kauj Ruam 6:
Video: Av Ntsuas Cov Ntsiab Lus Ntsuas Siv Esp32 thiab Thingsio.ai Platform: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Hauv qhov kev qhia no kuv yuav piav qhia txog kev nyeem cov dej noo hauv cov av los ntawm kev siv esp32 thiab tom qab ntawd xa qhov txiaj ntsig mus rau yam khoom.ai IoT huab platform.
Kauj ruam 1: QHOV TSEEB
Kho vajtse Cheebtsam:
1. esp32 pawg thawj coj loj
2. Qhov av sensor
3. Jumper Xov
Software:
1. Arduino IDE
2. Thingsio.ai
Kauj ruam 2: Kev sib txuas
Av noo noo Sensor ---------------------- esp32 Board
VCC --------------------------------------- 3V3
GND -------------------------------------- NCO
A0 ---------------------------------------- VP
Kauj ruam 3: CODING:
#suav nrog
#suav nrog
#suav nrog
int suav = 0, i, m, j, k;
tus t;
int sensor_pin = A0;
tus nqi;
////////////////////////////////////////// Txhua qhov kev ceeb toom
rau CLOUD ////////////////////////////////
const char* tus tswv = "api.thingsai.io"; // LOS YOG host =
devapi2.thethingscloud.com
const char* post_url = "/devices/deviceData"; // LUB
/api/v2/yamcloud2/_table/data_ac
const char* time_server =
"baas.thethingscloud.com"; // qhov no yog los hloov lub sijhawm
const int httpPort = 80;
ua int httpsPort = 443;
const char* neeg rau zaub mov =
"api.thingsai.io"; // Neeg rau zaub mov URL
timestamp char [10];
WiFiMulti WiFiMulti;
// Siv chav kawm WiFiClient los tsim kev sib txuas TCP
WiFiClient tus thov kev pab;
/////////////////////////////////////// TIMESTAMP
CALCULATION muaj nuj nqi ///////////////////////////////////////
muab GiveMeTimestamp ()
{
tsis kos npe ntev
timeout = millis ();
// WiFiClient tus thov kev pab;
thaum
(client.available () == 0)
{
yog tias (millis () -
lub sij hawm> 50000)
{
client.stop (); cov.
rov 0;
}
}
thaum (client.available ())
{
Txoj hlua kab =
client.readStringUntil ('\ r'); // indexOf () yog qhov ua haujlwm los tshawb rau smthng, nws rov qab -1 yog tias tsis pom
int pos = np
line.indexOf ("\" timestamp / ""); // tshawb rau "\" timestamp / "" txij thaum pib teb tau txais thiab theej tag nrho cov ntaub ntawv tom qab ntawd, nws yuav yog koj lub sijhawm
yog (pos> =
0)
{
int j = 0;rau (j = 0; j <10; j ++)
{timestamp [j] = kab [pos + 12 + j];
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
void teeb tsa ()
{Serial.begin (115200);Serial.println ("Nyeem Los Ntawm Lub Sensor …");
ncua (2000);
// Peb pib los ntawm
txuas mus rau WiFi network
WiFiMulti.addAP ("Wifi_name", "Wifi_Password");
Serial.println ();
Serial.println ();Serial.print ("Tos WiFi …");thaum (WiFiMulti.run ()! = WL_CONNECTED) {Serial.print (".");
ncua (500);
}Serial.println ("");Serial.println ("Txuas nrog WiFi");
Serial.println ( IP
chaw nyob: );Serial.println (WiFi.localIP ());
ncua (500);
}
void lub voj ()
{
{
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Xa Xa cov lus nug thiab
YUAV TSUM TSHUAJ RESPONSE /////////////////////////
tus nqi =
analogRead (sensor_pin);
// tus nqi =
daim ntawv qhia (tus nqi, 550, 0, 0, 100);Serial.print ("Mositure:");Serial.print (tus nqi);Serial.println ("%");ncua (1000);Serial.print ("txuas rau");Serial.println (tus tswv tsev); // txhais tau ib sab:- host = devapi2.thethingscloud.com lossis 139.59.26.117
///////////////////////////////////// TIMESTAMP CODE SNIPPET
/////////////////////////
Serial.println ("sab hauv tau txais timestamp / n");
yog
(! client.connect (time_server, {
rov qab;
//*-*-*-*-*-*-*-*-*-*
}client.println ("Tau txais/api/timestamp HTTP/1.1"); // Qhov haujlwm no ua dab tsi, kuv tsis tau txaisclient.println ("Tus tswv tsev: baas.thethingscloud.com");client.println ("Cache-Control: tsis-cache");client.println ("Postman-Token: ea3c18c6-09ba-d049-ccf3-369a22a284b8");
client.println (); cov.
GiveMeTimestamp ();
// nws yuav hu lub luag haujlwm uas yuav tau txais lub sijhawm timestamp los ntawm cov neeg rau zaub mov
Serial.println ("timestamp tau txais");
Serial.println (timestamp);Serial.println ("hauv ThingsCloudPost");
Txoj hlua PostValue =
"{" device_id / ": 61121695918, \" qhev_id / ": 2";
PostValue = Cov
PostValue + ", \" dts / ":" + timestamp;
PostValue = Cov
PostValue +", \" data / ": {" MOIST / ":" +value +"}" +"}";Serial.println (PostValue);
/ * tsim qhov piv txwv ntawm WiFiClientSecure */
WiFiClientSecure tus neeg siv khoom;Serial.println ("Txuas rau server ntawm chaw nres nkoj 443");
yog
(! client.connect (neeg rau zaub mov, 443)) {Serial.println ("Kev sib txuas tsis tau ua tiav!");
lwm yam {Serial.println ("Txuas rau server!");
/* tsim
thov */client.println ("POST/pab kiag li lawm/deviceData HTTP/1.1");client.println ("Tus tswv: api.thingsai.io");//client.println("Connection: kaw ");client.println ("Cov ntsiab lus-Hom: thov/json");
client.println ( cache-tswj:
tsis muaj cache ");client.println ("Kev tso cai: Tus neeg nqa khoom eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9. IjVhMzBkZDFkN2QwYjNhNGQzODkwYzQ4OSI.kaY6OMj5cYlWNqC2PNTkXs9Jy9j9"client.print ("Cov ntsiab lus-Ntev:");
client.println (PostValue.length ());client.println (); cov.client.println (PostValue);
//////////////////////////////////// POSTING cov ntaub ntawv mus rau
huab tau ua tiav thiab tam sim no tau txais daim ntawv teb huab server //////////////////
Serial.print ( Tos kom teb
);
thaum
(! client.available ()) {
ncua (50);
//Serial.print (".");
}
/* yog cov ntaub ntawv
muaj ces tau txais thiab luam tawm rau Terminal */
thaum
(client.available ()) {
char c = client.read (); cov. Serial.write (c);
}
/* os
server txuas, nres tus neeg siv khoom */
yog
(! client.connected ()) {Serial.println ();Serial.println ("Cov neeg rau zaub mov raug txuas");
client.stop (); cov.
}
}
Serial.println ( ////////////////////// Qhov kawg
///////////////////// );
ncua (3000);
}
}
Kauj Ruam 4: QHOV TSEEB:
Cov zis ntawm cov cai tau qhia.
Kauj ruam 5: GRAPHIC
Qhov no yog cov duab sawv cev ntawm cov txiaj ntsig uas tau nyeem los ntawm lub sensor.
Kauj Ruam 6:
Nov yog daim vis dis aus tiav ntawm txoj haujlwm. Ua Tsaug.
Pom zoo:
Windows 7: Cov Ntsiab Lus Cov Ntawv Cov Khoom Tsis Muaj: 3 Cov Kauj Ruam
Windows 7: Cov Ntawv Qhia Cov Khoom Uas Tsis Muaj: Thaum twg los peb xaiv ntau dua 15 cov ntaub ntawv hauv Windows. qee yam khoom los ntawm cov ntawv qhia zaub mov ploj mus … Cov ntawv qhia no yuav qhia koj yuav ua li cas kom tau txais cov khoom ntawd rov qab los ntawm cov ntawv qhia zaub mov
Yuav Ntsuas Li Cas Ntsuas Kev Siv Lub Hwj Chim ntawm Kev Sib Txuas Lus Wireless hauv Era ntawm Kev Siv Hluav Taws Xob?: 6 Cov Kauj Ruam
Yuav Ua Li Cas Ntsuas Kom Tau Txais Kev Siv Lub Hwj Huam ntawm Kev Sib Txuas Lus Wireless hauv Era ntawm Kev Siv Hluav Taws Xob? Feem ntau IoT nodes yuav tsum tau siv lub roj teeb. Tsuas yog los ntawm kev ntsuas ntsuas lub zog siv ntawm lub wireless wireless peb tuaj yeem kwv yees kwv yees ntau npaum li cas roj teeb kuv
Kev Ntsuas Kub Siv Esp32 thiab Thingsio.ai Platform: 6 Kauj Ruam
Kev Ntsuas Kub Siv Esp32 thiab Thingsio.ai Platform: Hauv qhov kev qhia no kuv yuav piav qhia txog kev ntsuas qhov ntsuas kub nyob ib puag ncig los ntawm kev siv lub ntsuas ntsuas kub hauv lub cev tam sim no hauv esp32 pawg thawj coj loj. esp32 muaj ntau yam inbuilt sensors zoo li lub sensor sensor siv ua qhov sib thooj sensor, kov
Cov cuab yeej cuab tam - Ceramic hauv Cov Ntsiab Lus ntawm Cov Txheej Txheem Digital thiab Analog 2015: 3 Cov Kauj Ruam (nrog Duab)
Cov cuab yeej cuab tam - Ceramic hauv Cov Ntsiab Lus ntawm Digital thiab Analog Cov Txheej Txheem 2015: Txog tam sim no, cov khoom siv hlau yog cov khoom siv tes ua uas tsis muaj kev cuam tshuam digital. Vim li no, nws zoo siab heev los ua phooj ywg nrog cov cuab yeej tshiab. Lub hauv paus pib yog daim ntawv qub thiab CNC Styrocutter.DESIGNBOOM
Kaw Cov Suab rau Yeeb Yaj Kiab thiab Animations: Ob peb Cov Lus Qhia Ceev thiab Cov Lus Qhia: 8 Kauj Ruam
Kaw Cov Suab rau Yeeb Yaj Kiab thiab Animations: Ob peb Cov Lus Qhia Ceev thiab Ua Ntej: Yog tias koj yog tus kws kos duab, lossis tsuas yog menyuam yaus uas nyiam ua qee zaum ua cov yeeb yaj kiab rau youtube, tej zaum koj yuav muaj ob peb qhov teeb meem nrog kaw lub suab. Tsis muaj teeb meem li cas visually zoo cov vis dis aus lossis cov animation yuav yog, yog tias cov neeg saib nws tuaj yeem