Cov txheej txheem:

IOT123 - ASSIMILATE SENSOR HUB: ICOS10 CORS WEBCOMPONENTS: 8 Kauj Ruam
IOT123 - ASSIMILATE SENSOR HUB: ICOS10 CORS WEBCOMPONENTS: 8 Kauj Ruam

Video: IOT123 - ASSIMILATE SENSOR HUB: ICOS10 CORS WEBCOMPONENTS: 8 Kauj Ruam

Video: IOT123 - ASSIMILATE SENSOR HUB: ICOS10 CORS WEBCOMPONENTS: 8 Kauj Ruam
Video: Indefinite Pitch PREMIERES. Mod.1 - Into The Circle [Linderluft Records] 2024, Hlis ntuj nqeg
Anonim
IOT123 - ASSIMILATE SENSOR HUB: ICOS10 CORS WEBCOMPONENTS
IOT123 - ASSIMILATE SENSOR HUB: ICOS10 CORS WEBCOMPONENTS
IOT123 - ASSIMILATE SENSOR HUB: ICOS10 CORS WEBCOMPONENTS
IOT123 - ASSIMILATE SENSOR HUB: ICOS10 CORS WEBCOMPONENTS

ASSIMILATE SENSOR/ACTOR Qhev embed metadata uas yog siv rau kev txheeb xyuas qhov pom hauv Crouton. Qhov kev tsim no txawv me ntsis los ntawm yav dhau los; tsis muaj kev hloov kho vajtse. Tam sim no lub khoos phis tawj txhawb nqa tus tswv kev cai (nplua nuj) cov kws kho uas tuaj yeem koom ua ke rau hauv kev tsim kho tshiab ntawm AssimilateCrouton. Yuav muaj kev saib xyuas ntau ntxiv los piav qhia qhov firmware thiab MQTT dashboard hauv kab lus no.

Ib qhov zoo ntawm kev ua haujlwm WebComponents los ntawm lub cuab yeej uas lawv tswj hwm, yog qhov kev tswj tau zoo dua ntawm lub cuab yeej raug txwv rau lub network uas lub cuab yeej txuas nrog: koj li WiFi Access Point. Txawm hais tias ib zaug koj siv MQTT server nrog kev txheeb xyuas qhov tseeb muaj qhov zoo sib xws ntawm kev tiv thaiv, ntawm pej xeem cov tes hauj lwm yog tias koj tawm ntawm koj tus browser ib ntus (AssimilateCrouton lub vev xaib) ib tus neeg tuaj yeem dhia hauv thiab tswj koj cov cuab yeej siv tshuab. CORS WebComponent feature no ua rau nws muaj peev xwm tsuas yog nyeem (ntsuas sov, qib teeb, noo) qhia rau pej xeem thiab hais kom ua haujlwm (rau/tawm, teem sijhawm) tsuas yog muaj los ntawm lub cuab yeej network.

Ntawm lub cuab yeej, txhua qhov ntawm cov vev xaib uas muaj kev lees paub thiab ua tus tswv hauv SPIFFS tseem tau txhawb nqa, tab sis kev tsom tshwj xeeb tau ua rau CORS (Hla Hla Keeb Kwm Cov Khoom Siv Sib Koom) txhawb rau Polymer WebComponents (Crouton siv Polymer 1.4.0).

Hauv AssimilateCrouton (rab diav rawg ntawm Crouton siv rau Assimilate IOT Network) cov kev hloov pauv suav nrog

  • txhawb nqa rau Daim Npav Ntaus Ntawv (khoom siv-cuab yeej) uas ntawm lwm yam qhia thiab zais, rau tus neeg siv, daim npav ib leeg rau lub cuab yeej
  • cov ntaub ntawv cov cuab yeej ntawm txhua daim npav uas qhia qhov toast ntawm cov ntaub ntawv muaj txiaj ntsig zoo rau daim npav
  • kev txhawb nqa rau CORS webcomponents, hauv qhov no tuav ntawm lub vev xaib ntawm lub cuab yeej (ESP8266).

