[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/unreliablecode/lib-python/master/examples/10_rtc_sync.py [Back]  [Original]

"""
[RTC EXAMPLE] ========================================================================================================

Environment prepare:
In your Blynk App project:
  - add "RTC" widget,
  - set required TimeZone,
  - Run the App (green triangle in the upper right corner).
  - define your auth token for current example and run it


This started program on connect will send rtc_sync call to server.
RTC reply will be captured by "internal_rtc" handler
UTC time with required timezone correction will be printed

Schema:
=====================================================================================================================
           +-----------+                        +--------------+                    +--------------+
           |           |                        |              |                    |              |
           | blynk lib |                        | blynk server |                    |  blynk app   |
           |           |                        |              |                    |              |
           |           |                        |              |                    |              |
           +-----+-----+                        +------+-------+                    +-------+------+
                 |                                     |                                    |
connect handler  |                                     |                                    |
         +-------+                                     |                                    |
         |       |                                     |                                    |
         |       |        rtc sync                     |                                    |
         +------>------------------------------------->+        rtc widget present in app?  |
                 |                                     +----------------------------------->+
                 |                                     |                                    |
                 |                                     |           yes rtc widget found     |
                 |    rtc with timezone correction     +

Web Proxy Viewer  |  New URL  |  Original Page