{"id":386240,"date":"2024-06-29T06:35:24","date_gmt":"2024-06-29T06:35:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=386240"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=386240","title":{"rendered":"<span>SIM800L + STM32 Bluepill + Rust. \u041a\u0430\u043a \u043e\u043d\u043e?<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/def\/492\/5fc\/def4925fcfd8612d70c8492b139d021e.PNG\" width=\"800\" height=\"488\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0435\u0431\u0435 \u043d\u0430 Arduino \u0431\u043b\u043e\u043a \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0434\u0430\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0442\u043b\u0430 \u043e\u0442 UPS. \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u0441\u0432\u044f\u0437\u043a\u0430 Arduino MEGA + \u0448\u0438\u043b\u0434 \u043d\u0430 SIM900 \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e. \u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0451 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442, \u0441\u0430\u043c\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0438 \u0442.\u0434. \u041e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0435\u0448\u0438\u043b \u0432\u0441\u0451 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u0445: \u0432\u0437\u044f\u043b \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 STM32 Bluepill, \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u043b \u043d\u0430 \u0430\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c SIM800L, \u043d\u043e \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2013 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 Rust, \u043a\u0443\u043f\u0438\u043b\u0441\u044f \u043d\u0430 \u043e\u0431\u0435\u0449\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438. \u0427\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h2>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 \u043d\u043e\u0432\u043e\u0439 \u0441\u0430\u043c\u043e\u0434\u0435\u043b\u043a\u0438.<\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u043d\u0430 \u0434\u0430\u0447\u0435 \u0441\u0442\u043e\u0438\u0442 UPS Inelt, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u043e\u0440\u0442 RS232 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f UPS. \u041e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0440\u0435\u0432\u043d\u0438\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0431\u043c\u0435\u043d\u0430 Megatec, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e UPS \u0438 \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044f \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u043e, \u0430 \u0432\u043e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u043d\u0430\u0442\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c: \u043a\u0430\u043a \u0442\u0430\u043c \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435, \u0436\u0438\u0432\u044b \u043b\u0438 \u0431\u0430\u0442\u0430\u0440\u0435\u0438 \u0438 \u043f\u0440. \u041d\u0430 \u0440\u044b\u043d\u043a\u0435 \u044f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0430\u043c. \u0412\u0441\u0451 \u0432 \u0434\u0443\u0445\u0435 DIY.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Megatec<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>Megatec Protocol information                         VERSION : 2.7                          DATE : SEP. 30, 1995  DATE:V2.7: JULY 30 ,1996  DATEDESCRIPTIONMODIFY BY 2.695-9-30UPDATE \"D\" COMMAND (SS.SS -> SSS.SS)Kevin Chiou 2.796-8-01Disable \"D\" COMMANDKevin Chiou  A. General: This document specifies the RS232C communication protocol of             the Advance-Intelligent UPS. The protocol provided the following             features :              1. Monitor charger status.             2. Monitor battery status and condition.             3. Monitor the utility status.             4. Provide the power switch function for computer to turn on and                off the utility on schedule for power saving.              Computer will control information exchange by a query followed by             &lt;cr>. UPS will respond with information followed by a &lt;cr> or             action.  B. Hardware:              BAUD RATE............... : 2400 bps             DATA LENGTH.......... : 8 bits             STOP BIT..................... : 1 bit             PARITY........................ : NONE              CABLING :                 COMPUTER                  UPS             ===================================                   RX   &lt;----------   TX  (pin 9)                   TX    ---------->  RX  (pin 6)                   GND  &lt;----------   GND (pin 7)                    (9 pins female D-type connector)  C. COMMUNICATION PROTOCOL:  1. Status Inquiry:  Computer : Q1&lt;cr>         UPS      : UPS status data stream, such as              (MMM.M NNN.N PPP.P QQQ RR.R S.SS TT.T  b7b6b5b4b3b2b1b0&lt;cr>          UPS status data stream : There should be a space character between every field for data separation. The meaning of each field is list as followed:                  a. Start byte    : (  b.I\/P voltage   : MMM.M                   M is and integer number ranging from 0 to 9.                   The unit is Volt.                  c.I\/P fault voltage : NNN.N                   N is and integer number ranging from 0 to 9.                   The unit is Volt.                    ** For OFF LINE UPS**                      Its purpose is to identify a short duration voltage glitch                   which cause OFF line UPS to go to Invter mode. If this occurs                   input voltage will appear normal at query prior to glitch and                   will still appear normal at next query.                     The I\/P fault voltage will hold glitch voltage till next                   query. After query, the I\/P fault voltage will be same as I\/P                   voltage until next glitch occurs.                    ** For ON LINE UPS**                      Its purpose is to identify a short duration utility fail                   which cause ON line UPS to go to battery mode. If this occurs                   input voltage will appear normal at query prior to fail and                   will still appear normal at next query.                     The I\/P fault voltage will hold utility fail voltage till                   next query. After query, the I\/P voltage will be same as I\/P                   voltage until next utility fail occurs.                  d.O\/P voltage   : PPP.P                   P is an integer number ranging form 0 to 9.                    The unit is Volt.                  e.O\/P current   : QQQ                   QQQ is a percent of maximum current, not an absolute value.                  f.I\/P frequency : RR.R                   R is an integer number ranging from 0 to 9.                   The unit is HZ.                  g.Battery voltage : SS.S or S.SS                   S is an integer number ranging from 0 to 9.                     For on-line units battery voltage\/cell is provided in the                   form S.SS .                     For standby units actual battery voltage is provided in                   the form SS.S .                     UPS type in UPS status will determine which reading was                   obtained.                  h.Temperature   : TT.T                   T is an integer number ranging form 0 to 9.                   The unit is degree of centigrade.                  i.UPS Status    : &lt;U>                   &lt;U> is one byte of binary information such as                   &lt;b7b6b5b4b3b2b1b0>.  Where bn is a ASCII character '0' or '1'. . UPS status : Bit             Description                   7  1 : Utility Fail (Immediate)              6  1 : Battery Low                           5  1 : Bypass\/Boost or Buck Active                   4  1 : UPS Failed                            3  1 : UPS Type is Standby (0 is On_line)    2  1 : Test in Progress                      1  1 : Shutdown Active                       0  1 : Beeper On                               j.Stop Byte     : &lt;cr>  Example: Computer : Q1&lt;cr>     UPS      :                          (208.4 140.0 208.4 034 59.9 2.05 35.0 00110000&lt;cr>                         Means    : I\/P voltage is 208.4V.                                   I\/P fault voltage is 140.0V.                                   O\/P voltage is 208.4V.                                   O\/P current is 34 %.                                   I\/P frequency is 59.9 HZ.                                   Battery voltage is 2.05V.                                   Temperature is 35.0 degrees of centigrade.                                   UPS type is on-line , UPS failed. Bypass                                   active , and shutdown not active.    2. Test for 10 seconds:          Computer  : T&lt;cr>         UPS       : Test for 10 seconds and return to utility.          If battery low occur during testing, UPS will return to         utility immediately.     3.Test until battery low :          Computer  : TL&lt;cr>         UPS       : Test until battery low and return to utility.     4.Test for specified time period :          Computer  : T&lt;n>&lt;cr>         UPS       : Test for &lt;n> minutes.          a. During testing, UPS returns to utility immediately, if            battery low occur.         b. &lt;n> is a number ranging from 01 to 99.     5. Turn On\/Off beep -- Toggle the UPS beeper :          Computer  : Q&lt;cr>          When the AC power failed, UPS will generate a warning beep to         inform the manager. Manager could toggle the warning beep by         sending this command .     6. Shutdown Command :          Computer  : S&lt;n>&lt;cr>         UPS       : Shut UPS output off in &lt;n> minutes.          a. The UPS output will be off in &lt;n> minutes, even if the            utility power is present.         b. If the battery low occurs before &lt;n> minutes, the            output is turned off immediately.         c. After UPS shutdown, the controller of UPS monitors the            utility power. If the utility is recovered, the UPS will wait            for 10 seconds and connect the utility to output.         d. &lt;n> is a number ranging form .2, .3, ..., 01, 02, ..., up to 10.          For example : S.3&lt;cr> --- shut output off in (.3) minutes     7. Shutdown and Restore Command :          Computer  : S&lt;n>R&lt;m>&lt;cr>         UPS       : Shut UPS output off in &lt;n> minutes, and waiting                     for &lt;m> minutes then turn on UPS output again.          a. The shutdown sequence is the same as the previous command.            When the &lt;m> minutes expired, the utility do not restore,            the UPS will wait until utility restore.         b. If UPS is in shutdown waiting state, the \"C\" command can            let the shutdown procedure cancelled.         c. If UPS is in restore waiting state, the \"C\" command can            let the UPS output turned on, but UPS must be hold off at            least 10 seconds. (if utility is present)         d. &lt;n> is a number ranging form .2, .3, ..., 01, 02, ..., up to 10.         e. &lt;m> is a number ranging form 0001 to 9999.     8. Cancel Shutdown Command :          Computer  : C&lt;cr>         UPS       : Cancel the SN&lt;n>&lt;cr> and SN&lt;n>R&lt;m>&lt;cr> command.          a. If UPS is in shut down waiting state, the shut down command            is cancelled.         b. If UPS is in restore waiting state, the UPS output is turned            on, but UPS must be hold off at least 10 seconds.            (if utility is present)     9. Cancel Test Command :          Computer  : CT&lt;cr>         UPS       : Cancel all test activity and connect the utility to                     output immediately.  10. UPS Information Command:  Computer: I&lt;cr> UPS: #Company_Name UPS_Model Version&lt;cr>  This function will make the UPS respond with the basic information about the company who manufacture the UPS, the model name of the UPS and the version number of the UPS firmware. The length of every field is listed as follows: Company_Name: 15 characters, leave space if less than 15 characters UPS_Model: 10 characters, leave space if less than 10 characters Version: 10 characters, leave space if less than 10 characters  There should be a space character between every field for separation.  11. UPS Rating Information:  Computer: F&lt;cr> UPS: #MMM.M QQQ SS.SS RR.R&lt;cr>  This function makes the UPS answer the rating value of UPS. There should be a space character between every field for separation. The UPS's response contains the following information field:  a. Rating Voltage: MMM.M b. Rating Current: QQQ c. Battery Voltage: SS.SS or SSS.S d. Frequency: RR.R  D. COMMAND SUMMARY:  ITEMCOMMAND            DESCRIPTION                1a    D       Status Inquiry           *disable           1    Q1       Status Inquiry                      2    T       10 Seconds Test                     3    TL      Test until Battery Low              4    T&lt;n>    Test for Specified Time Period      5    Q       Turn On\/Off beep                    6    S&lt;n>    Shut Down Command                   7  S&lt;n>R&lt;m>  Shut Down and Restore Command       8    C       Cancel Shut Down Command            9    CT      Cancel Test Command                10   I  UPS Information Command 11   F  UPS Rating Information  E. Invalid Command\/Information Handling  If the UPS receives any command that it could not handle, the UPS should echo the received command back to the computer. The host should check if the command send to UPS been echo or not.  If there is any information field in the UPS's response which is unavailable or not supported, the UPS should fill the field with '@'. <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u0438\u0445 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0445\u043e\u0447\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0435 \u0421\u041c\u0421 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 UPS \u0438 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043d\u0438\u0432 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u044c. \u041d\u0443 \u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u044b \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0442\u0435\u043f\u043b\u043e\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043e\u0442\u043e\u043f\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0443, \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a \u043c\u043e\u0434\u0443\u043b\u044e \u0441\u0432\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 UPS, \u0442.\u0435. \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0443 \u043c\u0435\u043d\u044f \u043f\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043b\u0438\u0431\u043e \u043e\u0442 \u0441\u0435\u0442\u0438, \u043b\u0438\u0431\u043e \u043e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0442\u0430\u0440\u0435\u0438. \u0420\u0430\u0437 \u0442\u0430\u043a\u043e\u0435 \u0434\u0435\u043b\u043e, \u0440\u0435\u0448\u0438\u043b \u0435\u0449\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0438 \u0438 \u0431\u0430\u0442\u0430\u0440\u0435\u0438. <\/p>\n<p>\u0412\u0441\u0451 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e, \u043a\u0430\u043a \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u043d\u0430 Arduino MEGA + SIM900. \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 Bluepill \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438 \u0441\u0445\u0435\u043c \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432. \u0410\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 bluepill \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c Arduino, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043d\u0435\u0442, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b bluepill \u0442\u043e\u043b\u0435\u0440\u0430\u043d\u0442\u043d\u044b \u043a 5 \u0412 \u0441\u0438\u0433\u043d\u0430\u043b\u0430\u043c. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0447\u0442\u043e \u0432 bluepill \u043d\u0435\u0442 eeprom, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0443. \u0412 \u043a\u043b\u0430\u0434\u043e\u0432\u043a\u0435 \u043d\u0430\u0448\u043b\u0430\u0441\u044c \u0431\u0435\u0441\u0445\u043e\u0437\u043d\u0430\u044f 24LC16, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0435\u0451, \u0445\u043e\u0442\u044f \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0439\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u041a\u0430\u043a \u0434\u043e \u043c\u0435\u043d\u044f \u0434\u043e\u0448\u043b\u043e \u043f\u043e\u0437\u0436\u0435, \u044d\u0442\u0438 \u0431\u0430\u0439\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u044f\u0447\u0435\u0439\u043a\u0430\u0445 SIM \u043a\u0430\u0440\u0442\u044b, \u043d\u043e \u0446\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044f \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u043b. \u041d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0442\u043e \u043c\u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0451 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u2013 \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 STM32 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c embedded Rust \u0432 \u0446\u0435\u043b\u044f\u0445 \u0441\u0430\u043c\u043e\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u0430\u0440\u0438\u0439 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0431\u043b\u043e\u043a\u0438 STM32. \u0410\u0426\u041f, \u0442\u0430\u0439\u043c\u0435\u0440\u044b, USART, \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f, RTC \u0438 \u043f\u0440. \u0420\u0443\u043a\u0438 \u043d\u0435 \u0434\u043e\u0442\u044f\u043d\u0443\u043b\u0438\u0441\u044c \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f DMA \u0438 \u043d\u043e\u0432\u043e\u043c\u043e\u0434\u043d\u043e\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0449\u0438\u043d\u044b Rust.<\/p>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e \u043f\u043e\u0445\u043e\u0434\u0430 \u043f\u043e \u0433\u0440\u0430\u0431\u043b\u044f\u043c<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430 STM32 \u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0431\u044b\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u044b\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 C++, \u0442\u043e Rust \u0431\u044b\u043b \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0432 \u043d\u043e\u0432\u0438\u043d\u043a\u0443. \u0412\u043e\u043e\u0431\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Rust \u043f\u0440\u0438\u0448\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0442\u043e\u043a, \u0447\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043c\u0438\u0433\u0430\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u043d\u0430 bluepill \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Rust. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u044f \u0442\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e Rust. \u042f\u0437\u044b\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0434\u043b\u044f \u043c\u0435\u043d\u044f, \u043d\u0430\u0434\u043e \u043f\u0440\u044f\u043c\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u043d\u0435\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Arduino. \u0421\u0430\u043c\u043e\u0435 \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0431\u044b\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u0432 \u043a\u043d\u0438\u0433\u0430\u0445 \u043f\u043e Rust \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0443\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0447\u0442\u043e \u043f\u043e\u0437\u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c\u044e, \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 embedded \u0432\u0435\u0440\u0441\u0438\u0438. \u0412\u0441\u0435 \u044d\u0442\u0438 String, Vec, \u0441\u043e\u0442\u043d\u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432 \u0438 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u044b \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b. \u041f\u0435\u0447\u0430\u043b\u044c.<\/p>\n<p>\u041d\u043e \u0440\u0430\u0434\u0438 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 Rust, \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u044f \u0433\u043e\u0442\u043e\u0432 \u0431\u044b\u043b \u0441 \u044d\u0442\u0438\u043c \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0438\u0442\u044c\u0441\u044f. \u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0442\u0435, \u043a\u0442\u043e \u043d\u0435 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u043c\u043d\u043e\u0433\u043e \u0431\u0435\u0441\u0441\u043e\u043d\u043d\u044b\u0445 \u043d\u043e\u0447\u0435\u0439 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 seg fault, \u043d\u0435 \u043f\u043e\u0439\u043c\u0443\u0442 \u043c\u0435\u043d\u044f, \u043d\u0443 \u0434\u0430 \u0438 \u043b\u0430\u0434\u043d\u043e.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043d\u0430 crates.io. \u041d\u0430\u0434\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0442\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u043e\u043f\u0438\u043b\u0438\u0432\u0430\u0442\u044c \u0447\u0442\u043e\u0431 \u043e\u043d\u0438 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u043d\u0430 bluepill. \u041d\u043e \u0442\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430. \u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043a\u0440\u0435\u0439\u0442 heapless \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u043c\u0435\u0441\u0442\u043e Vec, String \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0440\u0435\u0439\u0442\u0435 stm32f1xx-hal. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 \u043e\u0431\u044b\u0447\u043d\u043e \u0438 \u0438\u0434\u0451\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c bluepill. \u0423\u0432\u0438\u0434\u0435\u0432 \u0441\u043b\u043e\u0432\u043e HAL, \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043c\u044b\u0441\u043b\u044c \u043e STM32 CubeMX, \u043d\u043e \u044d\u0442\u043e \u043e\u0431\u043c\u0430\u043d\u0447\u0438\u0432\u043e, \u0442\u0443\u0442 HAL \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439. \u0414\u0440\u0443\u0433\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0436\u0435\u043b\u0435\u0437\u0443. \u0425\u043e\u0440\u043e\u0448\u043e \u0445\u043e\u0442\u044c \u043d\u0430 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0438 \u0431\u043b\u043e\u043a\u043e\u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0438\u043d\u0430\u0447\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 \u043a\u0440\u0435\u0439\u0442 \u0435\u0441\u0442\u044c, \u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f. \u041c\u043d\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u0442\u0430\u043c \u0432\u0441\u0451 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h2>\u0416\u0435\u043b\u0435\u0437\u043e \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b<\/h2>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u2014 \u044d\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0434\u043b\u044f Arduino \u0435\u0441\u0442\u044c, \u0432\u0438\u0434\u0438\u043c\u043e, \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0442\u043e \u0441 Rust \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u0440\u0430\u0434\u0443\u0436\u043d\u043e. \u041c\u0435\u043d\u044f \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u043e, \u0435\u0441\u0442\u044c \u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f eeprom, \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b DS18B20, \u0434\u0430 \u0438 SIM800. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u043b\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043a\u0440\u0435\u0439\u0442\u044b \u0435\u0441\u0442\u044c, \u0430 \u0434\u043b\u044f SIM800 \u0432\u0441\u0451 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443. \u0414\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0435 \u0442\u043e. \u042f \u0438\u0437\u0443\u0447\u0438\u043b \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0430\u0440\u0434\u0443\u0438\u043d\u043e\u0432\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 SIM900 \u0438 \u0440\u0435\u0448\u0438\u043b \u0438\u0445 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 Rust \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c \u043c\u043d\u0435 \u043e\u0431\u044a\u0451\u043c\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/128\/a12\/017\/128a120177c5528776fe41b4834875b4.PNG\" width=\"790\" height=\"530\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0434\u043b\u044f DS18B20 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0435\u0439\u0442\u043e\u0432 \u0438 \u044f \u0441\u043f\u0435\u0440\u0432\u0430 \u0432\u0437\u044f\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439\u0441\u044f. \u0418 \u043d\u0435 \u043f\u043e\u043f\u0430\u043b. \u041e\u043d \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c \u2013 \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443, \u0442\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0443 CRC. \u042f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0435\u043d\u044f\u043b \u0434\u0430\u0442\u0447\u0438\u043a\u0438, \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u043b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u043b\u043e. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0435\u0440\u0435\u0448\u0451\u043b \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u0440\u0435\u0439\u0442 \u0438 \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0431\u0435\u0437 \u0442\u0430\u043d\u0446\u0435\u0432 \u0441 \u0431\u0443\u0431\u043d\u043e\u043c.<\/p>\n<p>\u041d\u0430\u0434\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 AT \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u0440\u0435\u0439\u0442 atat. \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041d\u043e \u043c\u043d\u0435 \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u0414\u0430 \u0438 \u0438\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043d \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044f SIM800 \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 Arduino. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043f\u043e \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0443, \u0430 atat \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u043c \u043a\u043e\u043d\u0446\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0431\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 atat \u044f \u043d\u0435 \u0441\u0442\u0430\u043b, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043b. <\/p>\n<p>\u0414\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SIM800 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 unsolicited result codes. \u042d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438 \u0436\u0434\u0435\u0442\u0435 \u0432 \u043e\u0442\u0432\u0435\u0442 \u041e\u041a, \u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u043d\u043e\u0432\u043e\u043c \u0421\u041c\u0421 \u0438\u043b\u0438 RING. \u041e\u0447\u0435\u043d\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 SIM800 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0438\u0445 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c. \u041d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0437\u0432\u043e\u043d\u043a\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u0432\u043a\u043b\u044e\u0447\u0430\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c RING \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0437\u0432\u043e\u043d\u043a\u0430, \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0432\u043e\u043d\u043a\u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u044e\u0442\u0441\u044f. \u042d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043d\u0438\u0437\u0438\u043b\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u043e\u0437\u0432\u043e\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u043e \u043d\u0435\u0433\u043e \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f, \u0445\u043e\u0442\u044f \u0438 \u0440\u0435\u0434\u043a\u043e. \u0417\u0430\u0442\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u043e\u0437\u0440\u043e\u0441\u043b\u0430. \u0418 \u0434\u0430, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u201c\u043d\u0430\u0438\u0432\u043d\u044b\u0439\u201d \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f AT \u043a\u043e\u043c\u0430\u043d\u0434: \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0435\u0441\u043b\u0438 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u0421 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u2013 \u0431\u0435\u0440\u0443 \u201c\u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435\u201d \u043d\u043e\u043c\u0435\u0440\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0442\u0440\u0451\u0445 \u044f\u0447\u0435\u0435\u043a SIM \u043a\u0430\u0440\u0442\u044b. \u041c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0437\u0432\u043e\u043d\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u044d\u0442\u0438\u0445 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0421\u041c\u0421 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043d\u0430\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440.<\/p>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 SIM800 \u0438 bluepill. \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043e\u0431\u044b\u0447\u043d\u044b\u0439 RS232 \u0438 \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f. \u041d\u043e \u043d\u0435\u0442, \u043f\u0440\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u043b\u0438 \u043f\u043e\u0434\u0430\u0447\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043d\u0430 SIM800 \u0438 \u041c\u041a \u0441\u0432\u044f\u0437\u044c \u0447\u0430\u0441\u0442\u043e \u0442\u0435\u0440\u044f\u043b\u0430\u0441\u044c. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 SIM800, \u0430 \u043f\u043e\u0442\u043e\u043c, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0441\u043f\u0435\u0445\u0430, \u0438 bluepill.<\/p>\n<h2>\u0427\u0442\u043e \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c<\/h2>\n<p>\u0411\u043e\u043b\u044c\u043d\u044b\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0440\u0430\u0441\u043f\u0443\u0445\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430. \u0421\u0442\u0440\u043e\u0447\u0435\u043a 200 \u043a\u043e\u0434\u0430 \u0432 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435 \u0435\u0449\u0451 \u0432\u043b\u0435\u0437\u0430\u043b\u0438 \u0432\u043e \u0444\u043b\u0435\u0448, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0451. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0446\u0438\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0440\u0435\u043b\u0438\u0437\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e. \u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043a\u0430\u0447\u043e\u043a \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0451\u043b, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u044f \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 fp \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043e\u043a\u043e\u043b\u043e 9 \u043a\u0431, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043a \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0443. \u0422\u043e\u0447\u043d\u0435\u0435, \u0432\u0441\u0451 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0438 \u044f \u043d\u0435 \u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435. \u041f\u043e\u043c\u043e\u0433 stackoverflow, \u0433\u0434\u0435 \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0446\u0438\u044e opt-level = &#171;z&#187;. \u0422\u043e\u043b\u044c\u043a\u043e \u0441 \u043d\u0435\u0439 \u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b 45 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442 \u043f\u0440\u0438 1300 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041d\u0435 \u043c\u043e\u0433\u0443 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f bluepill, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c 64 \u041a\u0431 \u0444\u043b\u0435\u0448\u0430. <\/p>\n<p>\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u041e\u041e\u041f. \u0422\u0443\u0442 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0441\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c \u0441\u043e state machines. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e \u043a\u0430\u043d\u043e\u043d\u0430\u043c \u00ab\u043b\u0443\u0447\u0448\u0438\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0432 \u043a\u043e\u0434\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u0448\u0438\u043d \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439. \u041d\u043e \u0432\u043e\u0442 \u043f\u043b\u043e\u0434\u0438\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u0442\u0438\u043f\u0430\u0436\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u043e\u0436\u0438\u0440\u0430\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 \u043c\u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 embedded \u043a \u043a\u0443\u0447\u0435 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0449\u0435\u0439 \u043a\u0430\u043a Box&lt;> \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043c\u0430\u0448\u0438\u043d\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0432 \u201c\u0421\u201d \u0441\u0442\u0438\u043b\u0435 \u0443\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043f\u0440\u043e\u0441\u0442 \u0438 \u043f\u043e\u043d\u044f\u0442\u0435\u043d. \u0420\u0430\u0437\u0443\u0431\u0435\u0434\u0438\u0442\u0435 \u043c\u0435\u043d\u044f, \u0435\u0441\u043b\u0438 \u0441\u043c\u043e\u0436\u0435\u0442\u0435.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Result&lt;> \u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u043e\u0448\u0438\u0431\u043e\u043a. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0435\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0439 \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u201c?\u201d. \u0412 \u043c\u043e\u0435\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0441\u0451 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Result&lt;> \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0451 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442. \u0423\u043c\u043d\u044b\u0435 \u043a\u043d\u0438\u0433\u0438 \u0441\u043e\u0432\u0435\u0442\u0443\u044e\u0442 \u0434\u043b\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u043e\u0434\u043e\u0432 \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c Box&lt;>, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432 embedded \u043d\u0435\u0442. \u041d\u0443 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0434\u0438 \u043d\u0435\u0433\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043a\u0443\u0447\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<h2>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043b\u0430\u0439\u0444\u0445\u0430\u043a<\/h2>\n<p>\u0414\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 UPS, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0434\u0430\u0447\u0435, \u0430 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u0445\u043e\u0437\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c Arduino Nano. \u041d\u0430\u043f\u0438\u0441\u0430\u043b \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u043e\u0439 \u043c\u043d\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0434\u0435\u0441\u044c:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u0441\u043a\u0435\u0442\u0447\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;SoftwareSerial.h>  SoftwareSerial mySerial(10, 11); \/\/ RX, TX String stringOne = \"\"; unsigned long myTime;  void setup() {   mySerial.begin(2400); }  void loop() { \/\/ run over and over     stringOne = \"\";   myTime = millis();   for(;;) {     if (mySerial.available()) {       char c = mySerial.read();       Serial.write(c);       stringOne += c;       \/\/Serial.print(\"char read \\r\\n\");       if (c == '\\r' || stringOne.length() > 100) {break;};       myTime = millis();     } else {       if (millis() - myTime > 200)         break;     };   }    if (stringOne == \"Q1\\r\") {     if (millis() % 2) {       mySerial.print(\"(216.6 216.6 219.6 000 50.0 2.22 48.0 00000001\\r\");     } else {       mySerial.print(\"(219.6 219.6 000.0 000 50.0 2.22 48.0 10000001\\r\");     }   };   } <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u0430 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u043e<\/h2>\n<p>\u0412\u0441\u0451 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c! \u041f\u043e \u0445\u043e\u0434\u0443 \u0434\u0435\u043b\u0430 \u043d\u0435 \u043e\u0431\u043e\u0448\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043d\u043e \u0433\u0434\u0435 \u0438\u0445 \u043d\u0435\u0442? \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u043a\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f DIY. <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 \u043c\u043d\u0435 \u0442\u0430\u043a\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/693\/b34\/b31\/693b34b31a04a235a9bc034092092d50.jpg\" width=\"215\" height=\"241\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/693\/b34\/b31\/693b34b31a04a235a9bc034092092d50.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/github.com\/lesha108\/sim800_ups_monitor\" rel=\"noopener noreferrer nofollow\">\u0410 \u0432\u043e\u0442 \u0438 \u043e\u0431\u0435\u0449\u0430\u043d\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0432 GITHUB<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/594885\/\"> https:\/\/habr.com\/ru\/articles\/594885\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0435\u0431\u0435 \u043d\u0430 Arduino \u0431\u043b\u043e\u043a \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0434\u0430\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0442\u043b\u0430 \u043e\u0442 UPS. \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u0441\u0432\u044f\u0437\u043a\u0430 Arduino MEGA + \u0448\u0438\u043b\u0434 \u043d\u0430 SIM900 \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e. \u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0451 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442, \u0441\u0430\u043c\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0438 \u0442.\u0434. \u041e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0435\u0448\u0438\u043b \u0432\u0441\u0451 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u0445: \u0432\u0437\u044f\u043b \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 STM32 Bluepill, \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u043b \u043d\u0430 \u0430\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c SIM800L, \u043d\u043e \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2013 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 Rust, \u043a\u0443\u043f\u0438\u043b\u0441\u044f \u043d\u0430 \u043e\u0431\u0435\u0449\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438. \u0427\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h2>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 \u043d\u043e\u0432\u043e\u0439 \u0441\u0430\u043c\u043e\u0434\u0435\u043b\u043a\u0438.<\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u043d\u0430 \u0434\u0430\u0447\u0435 \u0441\u0442\u043e\u0438\u0442 UPS Inelt, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u043e\u0440\u0442 RS232 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f UPS. \u041e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0440\u0435\u0432\u043d\u0438\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0431\u043c\u0435\u043d\u0430 Megatec, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e UPS \u0438 \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044f \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u043e, \u0430 \u0432\u043e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u043d\u0430\u0442\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c: \u043a\u0430\u043a \u0442\u0430\u043c \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435, \u0436\u0438\u0432\u044b \u043b\u0438 \u0431\u0430\u0442\u0430\u0440\u0435\u0438 \u0438 \u043f\u0440. \u041d\u0430 \u0440\u044b\u043d\u043a\u0435 \u044f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0430\u043c. \u0412\u0441\u0451 \u0432 \u0434\u0443\u0445\u0435 DIY.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Megatec<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>Megatec Protocol information                         VERSION : 2.7                          DATE : SEP. 30, 1995  DATE:V2.7: JULY 30 ,1996  DATEDESCRIPTIONMODIFY BY 2.695-9-30UPDATE \"D\" COMMAND (SS.SS -> SSS.SS)Kevin Chiou 2.796-8-01Disable \"D\" COMMANDKevin Chiou  A. General: This document specifies the RS232C communication protocol of             the Advance-Intelligent UPS. The protocol provided the following             features :              1. Monitor charger status.             2. Monitor battery status and condition.             3. Monitor the utility status.             4. Provide the power switch function for computer to turn on and                off the utility on schedule for power saving.              Computer will control information exchange by a query followed by             &lt;cr>. UPS will respond with information followed by a &lt;cr> or             action.  B. Hardware:              BAUD RATE............... : 2400 bps             DATA LENGTH.......... : 8 bits             STOP BIT..................... : 1 bit             PARITY........................ : NONE              CABLING :                 COMPUTER                  UPS             ===================================                   RX   &lt;----------   TX  (pin 9)                   TX    ---------->  RX  (pin 6)                   GND  &lt;----------   GND (pin 7)                    (9 pins female D-type connector)  C. COMMUNICATION PROTOCOL:  1. Status Inquiry:  Computer : Q1&lt;cr>         UPS      : UPS status data stream, such as              (MMM.M NNN.N PPP.P QQQ RR.R S.SS TT.T  b7b6b5b4b3b2b1b0&lt;cr>          UPS status data stream : There should be a space character between every field for data separation. The meaning of each field is list as followed:                  a. Start byte    : (  b.I\/P voltage   : MMM.M                   M is and integer number ranging from 0 to 9.                   The unit is Volt.                  c.I\/P fault voltage : NNN.N                   N is and integer number ranging from 0 to 9.                   The unit is Volt.                    ** For OFF LINE UPS**                      Its purpose is to identify a short duration voltage glitch                   which cause OFF line UPS to go to Invter mode. If this occurs                   input voltage will appear normal at query prior to glitch and                   will still appear normal at next query.                     The I\/P fault voltage will hold glitch voltage till next                   query. After query, the I\/P fault voltage will be same as I\/P                   voltage until next glitch occurs.                    ** For ON LINE UPS**                      Its purpose is to identify a short duration utility fail                   which cause ON line UPS to go to battery mode. If this occurs                   input voltage will appear normal at query prior to fail and                   will still appear normal at next query.                     The I\/P fault voltage will hold utility fail voltage till                   next query. After query, the I\/P voltage will be same as I\/P                   voltage until next utility fail occurs.                  d.O\/P voltage   : PPP.P                   P is an integer number ranging form 0 to 9.                    The unit is Volt.                  e.O\/P current   : QQQ                   QQQ is a percent of maximum current, not an absolute value.                  f.I\/P frequency : RR.R                   R is an integer number ranging from 0 to 9.                   The unit is HZ.                  g.Battery voltage : SS.S or S.SS                   S is an integer number ranging from 0 to 9.                     For on-line units battery voltage\/cell is provided in the                   form S.SS .                     For standby units actual battery voltage is provided in                   the form SS.S .                     UPS type in UPS status will determine which reading was                   obtained.                  h.Temperature   : TT.T                   T is an integer number ranging form 0 to 9.                   The unit is degree of centigrade.                  i.UPS Status    : &lt;U>                   &lt;U> is one byte of binary information such as                   &lt;b7b6b5b4b3b2b1b0>.  Where bn is a ASCII character '0' or '1'. . UPS status : Bit             Description                   7  1 : Utility Fail (Immediate)              6  1 : Battery Low                           5  1 : Bypass\/Boost or Buck Active                   4  1 : UPS Failed                            3  1 : UPS Type is Standby (0 is On_line)    2  1 : Test in Progress                      1  1 : Shutdown Active                       0  1 : Beeper On                               j.Stop Byte     : &lt;cr>  Example: Computer : Q1&lt;cr>     UPS      :                          (208.4 140.0 208.4 034 59.9 2.05 35.0 00110000&lt;cr>                         Means    : I\/P voltage is 208.4V.                                   I\/P fault voltage is 140.0V.                                   O\/P voltage is 208.4V.                                   O\/P current is 34 %.                                   I\/P frequency is 59.9 HZ.                                   Battery voltage is 2.05V.                                   Temperature is 35.0 degrees of centigrade.                                   UPS type is on-line , UPS failed. Bypass                                   active , and shutdown not active.    2. Test for 10 seconds:          Computer  : T&lt;cr>         UPS       : Test for 10 seconds and return to utility.          If battery low occur during testing, UPS will return to         utility immediately.     3.Test until battery low :          Computer  : TL&lt;cr>         UPS       : Test until battery low and return to utility.     4.Test for specified time period :          Computer  : T&lt;n>&lt;cr>         UPS       : Test for &lt;n> minutes.          a. During testing, UPS returns to utility immediately, if            battery low occur.         b. &lt;n> is a number ranging from 01 to 99.     5. Turn On\/Off beep -- Toggle the UPS beeper :          Computer  : Q&lt;cr>          When the AC power failed, UPS will generate a warning beep to         inform the manager. Manager could toggle the warning beep by         sending this command .     6. Shutdown Command :          Computer  : S&lt;n>&lt;cr>         UPS       : Shut UPS output off in &lt;n> minutes.          a. The UPS output will be off in &lt;n> minutes, even if the            utility power is present.         b. If the battery low occurs before &lt;n> minutes, the            output is turned off immediately.         c. After UPS shutdown, the controller of UPS monitors the            utility power. If the utility is recovered, the UPS will wait            for 10 seconds and connect the utility to output.         d. &lt;n> is a number ranging form .2, .3, ..., 01, 02, ..., up to 10.          For example : S.3&lt;cr> --- shut output off in (.3) minutes     7. Shutdown and Restore Command :          Computer  : S&lt;n>R&lt;m>&lt;cr>         UPS       : Shut UPS output off in &lt;n> minutes, and waiting                     for &lt;m> minutes then turn on UPS output again.          a. The shutdown sequence is the same as the previous command.            When the &lt;m> minutes expired, the utility do not restore,            the UPS will wait until utility restore.         b. If UPS is in shutdown waiting state, the \"C\" command can            let the shutdown procedure cancelled.         c. If UPS is in restore waiting state, the \"C\" command can            let the UPS output turned on, but UPS must be hold off at            least 10 seconds. (if utility is present)         d. &lt;n> is a number ranging form .2, .3, ..., 01, 02, ..., up to 10.         e. &lt;m> is a number ranging form 0001 to 9999.     8. Cancel Shutdown Command :          Computer  : C&lt;cr>         UPS       : Cancel the SN&lt;n>&lt;cr> and SN&lt;n>R&lt;m>&lt;cr> command.          a. If UPS is in shut down waiting state, the shut down command            is cancelled.         b. If UPS is in restore waiting state, the UPS output is turned            on, but UPS must be hold off at least 10 seconds.            (if utility is present)     9. Cancel Test Command :          Computer  : CT&lt;cr>         UPS       : Cancel all test activity and connect the utility to                     output immediately.  10. UPS Information Command:  Computer: I&lt;cr> UPS: #Company_Name UPS_Model Version&lt;cr>  This function will make the UPS respond with the basic information about the company who manufacture the UPS, the model name of the UPS and the version number of the UPS firmware. The length of every field is listed as follows: Company_Name: 15 characters, leave space if less than 15 characters UPS_Model: 10 characters, leave space if less than 10<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-386240","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386240","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=386240"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386240\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=386240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=386240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=386240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}