{"id":5665,"date":"2018-12-12T10:31:23","date_gmt":"2018-12-12T07:31:23","guid":{"rendered":"https:\/\/msbro.ru\/?p=5665"},"modified":"2018-12-12T10:42:50","modified_gmt":"2018-12-12T07:42:50","slug":"chtenie-sms-s-gsm-modema-cherez-power-shell","status":"publish","type":"post","link":"https:\/\/msbro.ru\/index.php\/archives\/5665","title":{"rendered":"\u0427\u0442\u0435\u043d\u0438\u0435 SMS \u0441 GSM \/2G \/3G \/ 4G \u043c\u043e\u0434\u0435\u043c\u0430 \u0447\u0435\u0440\u0435\u0437 PowerShell"},"content":{"rendered":"<p>\u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 PowerShell \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 GSM \u043c\u043e\u0434\u0435\u043c\u0430.<\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430 \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0445 USB-\u0441\u0432\u0438\u0441\u0442\u043a\u0430\u0445 \u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u043e\u0434\u0435\u043c\u0435 \u0441 COM \u043f\u043e\u0440\u0442\u043e\u043c.<\/p>\n<p><!--more--><\/p>\n<p>\u0427\u0442\u0435\u043d\u0438\u0435 SMS \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 SIM-\u043a\u0430\u0440\u0442\u044b. \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 SMS \u0432\u044b\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0441\u0442\u043e\u043b\u0435.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440:<\/p>\n<pre class=\"\">start-sleep -m 100<\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 &#8220;\u041e\u041a&#8221; \u043d\u043e \u043a\u0430\u043a\u0438\u043c \u0442\u043e \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f SMS &#8211; \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0433\u0434\u0435 \u0442\u043e \u0432 \u0440\u0430\u0439\u043e\u043d\u0435 50-1000 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u0432\u0430\u0448\u0435\u0433\u043e COM &#8211; \u043f\u043e\u0440\u0442\u0430 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043c \u0438 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043f\u043e\u0440\u0442 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435.<\/p>\n<pre class=\"\">$Port = new-Object System.IO.Ports.SerialPort\r\n$Port.PortName = \"COM9\"\r\n$Port.BaudRate = 19200\r\n$Port.WriteTimeout = 500\r\n$Port.ReadTimeout = 9000\r\n$Port.DtrEnable = \"true\"\r\n$Port.ReceivedBytesThreshold = 256\r\n$Port.Parity = \"None\"\r\n$Port.StopBits = \"One\"\r\n$MyPath_1 = [Environment]::GetFolderPath(\"Desktop\")\r\n$Port.Close()\r\nStart-Sleep -Seconds 1\r\n$Port.Open()\r\n\r\n#$Port.Write(\"AT+CMGF=1`r`n\")\r\n$Port.WriteLine(\"AT+CMGL=`\"ALL`\"`r`n\")\r\nstart-sleep -m 100\r\n$my1 = $port.ReadExisting()\r\n$my1 | Out-File -FilePath $MyPath_1\\my_sms_log.txt -Append\r\n\r\nStart-Sleep -Seconds 1\r\n\r\n$Port.Close()<\/pre>\n<p>\u0423\u0434\u0430\u0447\u043d\u044b\u0445 \u0432\u0430\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 PowerShell \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 GSM \u043c\u043e\u0434\u0435\u043c\u0430. \u0421\u043a\u0440\u0438\u043f\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430 \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0445 USB-\u0441\u0432\u0438\u0441\u0442\u043a\u0430\u0445 \u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u043e\u0434\u0435\u043c\u0435 \u0441 COM \u043f\u043e\u0440\u0442\u043e\u043c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[1875,520,1671,524,17,522,955,90],"class_list":["post-5665","post","type-post","status-publish","format-standard","hentry","category-scripts","tag-2g","tag-3g","tag-4g","tag-gsm","tag-powershell","tag-modem","tag-skripty","tag-sms"],"_links":{"self":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/5665"}],"collection":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/comments?post=5665"}],"version-history":[{"count":2,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/5665\/revisions"}],"predecessor-version":[{"id":5671,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/5665\/revisions\/5671"}],"wp:attachment":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/media?parent=5665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/categories?post=5665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/tags?post=5665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->