Kauj ruam 1: CROUTON

CROUTON
CROUTON
CROUTON
CROUTON

Croutonis lub dashboard uas tso cai rau koj pom thiab tswj koj li IOT cov cuab yeej nrog teeb tsa me me. Qhov tseem ceeb, nws yog daim ntawv yooj yim tshaj plaws los teeb tsa rau ib qho IOT khoos phis tawj uas siv MQTT thiab JSON nkaus xwb.

ASSIMILATE SLAVES (cov cim thiab cov ua yeeb yam) tau teeb tsa cov metadata thiab cov khoom uas tus tswv siv los tsim cov cuab yeej Info json pob ntawv uas Crouton siv los tsim lub dashboard. Tus neeg nruab nrab ntawm ASSIMILATE NODES thiab Crouton yog MQTT tus broker uas yog websockets tus phooj ywg: Yoov tshaj cum tau siv rau qhov kev qhia.

Raws li ASSIMILATE MASTER thov cov khoom, nws ua cov lus teb qhov tseem ceeb hauv hom ntawv xav tau rau Crouton hloov tshiab. AssimilateCrouton diav rawg ntxiv qee qhov tshwj xeeb uas ua rau koj faib txoj cai kev lag luam uas khiav koj lub cuab yeej piv txwv li IOT lub cuab yeej tsis xav tau ib qho kev cai ua lag luam cuam tshuam, nws tsuas yog lub raj xa dej rau MQTT/I2C kev sib txuas lus kom ntse dua (ATTINY tswj) qhev tus ua yeeb yam thiab cov cim.

Kauj Ruam 2: ASSIMILATE CROUTON

ASSIMILATE CROUTON
ASSIMILATE CROUTON

Hloov mus rau CROUTON

Kev hloov pauv los ntawm forked version suav nrog:

  • yog tias qhov kawg muaj txheej txheem txheej txheem piav qhia, WebComponent rau daim npav yuav ua HTMLImport rau CORS cov peev txheej (lub vev xaib ntawm ESP8266 hauv qhov tsim no).
  • ib qho peev txheej ntws los ntawm (kev vam khom ntawm) CORS WebComponent yog hais txog yog tias lawv tau txais kev pabcuam los ntawm Crouton lub vev xaib; thaum lawv ua tsis tiav qhov kev zam tshwj xeeb cov neeg ua haujlwm rejigs txoj hauv kev thiab thauj khoom yog los ntawm lub vev xaib.
  • lub sijhawm tam sim no hauv cheeb tsam tau tso tawm sab xis saum toj, muaj txiaj ntsig zoo rau kev teem sijhawm txheeb xyuas.

POLYMER DEPENDENCIES THIAB CORS

Cov nplooj ntawm tsob ntoo vam khom Polymer tuaj yeem tuav hauv CORS. Vim tias lub hauv paus kev vam khom yuav siv ntau zaus hauv app, lawv tsis tuaj yeem hais los ntawm 2 qhov chaw (lub vev xaib thiab lub cuab yeej) vim tias Polymer Module Loader kho lawv li 2 cais cov peev txheej thiab ntau qhov yuam kev sau npe sai sai flounder daim ntawv thov.

Vim li no WebComponent rau daim npav (HTML cov ntaub ntawv hauv 1.4.0) thiab cov ntaub ntawv CSS cuam tshuam yog cov ntaub ntawv nkaus xwb tuav ntawm lub cuab yeej. Lwm qhov kev cia siab tau hais txog yog tias WebComponent tau tuav hauv "html" nplaub tshev ntawm lub vev xaib, uas ua rau nws yooj yim los txhim kho WebComponents los ntawm cov ntawv ntawd kom txog thaum npaj xa mus rau SPIFFS ntawm ESP8266. AssimilateCrouton yuav ua haujlwm li cas kom tau txais cov ntaub ntawv raug.

QHOV TSEEB

