Cov txheej txheem:
- Kauj Ruam 1: Qhia tawm
- Kauj ruam 2: Sib dhos
- Kauj Ruam 3: Sib dhos - Rooj
- Kauj ruam 4: Ubidots
- Kauj Ruam 5: SimpleDHT Library
- Kauj Ruam 6: PubSubClient Library
- Kauj Ruam 7: TinyGSM Library
- Kauj Ruam 8: TFT_eSPI Library
- Kauj Ruam 9: TFT_eSPI Library
- Kauj ruam 10: Ubidots
- Kauj Ruam 11: Hloov Cov Ntaub Ntawv hauv.ino
- Kauj Ruam 12: GPRS_ESP32_DHT.ino - Kev Tshaj Tawm thiab Kev Hloov
- Kauj ruam 13: Pinning
- Kauj ruam 14: Teeb tsa
- Kauj ruam 15: SetupDisplay
- Kauj Ruam 16: Teeb GSM
- Kauj Ruam 17: Txuas MQTTServer
- Kauj Ruam 18: Loop
- Kauj Ruam 19: Nyeem DHT
- Kauj ruam 20: Tshaj tawm MQTT
- Kauj ruam 21: TsimJsonString
- Kauj ruam 22: ShowDataOnDisplay
- Kauj ruam 23: Cov ntaub ntawv
Video: IOT Nrog Cellular Network Nrog ESP32: 23 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Hnub no peb yuav tham txog GPRS modem, lossis theej, ESP32 thiab nws siv nrog lub xov tooj ntawm tes. Nov yog qee yam uas ua haujlwm tau zoo heev. Siv cov txheej txheem MQTT, peb mam li xa cov ntaub ntawv mus rau Ubidots dashboard. Siv nyob rau hauv qhov kev sib dhos no tso saib cov lus pom ntawm lub Circuit Court, ntxiv rau SIM800L thiab lub xov tooj ntawm tes. Nrog txoj haujlwm no, yog li ntawd, peb yuav xa cov ntaub ntawv ntsuas kub thiab av noo los ntawm GPRS thiab MQTT, thiab pom cov ntaub ntawv hauv kab ntawv kab.
Kauj Ruam 1: Qhia tawm
Kauj ruam 2: Sib dhos
Kauj Ruam 3: Sib dhos - Rooj
Kauj ruam 4: Ubidots
Kauj Ruam 5: SimpleDHT Library
Hauv Arduino IDE, mus rau Sketch-> Xws li Tsev Kawm Ntawv-> Tswj Tsev Qiv Ntawv …
Nruab SimpleDHT
Kauj Ruam 6: PubSubClient Library
Hauv Arduino IDE, mus rau Sketch-> Xws li Tsev Kawm Ntawv-> Tswj Tsev Qiv Ntawv …
Nruab PubSubClient
Kauj Ruam 7: TinyGSM Library
Hauv Arduino IDE, mus rau Sketch-> Xws li Tsev Kawm Ntawv-> Tswj Tsev Qiv Ntawv …
Nruab TinyGSM
Kauj Ruam 8: TFT_eSPI Library
Hauv Arduino IDE, mus rau Sketch-> Xws li Tsev Kawm Ntawv-> Tswj Tsev Qiv Ntawv …
Nruab TFT_eSPI
Kauj Ruam 9: TFT_eSPI Library
Hloov cov zaub pins hauv cov ntawv tais ceev tseg.
Tus pinning yog nyob rau hauv User_Setup.h cov ntaub ntawv hauv
C: / Users / Documents / Arduino / libraries / TFT_eSPI
Hloov cov teeb meem no mus rau cov txiaj ntsig hauv qab no hauv daim duab.
Kauj ruam 10: Ubidots
Nkag mus rau Ubidots nrog koj tus lej nyiaj thiab nyem rau ntawm Devices
Nyem rau "+" khawm nyob rau sab xis saum toj
Nyem qhov khoob
Sau lub npe ntaus ntawv. Nco tseg "daim ntawv lo ntaus ntawv," vim qhov no yuav siv rau hauv "ncauj lus" uas peb yuav siv hauv.ino
Hauv cov npe khoom siv, lub cuab yeej uas koj nyuam qhuav tsim yuav tshwm. Nyem rau nws.
Ntawm qhov screen uas tshwm, nyem rau ntawm "Add Variable." Ib qho popup yuav tshwm. Nyem rau ntawm "Raw."
Nyem rau kab ntawv kab ntawv, thiab sau lub npe ntawm lub cuab yeej.
Nws yuav tsum yog yam peb yuav xa hauv json ntawm.ino. Rov ua qhov no rau lwm qhov khoom.
Rov qab mus rau lub dashboard los ntawm nyem rau ntawm Ubidots logo.
Hauv lub dashboard, nyem rau ntawm "Ntxiv Widget tshiab"
Hauv cov npe ntawm Widgets, xaiv "Ob chav axis"
Kauj Ruam 11: Hloov Cov Ntaub Ntawv hauv.ino
Kauj Ruam 12: GPRS_ESP32_DHT.ino - Kev Tshaj Tawm thiab Kev Hloov
#define TINY_GSM_MODEM_SIM800 // Tipo de modem que estamos usando #suav nrog #include #include #include #include // Token de usuário que pegamos no Ubidots #define TOKEN "BBFF-abcdefghijklmnopqrstuvwosz012 deo de umos de suos de tempo" (esp32_gprs é o nome do dispositivo no Ubidots) #define TOPIC "/v1.6/devices/esp32_gprs" // id do dispositivo que pegamos no painel do Ubidots #define DEVICE_ID "5c01234567890abc12345678" URL URL mqtt: //things.ubidots.com "// Porta padrão do MQTT #define MQTT_PORT 1883 // Pino onde está o DHT22 #define DHT_PIN 27
Kauj ruam 13: Pinning
// Pinagem em User_Setup.h na pasta da bibliotecaTFT_eSPI zaub = TFT_eSPI (); // Intervalo entre os envios e refresh da tela #define INTERVAL 10000 // Canal serial que vamos usar para comunicarmos com o modem. Siv semper 1 HardwareSerial SerialGSM (1); TinyGsm modemGSM (SerialGSM); TinyGsmClient gsmClient (modemGSM); // Cliente MQTT, passamos a url do server, porta // e o cliente GSM PubSubClient tus thov kev pab (MQTT_SERVER, MQTT_PORT, gsmClient); // Tempo em que o imoltimo envio/refresh foi feito uint32_t lastTime = 0; ntab dej; // Variável onde iremos armazenar o valor da umidade ntab kub; // Variável onde iremos armazenar o valor da temperatura SimpleDHT22 dht; // Ob qho tib si ua raws cov lus qhia thiab kev coj ua hauv lub cev
Kauj ruam 14: Teeb tsa
teeb tsa tsis muaj dab tsi () {Serial.begin (115200); setupDisplay (); // Txheeb xyuas qhov teeb tsa lossis teeb tsa teeb tsa GSM (); // Txheeb xyuas qhov teeb tsa ntawm modem GSM txuas MQTTServer (); // Conectamos ao mqtt server // Espera 2 segundos e limpamos o display delay (2000); display.fillScreen (TFT_BLUE); display.setCursor (0, 0); }
Kauj ruam 15: SetupDisplay
void setupDisplay () {display.init (); display.setRotation (1); display.fillScreen (TFT_BLUE); // Limpa o display com a cor azul display.setTextColor (TFT_WHITE, TFT_BLUE); // Coloca o texto como branco com fundo azul display.setTextWrap (tseeb, tseeb); // Ativa quebra de linha display.setTextSize (1); display.setCursor (0, 0, 2); // Posicção x, y e fonte do texto display.println ("Setup Display Complete"); }
Kauj Ruam 16: Teeb GSM
void setupGSM () {display.println ("Teeb GSM …"); // Inicializamos a serial onde está o modem SerialGSM.begin (9600, SERIAL_8N1, 4, 2, cuav); ncua (3000); // Mostra informação sobre o modem Serial.println (modemGSM.getModemInfo ()); // Inicializa o modem if (! ModemGSM.restart ()) {display.println ("Restarting GSM Modem ua tsis tau tejyam"); ncua (10000); ESP.restart (); rov qab; } // Espera pela rede yog (! ModemGSM.waitForNetwork ()) {display.println ("Ua tsis tau txuas rau network"); ncua (10000); ESP.restart (); rov qab; } // Conecta de rede gprs (APN, usuário, senha) yog (! ModemGSM.gprsConnect ("", "", "")) {display.println ("GPRS Kev Txuas Tsis Tau"); ncua (10000); ESP.restart (); rov qab; } display.println ("Teeb GSM Ua Tau Zoo"); }
Kauj Ruam 17: Txuas MQTTServer
void connectMQTTServer () {display.println ("Txuas rau MQTT Server …"); // Se conecta ao device que definimos if (client.connect (DEVICE_ID, TOKEN, "")) {// Se conexão foi bem sucedida display.println ("Txuas"); } lwm tus {// Se ocorreu algum erro display.print ("yuam kev ="); display.println (client.state ()); ncua (10000); ESP.restart (); }}
Kauj Ruam 18: Loop
tsis muaj dab tsi voj () {// Ua raws li cov lus qhia thiab ntsuas kub readDHT (); // Se desconectou ua server MQTT yog (! Client.connected ()) {// Mandamos conectar connectMQTTServer (); } // Tempo decorrido desde o boot em milissegundos unsigned ntev tam sim no = millis (); // Se passou o intervalo de envio if (now - lastTime> INTERVAL) {// Publicamos para o server mqtt publishMQTT (); // Mostramos os dados tsis muaj zaub showDataOnDisplay (); // Atualizamos o tempo em que foi feito o imoltimo envio lastTime = tam sim no; }}
Kauj Ruam 19: Nyeem DHT
void readDHT () {ntab t, h; // Faz a leitura da umidade e temperatura e apenas atualiza as variáveis se foi bem sucedido if (dht.read2 (DHT_PIN, & t, & h, NULL) == SimpleDHTErrSuccess) {kub = t; av noo = h; }}
Kauj ruam 20: Tshaj tawm MQTT
void publishMQTT () {// Cria o json que iremos enviar para o server MQTT String msg = createJsonString (); Serial.print ("Tshaj tawm cov lus:"); Serial.println (msg); // Publicamos tsis muaj tópico int xwm txheej = client.publish (TOPIC, msg.c_str ()); Serial.println ("Status:" + String (status)); // Status 1 se sucesso ou 0 se deu erro}
Kauj ruam 21: TsimJsonString
Txoj hlua createJsonString () {Cov ntaub ntawv hlua = "{"; yog (! isnan (av noo) &&! isnan (kub)) {data+= "\" humidity / ":"; cov ntaub ntawv+= Txoj hlua (av noo, 2); cov ntaub ntawv+= ","; data+= "\" kub / ":"; cov ntaub ntawv+= Txoj hlua (qhov kub thiab txias, 2); } cov ntaub ntawv+= "}"; xa cov ntaub ntawv; }
Kauj ruam 22: ShowDataOnDisplay
void showDataOnDisplay () {// Reseta posição do cursor e mostra umidade e temperatura lidas display.setCursor (0, 0, 2); display.println ("Vaum:" + Txoj hlua (av noo, 2)); display.println ("Kub:" + Txoj hlua (kub, 2)); }
Kauj ruam 23: Cov ntaub ntawv
Rub tawm cov ntawv
INO
Pom zoo:
Hloov-Hloov Cov Khoom Ua Si: Cov Khoom Ua Si Cov Khoom Ua Si Ua Tau Zoo!: 7 Cov Kauj Ruam (nrog Duab)
Hloov-Hloov Cov Khoom Ua Si: Cov Khoom Siv Hluav Taws Xob Ua Tau Zoo!: Qho khoom ua si hloov pauv qhib txoj hauv kev tshiab thiab kev daws teeb meem kom tso cai rau menyuam yaus uas muaj lub cev muaj peev xwm txwv lossis kev xiam oos qhab kev loj hlob los cuam tshuam nrog cov khoom ua si ntawm nws tus kheej. Hauv ntau qhov xwm txheej, cov menyuam yaus uas xav tau cov khoom ua si hloov pauv tsis tuaj yeem nkag mus
Cov av noo noo Cov Lus Qhia Tswj Xyuas Internet Txuas Cov Dej Dej (ESP32 thiab Blynk): 5 Cov Kauj Ruam
Cov av noo noo Cov lus pom zoo Tswj Xyuas Internet Txuas Cov Dej Dej (ESP32 thiab Blynk): Tsis txhawj xeeb txog koj lub vaj lossis nroj tsuag thaum koj mus rau hnub so ntev, lossis tsis nco qab ywg dej koj cov nroj tsuag txhua hnub. Zoo ntawm no yog kev daws teeb meem Nws cov av ya raws tswj hwm thiab thoob ntiaj teb txuas nrog cov dej txau dej tswj los ntawm ESP32 ntawm software pem hauv ntej kuv
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
IOT Smoke Detector: Hloov Kho Cov Hluav Taws Xob Uas Muaj Cov IOT: 6 Cov Kauj Ruam (nrog Duab)
IOT Cov Ntsuas Hluav Taws Xob: Hloov Kho Cov Hluav Taws Xob Uas Muaj Cov IOT: Cov npe ntawm cov koom nrog, Tus tsim tawm: Tan Siew Chin, Tan Yit Peng, Tan Wee Heng Tus Thawj Saib Xyuas: Dr Chia Kim Seng Department of Mechatronic thiab Robotic Engineering, Kws qhia ntawv ntawm Hluav Taws Xob thiab Hluav Taws Xob, Universiti Tun Hussein Onn Malaysia Kev faib tawm
Yuav Ua Li Cas Thiaj Li Sib Koom Cov Yees Duab thiab Cov Ntaub Ntawv Network Los Ntawm Ethernet Cable: 6 Cov Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Thiaj Li Ua Ke Cov Yees Duab thiab Network Cov Ntaub Ntawv Los ntawm Ethernet Cable: Kuv xav tau los khiav Video thiab Suab mus rau lwm qhov ntawm kuv lub tsev. Teeb meem yog, Kuv tsis muaj AV cable ntau, tsis yog lub sijhawm thiab nyiaj txiag los teeb tsa zoo. Txawm li cas los xij kuv tau muaj Cat 5 Ethernet Cable ntau nyob ib puag ncig. Nov yog qhov kuv tuaj nrog