{"id":315630,"date":"2020-12-27T21:00:47","date_gmt":"2020-12-27T21:00:47","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=315630"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=315630","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Shopker \u0434\u043b\u044f IoT"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 (\u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430, \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c, \u0447\u0430\u0441\u0442\u0438\u0446\u044b PM2.5). \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/grafana.com\/\" rel=\"noopener noreferrer nofollow\">Grafana<\/a> + <a href=\"https:\/\/www.influxdata.com\/\" rel=\"noopener noreferrer nofollow\">InfluxDB<\/a>. \u041d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043c\u043d\u043e\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b &#171;\u0438\u0437\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434&#187;, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f Shopker.<\/p>\n<p><strong>Shopker<\/strong> &#8212; \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0430\u0439\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <strong>Symfony<\/strong> (5+), JS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <strong>Angular<\/strong> (11+) \u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 <strong>MongoDB<\/strong> (4+). \u0421\u0430\u0439\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/shopker.org\/\" rel=\"noopener noreferrer nofollow\">https:\/\/shopker.org\/<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/907\/2fe\/16b\/9072fe16b6168f9511c3186fb195f059.jpg\" width=\"600\" height=\"453\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0430\u0439\u0442 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0438\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/andchir\/shopker-templates\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430<\/a>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e <a href=\"http:\/\/iot.shopker.org\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Shopker<\/h2>\n<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0443\u043d\u043a\u0442 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e, \u0442.\u043a. \u0432\u0441\u0451 \u0435\u0441\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/shopker.org\/documentation\/bash-script-for-vds\" rel=\"noopener noreferrer nofollow\">Bash \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 VDS \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/a>. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;\u0423\u0440\u043e\u043a\u0438&#187; \u0435\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e.<\/p>\n<h2>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430<\/h2>\n<\/p>\n<p><a href=\"https:\/\/github.com\/andchir\/shopker-templates\/releases\/\" rel=\"noopener noreferrer nofollow\">\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c <strong>shopker-templates.zip<\/strong> \u0437\u0434\u0435\u0441\u044c<\/a>. \u0418\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>npm install<\/code><\/p>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0438 \u043f\u043e FTP \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <strong>&#171;iot&#187;<\/strong> \u0432 \u043f\u0430\u043f\u043a\u0443 <strong>&#171;\/templates\/&#187;<\/strong>, \u0430 \u043f\u0430\u043f\u043a\u0443 &#171;\/assets\/iot\/&#187; \u0432 &#171;\/public\/&#187;, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c <strong>&#171;\/public\/assets\/iot\/&#187;<\/strong>.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u043c\u0438\u043d\u043a\u0443, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438&#187;. \u0412 \u043f\u0443\u043d\u043a\u0442\u0435 &#171;\u0422\u0435\u043c\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432&#187; \u0432\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u0442\u0435\u043c\u044b &#8212; iot. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.<\/p>\n<h2>3. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0432 \u0411\u0414<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;\u041a\u0430\u0442\u0430\u043b\u043e\u0433&#187; -&gt; &#171;\u0422\u0438\u043f\u044b \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430&#187;, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c&#187;.<\/p>\n<p>\u0412 \u043f\u043e\u043b\u0435 &#171;\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a&#187; \u0432\u0432\u043e\u0434\u0438\u043c &#171;\u0414\u0430\u0442\u0447\u0438\u043a\u0438&#187;, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f &#8212; &#171;sensors&#187;, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f &#8212; &#171;sensors&#187;. \u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0447\u0435\u043a\u0431\u043e\u043a\u0441 &#171;\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438&#187;. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/shopker.org\/api_doc\/index.html\" rel=\"noopener noreferrer nofollow\">API<\/a>. \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 &#8212; &#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430, \u0421&#187;. \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f &#8212; &#171;temperature&#187;, \u0442\u0438\u043f \u0432\u0432\u043e\u0434\u0430 \u0438 \u0442\u0438\u043f \u0432\u044b\u0432\u043e\u0434\u0430 &#8212; &#171;\u0427\u0438\u0441\u043b\u043e&#187;, \u0433\u0440\u0443\u043f\u043f\u0430 &#8212; &#171;\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435&#187;, \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u044b &#8212; &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435&#187;, &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435&#187; \u0438 &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043a\u0435&#187;.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d6a\/870\/e73\/d6a870e73b77c27ea85d235c93e97b61.png\" width=\"740\" height=\"701\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439, \u043a\u0443\u0434\u0430 \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u043e\u043b\u0435 &#171;\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f&#187;. \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f &#8212; &#171;time&#187;, \u0442\u0438\u043f \u0432\u0432\u043e\u0434\u0430 \u0438 \u0442\u0438\u043f \u0432\u044b\u0432\u043e\u0434\u0430 &#8212; &#171;\u0414\u0430\u0442\u0430&#187;, \u0433\u0440\u0443\u043f\u043f\u0430 &#8212; &#171;\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435&#187;, \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u044b &#8212; &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435&#187;, &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043a\u0435&#187;, &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0435&#187;. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0447\u0435\u043a\u0431\u043e\u043a\u0441 \u043d\u0443\u0436\u0435\u043d, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0434\u0430\u0442\u0435. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.<\/p>\n<h2>4. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;\u041a\u0430\u0442\u0430\u043b\u043e\u0433&#187;, \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u043c\u0435\u043d\u044e \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e&#187;. \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a &#8212; &#171;\u0414\u0430\u0442\u0447\u0438\u043a\u0438&#187;, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f &#8212; &#171;sensors&#187;, \u0442\u0438\u043f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 &#8212; &#171;\u0414\u0430\u0442\u0447\u0438\u043a\u0438&#187;.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a46\/92e\/798\/a4692e798469ab3b2718ccdd9f92a2c8.png\" width=\"742\" height=\"707\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e &#171;\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e #1&#187; (\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0412\u0430\u0448\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430). \u0412 \u044d\u0442\u0443 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432. \u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435 ID \u044d\u0442\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438, \u043e\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/465\/69c\/346\/46569c346b416990b66ab7271b3ceb67.png\" width=\"607\" height=\"416\"><figcaption><\/figcaption><\/figure>\n<h2>5. \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043a\u0435\u043d. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0430 \u043c\u043e\u0436\u043d\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438&#187;.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fc0\/738\/410\/fc07384107c363de07852e0492124e48.png\" width=\"737\" height=\"598\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API \u0434\u043b\u044f Bash:<\/p>\n<pre><code class=\"bash\">curl -X POST \\ \"http:\/\/your-domain.com\/api\/ru\/user_content\/19\" \\ -H \"Content-Type: application\/json\" \\ -H \"Accept: application\/json\" \\ -H \"X-AUTH-TOKEN: xxxxx\" \\ -d '{\"temperature\":23,\"humidity\":35}'<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 ESP2866 \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c wi-fi, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f:<\/p>\n<pre><code class=\"cpp\">\/\/ Shopker settings char shopkerApiUrl[45] = \"http:\/\/your-domain.com\/api\/ru\/user_content\/19\";\/\/ 19 - ID \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 char shopkerApiKey[121] = \"c5f3a652f67c5d31a5cd39ec287bd3ba36e1b7737dc9e26ae697c4d467c8638a1f1bd62906b00f4a1f83f1214fad20fe3fbe49d135f263c10d64b137\";\/\/ API \u0442\u043e\u043a\u0435\u043d ...  void sendDataToShopker(float temp, float hum, int pm2, int pm10) {   Serial.println(\"API URL: \" + String(shopkerApiUrl));      String jsonString = \"{\";   jsonString += \"\\\"temperature\\\":\" + String(temp) + \", \";   jsonString += \"\\\"humidity\\\":\" + String(hum) + \", \";   jsonString += \"\\\"pm25\\\":\" + String(pm2) + \", \";   jsonString += \"\\\"pm10\\\":\" + String(pm10);   jsonString += \"}\";    Serial.println(jsonString);    HTTPClient http;   http.begin(shopkerApiUrl);   http.addHeader(\"Content-Type\", \"application\/json\");   http.addHeader(\"Accept\", \"application\/json\");   http.addHeader(\"Content-Length\", String(jsonString.length()));   http.addHeader(\"X-AUTH-TOKEN\", String(shopkerApiKey));   int httpCode = http.POST(jsonString);   String response = http.getString();   Serial.println(\"Response code: \" + String(httpCode));   Serial.println(\"Response: \" + response);   http.end(); }<\/code><\/pre>\n<h2>6. \u0412\u044b\u0432\u043e\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u043d\u0446\u0430 (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430), \u043d\u0443\u0436\u043d\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 &#171;\u0427\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e&#187; (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &#171;-50&#187;), \u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u044c &#8212; &#171;id_asc&#187; (\u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043f\u043e ID).<\/p>\n<h2>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u0438\u0446\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Twig-\u0444\u0443\u043d\u043a\u0446\u0438\u044f &#171;contentList&#187;:<\/p>\n<pre><code class=\"xml\">{{ contentList('sensor_data', 'sensors', {\"isActive\": true, parentId: 19}, {\"_id\": \"asc\"}, -50) }}<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043d\u0435\u0439 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: <a href=\"https:\/\/shopker.org\/documentation\/content-display\" rel=\"noopener noreferrer nofollow\">https:\/\/shopker.org\/documentation\/content-display<\/a><\/p>\n<p>&#171;sensor_data&#187; &#8212; \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 &#171;\/templates\/iot\/catalog&#187; &#8212; <strong>&#171;sensor_data.html.twig&#187;<\/strong>. \u0412 \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u0438\u043f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430:<\/p>\n<pre><code class=\"xml\">{% set fieldsOnPage = contentType.getFieldsByFlag('showOnPage') %}<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f JS-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/plotly.com\/javascript\/\" rel=\"noopener noreferrer nofollow\">Plotly<\/a>.<\/p>\n<p>\u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code class=\"xml\">{% if is_granted('ROLE_USER') %}     \u0422\u0443\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0434\u043b\u044f \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445. {% endif %}<\/code><\/pre>\n<p><a href=\"https:\/\/twig.symfony.com\/doc\/3.x\/\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0435<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/535158\/\"> https:\/\/habr.com\/ru\/post\/535158\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 (\u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430, \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c, \u0447\u0430\u0441\u0442\u0438\u0446\u044b PM2.5). \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/grafana.com\/\" rel=\"noopener noreferrer nofollow\">Grafana<\/a> + <a href=\"https:\/\/www.influxdata.com\/\" rel=\"noopener noreferrer nofollow\">InfluxDB<\/a>. \u041d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u043c\u043d\u043e\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b &#171;\u0438\u0437\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434&#187;, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f Shopker.<\/p>\n<p><strong>Shopker<\/strong> &#8212; \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0430\u0439\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <strong>Symfony<\/strong> (5+), JS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <strong>Angular<\/strong> (11+) \u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 <strong>MongoDB<\/strong> (4+). \u0421\u0430\u0439\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/shopker.org\/\" rel=\"noopener noreferrer nofollow\">https:\/\/shopker.org\/<\/a>.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0430\u0439\u0442 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0438\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/andchir\/shopker-templates\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430<\/a>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e <a href=\"http:\/\/iot.shopker.org\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Shopker<\/h2>\n<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0443\u043d\u043a\u0442 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e, \u0442.\u043a. \u0432\u0441\u0451 \u0435\u0441\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/shopker.org\/documentation\/bash-script-for-vds\" rel=\"noopener noreferrer nofollow\">Bash \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 VDS \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/a>. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;\u0423\u0440\u043e\u043a\u0438&#187; \u0435\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u043e.<\/p>\n<h2>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430<\/h2>\n<\/p>\n<p><a href=\"https:\/\/github.com\/andchir\/shopker-templates\/releases\/\" rel=\"noopener noreferrer nofollow\">\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c <strong>shopker-templates.zip<\/strong> \u0437\u0434\u0435\u0441\u044c<\/a>. \u0418\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>npm install<\/code><\/p>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0438 \u043f\u043e FTP \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <strong>&#171;iot&#187;<\/strong> \u0432 \u043f\u0430\u043f\u043a\u0443 <strong>&#171;\/templates\/&#187;<\/strong>, \u0430 \u043f\u0430\u043f\u043a\u0443 &#171;\/assets\/iot\/&#187; \u0432 &#171;\/public\/&#187;, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c <strong>&#171;\/public\/assets\/iot\/&#187;<\/strong>.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u043c\u0438\u043d\u043a\u0443, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438&#187;. \u0412 \u043f\u0443\u043d\u043a\u0442\u0435 &#171;\u0422\u0435\u043c\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432&#187; \u0432\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u0442\u0435\u043c\u044b &#8212; iot. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.<\/p>\n<h2>3. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0432 \u0411\u0414<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;\u041a\u0430\u0442\u0430\u043b\u043e\u0433&#187; -&gt; &#171;\u0422\u0438\u043f\u044b \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430&#187;, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c&#187;.<\/p>\n<p>\u0412 \u043f\u043e\u043b\u0435 &#171;\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a&#187; \u0432\u0432\u043e\u0434\u0438\u043c &#171;\u0414\u0430\u0442\u0447\u0438\u043a\u0438&#187;, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f &#8212; &#171;sensors&#187;, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f &#8212; &#171;sensors&#187;. \u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0447\u0435\u043a\u0431\u043e\u043a\u0441 &#171;\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438&#187;. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/shopker.org\/api_doc\/index.html\" rel=\"noopener noreferrer nofollow\">API<\/a>. \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 &#8212; &#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430, \u0421&#187;. \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f &#8212; &#171;temperature&#187;, \u0442\u0438\u043f \u0432\u0432\u043e\u0434\u0430 \u0438 \u0442\u0438\u043f \u0432\u044b\u0432\u043e\u0434\u0430 &#8212; &#171;\u0427\u0438\u0441\u043b\u043e&#187;, \u0433\u0440\u0443\u043f\u043f\u0430 &#8212; &#171;\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435&#187;, \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u044b &#8212; &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435&#187;, &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435&#187; \u0438 &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043a\u0435&#187;.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439, \u043a\u0443\u0434\u0430 \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u043e\u043b\u0435 &#171;\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f&#187;. \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f &#8212; &#171;time&#187;, \u0442\u0438\u043f \u0432\u0432\u043e\u0434\u0430 \u0438 \u0442\u0438\u043f \u0432\u044b\u0432\u043e\u0434\u0430 &#8212; &#171;\u0414\u0430\u0442\u0430&#187;, \u0433\u0440\u0443\u043f\u043f\u0430 &#8212; &#171;\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435&#187;, \u0447\u0435\u043a\u0431\u043e\u043a\u0441\u044b &#8212; &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435&#187;, &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043a\u0435&#187;, &#171;\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0435&#187;. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0447\u0435\u043a\u0431\u043e\u043a\u0441 \u043d\u0443\u0436\u0435\u043d, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0434\u0430\u0442\u0435. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.<\/p>\n<h2>4. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;\u041a\u0430\u0442\u0430\u043b\u043e\u0433&#187;, \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u043c\u0435\u043d\u044e \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e&#187;. \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a &#8212; &#171;\u0414\u0430\u0442\u0447\u0438\u043a\u0438&#187;, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f &#8212; &#171;sensors&#187;, \u0442\u0438\u043f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 &#8212; &#171;\u0414\u0430\u0442\u0447\u0438\u043a\u0438&#187;.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e &#171;\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e #1&#187; (\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0412\u0430\u0448\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430). \u0412 \u044d\u0442\u0443 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432. \u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u0435 ID \u044d\u0442\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438, \u043e\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>5. \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043a\u0435\u043d. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0430 \u043c\u043e\u0436\u043d\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438&#187;.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API \u0434\u043b\u044f Bash:<\/p>\n<pre><code class=\"bash\">curl -X POST \\ \"http:\/\/your-domain.com\/api\/ru\/user_content\/19\" \\ -H \"Content-Type: application\/json\" \\ -H \"Accept: application\/json\" \\ -H \"X-AUTH-TOKEN: xxxxx\" \\ -d '{\"temperature\":23,\"humidity\":35}'<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 ESP2866 \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c wi-fi, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f:<\/p>\n<pre><code class=\"cpp\">\/\/ Shopker settings char shopkerApiUrl[45] = \"http:\/\/your-domain.com\/api\/ru\/user_content\/19\";\/\/ 19 - ID \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 char shopkerApiKey[121] = \"c5f3a652f67c5d31a5cd39ec287bd3ba36e1b7737dc9e26ae697c4d467c8638a1f1bd62906b00f4a1f83f1214fad20fe3fbe49d135f263c10d64b137\";\/\/ API \u0442\u043e\u043a\u0435\u043d ...  void sendDataToShopker(float temp, float hum, int pm2, int pm10) {   Serial.println(\"API URL: \" + String(shopkerApiUrl));      String jsonString = \"{\";   jsonString += \"\\\"temperature\\\":\" + String(temp) + \", \";   jsonString += \"\\\"humidity\\\":\" + String(hum) + \", \";   jsonString += \"\\\"pm25\\\":\" + String(pm2) + \", \";   jsonString += \"\\\"pm10\\\":\" + String(pm10);   jsonString += \"}\";    Serial.println(jsonString);    HTTPClient http;   http.begin(shopkerApiUrl);   http.addHeader(\"Content-Type\", \"application\/json\");   http.addHeader(\"Accept\", \"application\/json\");   http.addHeader(\"Content-Length\", String(jsonString.length()));   http.addHeader(\"X-AUTH-TOKEN\", String(shopkerApiKey));   int httpCode = http.POST(jsonString);   String response = http.getString();   Serial.println(\"Response code: \" + String(httpCode));   Serial.println(\"Response: \" + response);   http.end(); }<\/code><\/pre>\n<h2>6. \u0412\u044b\u0432\u043e\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u043d\u0446\u0430 (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430), \u043d\u0443\u0436\u043d\u043e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 &#171;\u0427\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e&#187; (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &#171;-50&#187;), \u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u044c &#8212; &#171;id_asc&#187; (\u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043f\u043e ID).<\/p>\n<h2>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u0438\u0446\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Twig-\u0444\u0443\u043d\u043a\u0446\u0438\u044f &#171;contentList&#187;:<\/p>\n<pre><code class=\"xml\">{{ contentList('sensor_data', 'sensors', {\"isActive\": true, parentId: 19}, {\"_id\": \"asc\"}, -50) }}<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043d\u0435\u0439 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: <a href=\"https:\/\/shopker.org\/documentation\/content-display\" rel=\"noopener noreferrer nofollow\">https:\/\/shopker.org\/documentation\/content-display<\/a><\/p>\n<p>&#171;sensor_data&#187; &#8212; \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 &#171;\/templates\/iot\/catalog&#187; &#8212; <strong>&#171;sensor_data.html.twig&#187;<\/strong>. \u0412 \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u0438\u043f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430:<\/p>\n<pre><code class=\"xml\">{% set fieldsOnPage = contentType.getFieldsByFlag('showOnPage') %}<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f JS-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/plotly.com\/javascript\/\" rel=\"noopener noreferrer nofollow\">Plotly<\/a>.<\/p>\n<p>\u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code class=\"xml\">{% if is_granted('ROLE_USER') %}     \u0422\u0443\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0434\u043b\u044f \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445. {% endif %}<\/code><\/pre>\n<p><a href=\"https:\/\/twig.symfony.com\/doc\/3.x\/\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0435<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/535158\/\"> https:\/\/habr.com\/ru\/post\/535158\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-315630","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=315630"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315630\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=315630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=315630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=315630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}