edfungus tus tsim ntawm thawj Crouton sau qhov chaw hauv Pug/Tsawg thiab muaj NPM/Grunt toolchain. Kuv ua tus Pug/Tsawg dua li HTML/css thiab tsuas yog kho/faib cov ntawv xa tawm. Qhov no tsoo NPM/Grunt toolchain. Kev kho qhov no tau them rau hauv FUTURE ntu.

Koj tuaj yeem kuaj lub dashboard hauv zos ntawm koj lub npov DEV:

  • Los ntawm cov kab hais kom ua hauv paus hauv paus
  • npm nce
  • cov lite-server tau tig rau https:// localhost: 10001

Xa mus rau lub vev xaib zoo li qub:

  • theej tag nrho cov ntawv tshwj tsis yog node_modules
  • luam index.html (thiab tej zaum web.config)

FUTURE

Ib lub hom phiaj tseem ceeb yog hloov kho rau Polymer3 thiab ua haujlwm los ntawm Polymer CLI. Ntxiv cov kws kho dua tshiab thiab cov txheej txheem rau IOT cov neeg tsim khoom los txhim kho lawv tus kheej yog qhov tseem ceeb tshaj. Thaum kawg lub tshuab ua haujlwm siab heev yuav ua tiav los ntawm kev sib cais MQTT cov neeg siv zoo li AssimilateCrouton.

Ib qho piv txwv ntawm pob ntawv ntaus ntawv siv rau AssimilateCrouton:

{
"ntaus ntawv info": {
"endPoints": {
"CC_device": {
"device_name": "ash_mezz_A3",
"card-type": "assim-device",
"ssid": "Corelines_2",
"ip_addr": "192.168.8.104",
"endpoints": [
{
"title": "Teeb Teeb",
"daim npav-hom": "crouton-yooj yim-toggle",
"endpoint": "hloov"
},
{
"title": "Cov Teeb Pom Kev",
"daim npav-hom": "crouton-assim-weekview",
"endpoint": "CC_switch"
}
]
},
"CC_switch": {
"card-type": "assim-weekview",
"cov ntaub ntawv": "Teeb lub teeb rau lossis tua hauv 15 feeb sijhawm",
"txoj kev": "https://192.168.8.104/cors",
"title": "Cov Teeb Pom Kev",
"interval_mins": 15,
"qhov tseem ceeb": {
"tus nqi": ""
}
},
"hloov": {
"title": "Teeb Teeb",
"daim npav-hom": "crouton-yooj yim-toggle",
"info": "Qhib teeb rau lossis tua ntawm qhov chaw tshwj xeeb",
"cov ntawv": {
"cuav": "OFF",
"tseeb": "ON"
},
"cov cim": {
"cuav": "sun-o",
"tseeb": "sun-o"
},
"qhov tseem ceeb": {
"tus nqi": 0
}
}
},
"status": "zoo",
"npe": "ash_mezz_A3",
"kev piav qhia": "Chaw ua haujlwm ntawm Ashmore, Mezzanine, Cheeb Tsam A2",
"xim": "#4D90FE"
}
}

saib rawdeviceInfo.json tuav nrog ❤ los ntawm GitHub

Kauj Ruam 3: DEVICE ASSEMBLY

DEVICE ASSEMBLY
DEVICE ASSEMBLY
DEVICE ASSEMBLY
DEVICE ASSEMBLY
DEVICE ASSEMBLY
DEVICE ASSEMBLY

Raws li tsis muaj kev hloov kho vajtse, ntawm no yog cov txuas mus rau cov ntaub ntawv cuam tshuam:

  • Plhaub Los Ua Ke
  • Cov Ntaub Ntawv thiab Cov Cuab Yeej
  • Kev Npaj MCU
  • Kev Npaj Tsev MCU
  • Txhim Kho Tus Qhev Qis Tsawg Sab Hloov/RESET Daughter-board
  • Sib dhos Cov Cheeb Tsam Loj

Kauj ruam 4: FIRMWARE

FIRMWARE
FIRMWARE
FIRMWARE
FIRMWARE
FIRMWARE
FIRMWARE
FIRMWARE
FIRMWARE

MAIN hloov lub tsev no

Txhawm rau AssimilateCrouton daim ntawv thov tuaj yeem siv CORS cov peev txheej los ntawm lub cuab yeej, cov lus teb yuav tsum tau teeb tsa hauv ib txoj hauv kev tshwj xeeb. Qhov no tau ua tiav hauv qhov kev tso tawm ntawm firmware (static_server.ino => server_file_read ()).

Tsis tas li lub ntsiab kev vam khom rau Polymer xav tau los ntawm ib tus neeg tuaj. Ib lub tswv yim tau siv los ntxiv tus neeg ua haujlwm tsis txaus ntseeg (corsLinkOnError) rau SPIFFS CORS cov ntaub ntawv txhawm rau rov qhib cov peev txheej los ntawm AssimilateCrouton lub vev xaib thaum lawv tsis pom ntawm lub cuab yeej.

Muaj 2 qhov kev pom zoo tshiab ntxiv rau SPIFFS cov ntaub ntawv system rau kev kho tus kheej qhov kawg uas tau tsim hauv deviceInfo - uas AssimilateCrouton siv los tsim daim npav dashboard:

  • /config/user_card_base.json Endpoint definition nrog runtime variables raug pauv ua ntej:,,. Qhov no feem ntau yog qhov twg daim npav assim-device yuav raug ntxiv. Qhov no tsis sib txuas lus rov qab nrog lub cuab yeej.
  • /config/user_card_#.json Endpoint definition nrog runtime variables raug pauv ua ntej:,,. Qhov no feem ntau yog qhov uas cov kws kho kom zoo nkauj zoo li daim npav assim-lub limtiam saib yuav raug txuas ntxiv mus rau I2C qhev (tus ua yeeb yam/sensor) uas cuam tshuam nrog #.

COV LUS QHIA/LIBRARIES

Nyob rau theem no txoj haujlwm tau muab ntim ua piv txwv rau lub tsev qiv ntawv AssimilateBus Arduino. Qhov no feem ntau yog ua kom txhua cov ntaub ntawv tsim nyog nkag tau yooj yim los ntawm Arduino IDE. Lub ntsiab cai tsim khoom yog:

  • mqtt_crouton_esp8266_cors_webcomponents.ino - lub ntsiab nkag nkag.
  • assimilate_bus.h/assimilate_bus.cpp - lub tsev qiv ntawv uas saib xyuas I2C kev sib txuas lus nrog Slave Sensor/Actors
  • VizJson.h/VizJson.cpp - lub tsev qiv ntawv uas tawm tswv yim/tsim ib qho JSON luam tawm ntawm MQTT
  • config.h/config.cpp - lub tsev qiv ntawv uas nyeem/thawv/sau teeb tsa cov ntaub ntawv ntawm SPIFFS
  • static_i2c_callbacks.ino - I2C callbacks rau cov khoom tau txais thiab lub voj voog ntawm qhev thov kom ua tiav static_mqtt.ino - MQTT cov haujlwm
  • static_server.ino - lub webserver ua haujlwm
  • static_utility.ino - cov haujlwm pabcuam

Cov haujlwm INO zoo li qub tau siv (hloov chaw qiv ntawv) rau ntau yam laj thawj, tab sis feem ntau yog li ntawd lub vev xaib thiab cov haujlwm MQTT tuaj yeem ua haujlwm zoo ua ke.

LUB SPIFFS RESOURCES

Cov lus piav qhia ntxaws txog cov ntaub ntawv SPIFFS tuaj yeem pom ntawm no.

  • favicon.ico - peev txheej siv los ntawm Ace Editor
  • teeb tsa
    • device.json - teeb tsa rau lub cuab yeej (Wifi, MQTT…)
    • slave_metas _#. json - tsim tawm ntawm runtime rau txhua tus qhev chaw nyob tus lej (#)
    • user_card _#. json - kev cai kawg kom tau muab tso ua ke hauv deviceInfo rau txhua tus qhev chaw nyob tus lej (#)
    • user_card_base.json - kev cai qhov kawg kom tau muab tso ua ke rau hauv deviceInfo rau lub cuab yeej
    • user_meta _#. json - kev cai metadata hla qhov qhev rau txhua tus qhev chaw nyob tus lej (#)
    • user_props.json - cov npe khoom tshwj xeeb los hla cov uas nyob hauv metadata ntawm cov qhev
  • cov cors

    • card -webcomponent.css - cov ntawv rau ntau daim npav kev cai
    • card -webcomponent.html - webcomponent rau ntau daim npav kev cai
  • tus kws kho mob

    • assimilate -logo-p.webp" />
    • edit.htm.gz - gzip ntawm Ace Editor HTML
    • edit.htm.src - thawj HTML ntawm Ace Editor
    • favicon -32x32-p.webp" />

UPLOADING LUB FIRMWARE

  • Cov chaw cia khoom tuaj yeem pom ntawm no (snapshot).
  • ZIP ntawm lub tsev qiv ntawv tuaj yeem pom ntawm no (snapshot).
  • Cov lus qhia rau "Ntshuam ZIP Library" ntawm no.
  • Thaum lub tsev qiv ntawv raug teeb tsa koj tuaj yeem qhib qhov piv txwv "mqtt_crouton_esp8266_cors_webcomponents".
  • Cov lus qhia rau teeb tsa Arduino rau Wemos D1 Mini ntawm no.
  • Kev vam khom: ArduinoJson, TimeLib, PubSubClient, NeoTimer (saib cov ntawv txuas yog ua txhaum kev hloov pauv hauv cov chaw cia khoom).

UPLOAD RAU SPIFFS

Thaum cov cai tau raug thauj mus rau Arduino IDE, qhib device.json hauv cov ntaub ntawv/teeb tsa nplaub tshev:

  • Hloov kho tus nqi ntawm wifi_ssid nrog koj li WiFi SSID.
  • Hloov kho tus nqi ntawm wifi_key nrog koj tus yuam sij WiFi.
  • Hloov kho tus nqi ntawm mqtt_device_name nrog qhov koj nyiam Ntaus Tus Kheej (tsis xav tau koom nrog).
  • Hloov kho tus nqi ntawm mqtt_device_description nrog qhov koj nyiam ntaus ntawv piav qhia (hauv Crouton).
  • Txuag device.json.
  • Muab cov ntaub ntawv xa mus rau SPIFFS.

Lub ntsiab nkag nkag rau AssimilateBus piv txwv:

/*
*
*Txoj cai tswj hwm kev lag luam rau koj lub cuab yeej tau xav kom tswj hwm los ntawm MQTT - Tsis nyuaj rau ci rau hauv FIRMWARE no
*
* Lwm yam tshaj li teeb tsa thiab voj nyob hauv cov ntawv no
* qhov tseem ceeb txav mus los yog
* on_bus_received thiab on_bus_complete hauv static_i2c_callbacks.ino
* thiab
* mqtt_publish thiab mqtt_callback hauv zoo li qub_mqtt.ino
*
*/
#suav nrog "hom.h"
#suav nrog "VizJson.h"
#suav nrog "assimilate_bus.h"
#suav nrog "debug.h"
#suav nrog "config.h"
#suav nrog

#suav nrog

// teeb tsa MQTT_MAX_PACKET_SIZE rau ~ 3000 (lossis koj xav tau rau deviceInfo json)

#suav nrog
#suav nrog
#suav nrog
#suav nrog
#suav nrog
// --------------------------------- MEMORY DECLARATIONS
// ----------------------------------------------------------------------- - txhais
#defineDBG_OUTPUT_FLAG2 // 0, 1, 2 MINIMUMUM, tso tawm, puv
#define_mqtt_pub_topic "outbox" // CROUTON CONVENTIONS
#define_mqtt_sub_topic "inbox"
// ----------------------------------------------------------------------- - chav kawm khoom
Debug _debug (DBG_OUTPUT_FLAG);
AssimilateBus _assimilate_bus;
VizJson _viz_json;
Config_config_data;
WiFiClient _esp_client;
PubSubClient _client (_esp_client);
WiFiUDP Udp;
ESP8266WebServer _server (80);
Neotimer _timer_property_request = Neotimer (5000);
// ----------------------------------------------------------------------- - cov ntaub ntawv teeb tsa / sib txawv
RuntimeDeviceData _runtime_device_data;
PropertyDto _dto_props [50]; // max 10 qhev x max 5 khoom
// ----------------------------------------------------------------------- - tswj ntws
volatilebool _sent_device_info = tsis tseeb;
byte _dto_props_index = 0;
bool _fatal_error = tsis tseeb;
// --------------------------------- FUNCTION SCOPE DECLARATIONS
// ----------------------------------------------------------------------- - zoo li qub_i2c_callbacks.ino
voidon_bus_received (byte qhev_address, byte prop_index, Lub luag haujlwm, lub npe char [16], tus nqi char [16]);
voidon_bus_complete ();
// ----------------------------------------------------------------------- - zoo li qub_mqtt.ino
voidmqtt_callback (char* ntsiab lus, byte* them nyiaj, tsis tau kos npe ntev);
voidmqtt_loop ();
int8_tmqtt_get_topic_index (char* ntsiab lus);
voidmqtt_init (constchar* wifi_ssid, constchar* wifi_password, constchar* mqtt_broker, int mqtt_port);
voidmqtt_create_subscriptions ();
voidmqtt_publish (char *root_topic, char *deviceName, char *endpoint, constchar *payload);
boolmqtt_ensure_connect ();
voidmqtt_subscribe (char *root_topic, char *deviceName, char *endpoint);
voidi2c_set_and_get (byte chaw nyob, byte code, constchar *param);
// ----------------------------------------------------------------------- - zoo li qub_server.ino
String server_content_type_get (String filename);
boolserver_path_in_auth_exclusion (Txoj hlua);
boolserver_auth_read (Txoj hlua);
boolserver_file_read (Txoj hlua);
voidserver_file_upload ();
voidserver_file_delete ();
voidserver_file_create ();
voidserver_file_list ();
voidserver_init ();
voidtime_services_init (char *ntp_server_name, byte time_zone);
time_tget_ntp_time ();
voidsend_ntp_packet (IPAddress & chaw nyob);
char *sijhawm_stamp_get ();
// ----------------------------------------------------------------------- - zoo li qub_utility.ino
Txoj hlua spiffs_file_list_build (Txoj hlua);
voidreport_deserialize_error ();
voidreport_spiffs_error ();
boolcheck_fatal_error ();
boolget_json_card_type (byte qhev_address, byte prop_index, char *card_type);
boolget_struct_card_type (byte qhev_address, byte prop_index, char *card_type);
boolget_json_is_series (byte qhev_address, byte prop_index);
voidstr_replace (char *src, constchar *oldchars, char *newchars);
byte get_prop_dto_idx (byte qhev_address, byte prop_index);
// --------------------------------- MAIN
voidsetup () {
DBG_OUTPUT_PORT.begin (115200);
SetupDeviceData device_data;
Serial.println (); Serial.println (); // margin rau console rubbish
ncua (5000);
yog (DBG_OUTPUT_FLAG == 2) DBG_OUTPUT_PORT.setDebugOutput (tseeb);
_debug.out_fla (F ("teeb tsa"), tseeb, 2);
// tau txais kev teeb tsa
yog (SPIFFS.begin ()) {
_debug.out_str (spiffs_file_list_build ("/"), tseeb, 2);
yog (! _config_data.get_device_data (device_data, _runtime_device_data)) {
qhia_deserialize_error ();
rov qab;
}
lwm yam {
qhia_spiff_error ();
rov qab;
}
// siv tus nqi timer teeb tsa hauv device.json
_timer_property_request.set (device_data.sensor_interval);
mqtt_init (device_data.wifi_ssid, device_data.wifi_key, device_data.mqtt_broker, device_data.mqtt_port);
time_services_init (device_data.ntp_server_name, device_data.time_zone);
server_init ();
// ncaws tawm cov metadata sau
_assimilate_bus.get_metadata ();
_assimilate_bus.print_metadata_details ();
mqtt_ensure_connect ();
// xav tau cov cuab yeej sensor (npe) kom ua tiav cov metadata sau
_assimilate_bus.get_properties (on_bus_received, on_bus_complete);
_timer_property_request.reset (); // tuaj yeem ua rau lub sijhawm ceeb toom txog qhov no yog li pib nws dua
}
voidloop () {
yog (! check_fatal_error ()) rov qab;
mqtt_loop ();
_server.handleClient ();
yog (_timer_property_request.repeat ()) {
_assimilate_bus.get_properties (on_bus_received, on_bus_complete);
}
}

saib rawmqtt_crouton_esp8266_cors_webcomponents.ino tuav nrog ❤ los ntawm GitHub

Kauj Ruam 5: DEVICE CARD

DEVICE CARD
DEVICE CARD
DEVICE CARD
DEVICE CARD
DEVICE CARD
DEVICE CARD
DEVICE CARD
DEVICE CARD

Daim npav ntaus ntawv (daim npav hom: assim-device) tau teeb tsa hauv lub vev xaib thiab nws tsis tas yuav tsum tau ua haujlwm los ntawm lub cuab yeej (CORS).

Nws cov nplooj ntawv teev npe tsis raug:

  • MQTT cov ncauj lus rau kev nyeem thiab sau ntawv mus rau lub cuab yeej
  • Access Point lub cuab yeej txuas nrog
  • Ib qhov txuas mus rau SPIFFS cov ntaub ntawv kho tus tswv ntawm lub cuab yeej siv ACE EDITOR
  • Ib lub qhov muag cim uas qhia tawm Qhia/Hide daim npav nplooj ntawv.

Qhia/Hide daim npav nplooj ntawv teev npe:

  • Txhua daim npav ua khoom cais
  • Cov xim xiav loj thaum qhia
  • Dub ib txwm font thaum zais
  • Ib lub cim qhia txog hom daim npav.

Daim npav tuaj yeem muab zais los ntawm kev nyem khawm nkaum ntawm daim npav, lossis nyem rau ntawm daim ntawv xiav-bold-font hauv cov npe. Cov npav tuaj yeem pom los ntawm txhaj rau ntawm cov khoom dub-ib txwm-font hauv cov npe.

Loosely cuam tshuam nrog cov yam ntxwv no yog cov ntaub ntawv toasts. Yog tias ib qho ntawm cov ntsiab lus kawg hauv deviceInfo muaj cov ntaub ntawv xov xwm muab rau, cov ntaub ntawv khawm yuav tshwm nyob ib sab ntawm khawm zais ntawm daim npav. Thaum nyem cov ntsiab lus cov ntsiab lus txhais hauv qhov kawg yuav "toasted" rau ntawm lub qhov rais.

Yog tias daim npav ntaus ntawv tsis tau hais tseg, cov khawm zais yuav tsis pom ntawm daim npav. Qhov no yog vim ib zaug zais tsis muaj txoj hauv kev los qhia lawv, dua.

Saib ENDPOINT CUSTOMIZATION kom paub meej tias daim npav assim-device tuaj yeem ntxiv ntawm SPIFFS cov ntaub ntawv ntawm ESP8266.

AssimilateCrouton WebComponent

hlau-teeb liab>
div> ua
QHIA HAUV ICON
kuv> span>
DEVICE FORM
MQTT TOPICSdiv>
/outbox/{{endPointJson.device_name}}/*div>
/inbox/{{endPointJson.device_name}}/*div>
WIFI SSIDdiv>
{{endPointJson.ssid}} div>
IP chaw nyob>
{{endPointJson.ip_addr}} a> div>
div> ua
QHIA QHIA LIST
element>paper-item>
qauv>
ntawv-listbox>
div> ua
crouton-daim ntawv>
qauv>
dom-module> cov

saib rawassim-device.html tuav nrog ❤ los ntawm GitHub

Kauj Ruam 6: TEEB MEEM QHOV TEEB MEEM

QHOV TSEEB CARD
QHOV TSEEB CARD
QHOV TSEEB CARD
QHOV TSEEB CARD
QHOV TSEEB CARD
QHOV TSEEB CARD

Daim npav lub lim tiam (daim npav-hom: assim-lub lim tiam saib) tau tuav ntawm lub cuab yeej (cors folder). Nws tau txhaj rau hauv cov cuab yeejInfo pob ntawv tshaj tawm rau AssimilateCrouton, los ntawm kev ntxiv cov ntaub ntawv teeb tsa/user_card _#. Json rau SPIFFS (qhov no user_card_9.json).

ZOO SIAB

Cov hnub ua haujlwm tau nthuav tawm raws li cov npe teev sijhawm. Qhov ntau ntawm lub sijhawm-lub sijhawm tau teeb tsa nrog cov khoom "interval_mins" hauv config/user_card _#. Json. Nws yuav tsum yog ib feem ntawm ib teev lossis ntau ntau ntawm ib teev piv txwv. 10, 15, 20, 30, 60, 120, 360. Yog tias lub sijhawm tam sim no, cov lus txib raug xa (tshaj tawm) tam sim rau lub cuab yeej. Feem ntau lub xeev raug tshuaj xyuas/tshaj tawm txhua feeb. Kev xaiv raug khaws tseg hauv LocalStorage, yog li lub sijhawm yuav rov qhib dua nrog qhov browser rov ua dua tshiab.

YUAV UA LI CAS

Hauv nws lub xeev tam sim no, lub lis piam pom zoo rau cov khoom siv uas tuaj yeem siv Toggle hloov pauv kom pom lawv lub xeev piv txwv li lawv nyob lossis tawm thiab tom qab tau teeb tsa lawv nyob hauv lub xeev ntawd. Teeb, kiv cua, thiab dej tso cua sov yog cov neeg sib tw zoo.

Txwv/CAVEATS

  • Interval_mins yuav tsum yog ib qho ntawm cov txiaj ntsig tau hais los saum no
  • Lub asthiv tsis txhawb nqa cov kev ua ntu zus uas tseem tau teem tseg, xws li tig lub kais luv luv (5 vib nas this) ob zaug ib hnub.

FUTURE

  • Nws tau cia siab tias qhov kev nqis tes ua tam sim no yuav txhawb nqa.
  • Synchronized cia thoob plaws cov khoom siv, rau kev xaiv lub sijhawm tab tom raug txiav txim siab.

Kauj Ruam 7: TSEEM CEEB TSHAJ PLAWS

Raws li tau hais hauv breifly hauv FIRMWARE, muaj 2 qhov kev pom zoo tshiab ntxiv rau SPIFFS cov ntaub ntawv rau kev kho tus kheej qhov kawg. JSON cov ntaub ntawv yog cov khoom tawg uas tau ntxiv rau cov ntsiab lus kawg hauv cov cuab yeejInfo pob ntawv tshaj tawm rau MQTT tus tswv lag luam uas dhau los ua lub ntsiab lus ntawm lub dashboard.

Cov yuam sij ntawm qhov kawg tau tsim hauv firmware:

  • CC_device (Custom Card) rau tus siv_card_base.json
  • CC_SLAVE_ENDPOINT NAME rau tus neeg siv daim npav _#. Json (# ua tus qhev nyob)

Raws li tau hais ua ntej, muaj qhov sib txawv uas tau hloov pauv rau qhov muaj txiaj ntsig ntawm runtime:

  • mqtt_device_name
  • wifi_siab
  • zos_ip

user_card_base.json

Piv txwv:

user_card _#. json

Piv txwv:

Kauj Ruam 8: VIDEO

Pom zoo: