handlePortal.svg 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <svg
  3. xmlns:dc="http://purl.org/dc/elements/1.1/"
  4. xmlns:cc="http://creativecommons.org/ns#"
  5. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  6. xmlns:svg="http://www.w3.org/2000/svg"
  7. xmlns="http://www.w3.org/2000/svg"
  8. id="svg8"
  9. version="1.1"
  10. viewBox="0 0 191.12044 454.37354"
  11. height="454.37354mm"
  12. width="191.12044mm">
  13. <defs
  14. id="defs2" />
  15. <metadata
  16. id="metadata5">
  17. <rdf:RDF>
  18. <cc:Work
  19. rdf:about="">
  20. <dc:format>image/svg+xml</dc:format>
  21. <dc:type
  22. rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
  23. <dc:title></dc:title>
  24. </cc:Work>
  25. </rdf:RDF>
  26. </metadata>
  27. <g
  28. transform="translate(143.18522,78.353435)"
  29. id="layer1">
  30. <g
  31. transform="translate(-143.18522,-78.340217)"
  32. id="g1243">
  33. <g
  34. id="layer2"
  35. transform="translate(5.0000008,4.9999992)"
  36. style="display:inline">
  37. <path
  38. d="M -4.9867716,-4.9999882 V 449.36032 M 0.30489485,-4.9999882 V 449.36032 M 5.5965614,-4.9999882 V 449.36032 M 10.888228,-4.9999882 V 449.36032 M 16.179894,-4.9999882 V 449.36032 M 21.471561,-4.9999882 V 449.36032 M 26.763227,-4.9999882 V 449.36032 M 32.054894,-4.9999882 V 449.36032 M 37.34656,-4.9999882 V 449.36032 M 42.638227,-4.9999882 V 449.36032 M 47.929893,-4.9999882 V 449.36032 M 53.22156,-4.9999882 V 449.36032 M 58.513227,-4.9999882 V 449.36032 M 63.804893,-4.9999882 V 449.36032 M 69.09656,-4.9999882 V 449.36032 M 74.388226,-4.9999882 V 449.36032 M 79.679893,-4.9999882 V 449.36032 M 84.971559,-4.9999882 V 449.36032 M 90.263226,-4.9999882 V 449.36032 M 95.554888,-4.9999882 V 449.36032 M 100.84656,-4.9999882 V 449.36032 M 106.13823,-4.9999882 V 449.36032 M 111.42989,-4.9999882 V 449.36032 M 116.72156,-4.9999882 V 449.36032 M 122.01323,-4.9999882 V 449.36032 M 127.30489,-4.9999882 V 449.36032 M 132.59656,-4.9999882 V 449.36032 M 137.88823,-4.9999882 V 449.36032 M 143.17989,-4.9999882 V 449.36032 M 148.47156,-4.9999882 V 449.36032 M 153.76323,-4.9999882 V 449.36032 M 159.05489,-4.9999882 V 449.36032 M 164.34656,-4.9999882 V 449.36032 M 169.63823,-4.9999882 V 449.36032 M 174.92989,-4.9999882 V 449.36032 M 180.22156,-4.9999882 V 449.36032 M 185.51323,-4.9999882 V 449.36032 M -4.9867716,-4.9999882 H 186.12043 M -4.9867716,0.29167834 H 186.12043 M -4.9867716,5.5833448 H 186.12043 M -4.9867716,10.875012 H 186.12043 M -4.9867716,16.166678 H 186.12043 M -4.9867716,21.458345 H 186.12043 M -4.9867716,26.750011 H 186.12043 M -4.9867716,32.041678 H 186.12043 M -4.9867716,37.333344 H 186.12043 M -4.9867716,42.625011 H 186.12043 M -4.9867716,47.916677 H 186.12043 M -4.9867716,53.208344 H 186.12043 M -4.9867716,58.500011 H 186.12043 M -4.9867716,63.791677 H 186.12043 M -4.9867716,69.083344 H 186.12043 M -4.9867716,74.37501 H 186.12043 M -4.9867716,79.666677 H 186.12043 M -4.9867716,84.958343 H 186.12043 M -4.9867716,90.25001 H 186.12043 M -4.9867716,95.541672 H 186.12043 M -4.9867716,100.83334 H 186.12043 M -4.9867716,106.12501 H 186.12043 M -4.9867716,111.41667 H 186.12043 M -4.9867716,116.70834 H 186.12043 M -4.9867716,122.00001 H 186.12043 M -4.9867716,127.29167 H 186.12043 M -4.9867716,132.58334 H 186.12043 M -4.9867716,137.87501 H 186.12043 M -4.9867716,143.16667 H 186.12043 M -4.9867716,148.45834 H 186.12043 M -4.9867716,153.75001 H 186.12043 M -4.9867716,159.04167 H 186.12043 M -4.9867716,164.33334 H 186.12043 M -4.9867716,169.62501 H 186.12043 M -4.9867716,174.91667 H 186.12043 M -4.9867716,180.20834 H 186.12043 M -4.9867716,185.50001 H 186.12043 M -4.9867716,190.79167 H 186.12043 M -4.9867716,196.08334 H 186.12043 M -4.9867716,201.37501 H 186.12043 M -4.9867716,206.66667 H 186.12043 M -4.9867716,211.95834 H 186.12043 M -4.9867716,217.25001 H 186.12043 M -4.9867716,222.54167 H 186.12043 M -4.9867716,227.83334 H 186.12043 M -4.9867716,233.125 H 186.12043 M -4.9867716,238.41667 H 186.12043 M -4.9867716,243.70834 H 186.12043 M -4.9867716,249 H 186.12043 M -4.9867716,254.29167 H 186.12043 M -4.9867716,259.58334 H 186.12043 M -4.9867716,264.875 H 186.12043 M -4.9867716,270.16667 H 186.12043 M -4.9867716,275.45834 H 186.12043 M -4.9867716,280.75 H 186.12043 M -4.9867716,286.04167 H 186.12043 M -4.9867716,291.33334 H 186.12043 M -4.9867716,296.625 H 186.12043 M -4.9867716,301.91667 H 186.12043 M -4.9867716,307.20834 H 186.12043 M -4.9867716,312.5 H 186.12043 M -4.9867716,317.79167 H 186.12043 M -4.9867716,323.08334 H 186.12043 M -4.9867716,328.375 H 186.12043 M -4.9867716,333.66667 H 186.12043 M -4.9867716,338.95834 H 186.12043 M -4.9867716,344.25 H 186.12043 M -4.9867716,349.54167 H 186.12043 M -4.9867716,354.83334 H 186.12043 M -4.9867716,360.125 H 186.12043 M -4.9867716,365.41667 H 186.12043 M -4.9867716,370.70834 H 186.12043 M -4.9867716,376 H 186.12043 M -4.9867716,381.29167 H 186.12043 M -4.9867716,386.58333 H 186.12043 M -4.9867716,391.875 H 186.12043 M -4.9867716,397.16667 H 186.12043 M -4.9867716,402.45833 H 186.12043 M -4.9867716,407.75 H 186.12043 M -4.9867716,413.04167 H 186.12043 M -4.9867716,418.33333 H 186.12043 M -4.9867716,423.625 H 186.12043 M -4.9867716,428.91667 H 186.12043 M -4.9867716,434.20833 H 186.12043 M -4.9867716,439.5 H 186.12043 M -4.9867716,444.79167 H 186.12043"
  39. style="fill:none;stroke:#000000;stroke-width:0.0264583px"
  40. id="path4982" />
  41. </g>
  42. <g
  43. id="layer1-3"
  44. transform="translate(46.95536,63.837051)"
  45. style="display:inline">
  46. <text
  47. xml:space="preserve"
  48. style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.88055563px;line-height:1.25;font-family:monospace;-inkscape-font-specification:monospace;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
  49. x="-41.95536"
  50. y="-56.407742"
  51. id="text4506"><tspan
  52. id="tspan4504"
  53. x="-41.95536"
  54. y="-56.407742"
  55. style="font-size:3.17499995px;stroke-width:0.26458332"><tspan
  56. style="fill:#669900"
  57. id="tspan4776">#include</tspan> &lt;<tspan
  58. style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:'monospace Italic'"
  59. id="tspan4780">ESP8266WiFi.h</tspan>&gt;</tspan><tspan
  60. x="-41.95536"
  61. y="-51.557049"
  62. style="font-size:3.17499995px;stroke-width:0.26458332"
  63. id="tspan4508"><tspan
  64. style="fill:#669900"
  65. id="tspan4778">#include</tspan> &lt;<tspan
  66. style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:'monospace Italic'"
  67. id="tspan4782">ESP8266WebServer.h</tspan>&gt;</tspan><tspan
  68. x="-41.95536"
  69. y="-46.706352"
  70. style="font-size:3.17499995px;stroke-width:0.26458332"
  71. id="tspan4510"><tspan
  72. style="fill:#669900"
  73. id="tspan4786">#include</tspan> &lt;<tspan
  74. style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:'monospace Italic'"
  75. id="tspan4784">AutoConnect.h</tspan>&gt;</tspan><tspan
  76. x="-41.95536"
  77. y="-41.855659"
  78. style="font-size:3.17499995px;stroke-width:0.26458332"
  79. id="tspan4512" /><tspan
  80. x="-41.95536"
  81. y="-37.004963"
  82. style="font-size:3.17499995px;stroke-width:0.26458332"
  83. id="tspan4516"><tspan
  84. style="fill:#ff6600"
  85. id="tspan4790">AutoConnect </tspan>portal;</tspan><tspan
  86. x="-41.95536"
  87. y="-32.15427"
  88. style="font-size:3.17499995px;stroke-width:0.26458332"
  89. id="tspan4518" /><tspan
  90. x="-41.95536"
  91. y="-27.303574"
  92. style="font-size:3.17499995px;stroke-width:0.26458332"
  93. id="tspan4520"><tspan
  94. style="fill:#3366cc"
  95. id="tspan4792">void</tspan> handleRoot() {</tspan><tspan
  96. x="-41.95536"
  97. y="-22.452879"
  98. style="font-size:3.17499995px;stroke-width:0.26458332"
  99. id="tspan4522"><tspan
  100. style="fill:#3366cc"
  101. id="tspan4794">String</tspan> page = PSTR(</tspan><tspan
  102. x="-41.95536"
  103. y="-17.602184"
  104. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  105. id="tspan4524">&quot;&lt;html&gt;&quot;</tspan><tspan
  106. x="-41.95536"
  107. y="-12.751491"
  108. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  109. id="tspan4526">&quot;&lt;head&gt;&quot;</tspan><tspan
  110. x="-41.95536"
  111. y="-7.9007959"
  112. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  113. id="tspan4528"> &quot;&lt;meta name=\&quot;viewport\&quot; content=\&quot;width=device-width, initial-scale=1\&quot;&gt;&quot;</tspan><tspan
  114. x="-41.95536"
  115. y="-3.0501018"
  116. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  117. id="tspan4530"> &quot;&lt;style type=\&quot;text/css\&quot;&gt;&quot;</tspan><tspan
  118. x="-41.95536"
  119. y="1.8005929"
  120. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  121. id="tspan4532"> &quot;body {&quot;</tspan><tspan
  122. x="-41.95536"
  123. y="6.6512876"
  124. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  125. id="tspan4534"> &quot;-webkit-appearance:none;&quot;</tspan><tspan
  126. x="-41.95536"
  127. y="11.501982"
  128. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  129. id="tspan4536"> &quot;-moz-appearance:none;&quot;</tspan><tspan
  130. x="-41.95536"
  131. y="16.352676"
  132. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  133. id="tspan4538"> &quot;font-family:'Arial',sans-serif;&quot;</tspan><tspan
  134. x="-41.95536"
  135. y="21.203371"
  136. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  137. id="tspan4540"> &quot;text-align:center;&quot;</tspan><tspan
  138. x="-41.95536"
  139. y="26.054066"
  140. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  141. id="tspan4542"> &quot;}&quot;</tspan><tspan
  142. x="-41.95536"
  143. y="30.90476"
  144. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  145. id="tspan4544"> &quot;.menu {&quot;</tspan><tspan
  146. x="-41.95536"
  147. y="35.755455"
  148. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  149. id="tspan4546"> &quot;text-align:right;&quot;</tspan><tspan
  150. x="-41.95536"
  151. y="40.606148"
  152. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  153. id="tspan4548"> &quot;}&quot;</tspan><tspan
  154. x="-41.95536"
  155. y="45.456844"
  156. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  157. id="tspan4550"> &quot;.button {&quot;</tspan><tspan
  158. x="-41.95536"
  159. y="50.307537"
  160. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  161. id="tspan4552"> &quot;display:inline-block;&quot;</tspan><tspan
  162. x="-41.95536"
  163. y="55.158234"
  164. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  165. id="tspan4554"> &quot;border-radius:7px;&quot;</tspan><tspan
  166. x="-41.95536"
  167. y="60.008926"
  168. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  169. id="tspan4556"> &quot;background:#73ad21;&quot;</tspan><tspan
  170. x="-41.95536"
  171. y="64.859619"
  172. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  173. id="tspan4558"> &quot;margin:0 10px 0 10px;&quot;</tspan><tspan
  174. x="-41.95536"
  175. y="69.71032"
  176. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  177. id="tspan4560"> &quot;padding:10px 20px 10px 20px;&quot;</tspan><tspan
  178. x="-41.95536"
  179. y="74.561012"
  180. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  181. id="tspan4562"> &quot;text-decoration:none;&quot;</tspan><tspan
  182. x="-41.95536"
  183. y="79.411705"
  184. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  185. id="tspan4564"> &quot;color:#000000;&quot;</tspan><tspan
  186. x="-41.95536"
  187. y="84.262398"
  188. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  189. id="tspan4566"> &quot;}&quot;</tspan><tspan
  190. x="-41.95536"
  191. y="89.113098"
  192. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  193. id="tspan4568"> &quot;&lt;/style&gt;&quot;</tspan><tspan
  194. x="-41.95536"
  195. y="93.963791"
  196. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  197. id="tspan4570">&quot;&lt;/head&gt;&quot;</tspan><tspan
  198. x="-41.95536"
  199. y="98.814484"
  200. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  201. id="tspan4572">&quot;&lt;body&gt;&quot;</tspan><tspan
  202. x="-41.95536"
  203. y="103.66518"
  204. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  205. id="tspan4574"> &quot;&lt;p class=\&quot;menu\&quot;&gt;&quot; <tspan
  206. style="fill:#000000"
  207. id="tspan4798">AUTOCONNECT_LINK(BAR_32)</tspan> &quot;&lt;/p&gt;&quot;</tspan><tspan
  208. x="-41.95536"
  209. y="108.51587"
  210. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  211. id="tspan4576"> &quot;BUILT-IN LED&lt;br&gt;&quot;</tspan><tspan
  212. x="-41.95536"
  213. y="113.36657"
  214. style="font-size:3.17499995px;stroke-width:0.26458332"
  215. id="tspan4578"><tspan
  216. style="fill:#003399"
  217. id="tspan4796"> &quot;GPIO(&quot;</tspan>);</tspan><tspan
  218. x="-41.95536"
  219. y="118.21726"
  220. style="font-size:3.17499995px;stroke-width:0.26458332"
  221. id="tspan4580"> page += <tspan
  222. style="fill:#3366cc"
  223. id="tspan4800">String</tspan>(BUILTIN_LED);</tspan><tspan
  224. x="-41.95536"
  225. y="123.06796"
  226. style="font-size:3.17499995px;stroke-width:0.26458332"
  227. id="tspan4582"> page += <tspan
  228. style="fill:#3366cc"
  229. id="tspan4802">String</tspan>(F(<tspan
  230. style="fill:#003399"
  231. id="tspan4804">&quot;) : &lt;span style=\&quot;font-weight:bold;color:&quot;</tspan>));</tspan><tspan
  232. x="-41.95536"
  233. y="127.91865"
  234. style="font-size:3.17499995px;stroke-width:0.26458332"
  235. id="tspan4584"> page += <tspan
  236. style="fill:#ff6600"
  237. id="tspan4806">digitalRead</tspan>(BUILTIN_LED) ? <tspan
  238. style="fill:#3366cc"
  239. id="tspan4808">String</tspan>(<tspan
  240. style="fill:#003399"
  241. id="tspan4812">&quot;Tomato\&quot;&gt;HIGH&quot;</tspan>) : <tspan
  242. style="fill:#3366cc"
  243. id="tspan4814">String</tspan>(<tspan
  244. style="fill:#003399"
  245. id="tspan4816">&quot;SlateBlue\&quot;&gt;LOW&quot;</tspan>);</tspan><tspan
  246. x="-41.95536"
  247. y="132.76935"
  248. style="font-size:3.17499995px;stroke-width:0.26458332"
  249. id="tspan4586"> page += <tspan
  250. style="fill:#ff6600"
  251. id="tspan4818">String</tspan>(F(<tspan
  252. style="fill:#003399"
  253. id="tspan4820">&quot;&lt;/span&gt;&quot;</tspan>));</tspan><tspan
  254. x="-41.95536"
  255. y="137.62004"
  256. style="font-size:3.17499995px;stroke-width:0.26458332"
  257. id="tspan4588"> page += <tspan
  258. style="fill:#ff6600"
  259. id="tspan4822">String</tspan>(F(<tspan
  260. style="fill:#003399"
  261. id="tspan4826">&quot;&lt;p&gt;&lt;a class=\&quot;button\&quot; href=\&quot;/io?v=low\&quot;&gt;low&lt;/a&gt;</tspan></tspan><tspan
  262. x="-41.95536"
  263. y="142.47073"
  264. style="font-size:3.17499995px;stroke-width:0.26458332"
  265. id="tspan4968"><tspan
  266. style="fill:#003399"
  267. id="tspan4970"> &lt;a class=\&quot;button\&quot; href=\&quot;/io?v=high\&quot;&gt;high&lt;/a&gt;&lt;/p&gt;&quot;</tspan>));</tspan><tspan
  268. x="-41.95536"
  269. y="147.32143"
  270. style="font-size:3.17499995px;stroke-width:0.26458332"
  271. id="tspan4590"> page += <tspan
  272. style="fill:#ff6600"
  273. id="tspan4824">String</tspan>(F(<tspan
  274. style="fill:#003399"
  275. id="tspan4828">&quot;&lt;/body&gt;&lt;/html&gt;&quot;</tspan>));</tspan><tspan
  276. x="-41.95536"
  277. y="152.17212"
  278. style="font-size:3.17499995px;stroke-width:0.26458332"
  279. id="tspan4592"> portal.<tspan
  280. style="fill:#ff6600"
  281. id="tspan5104">host</tspan>().<tspan
  282. style="fill:#ff6600"
  283. id="tspan4832">send</tspan>(200, <tspan
  284. style="fill:#003399"
  285. id="tspan4834">&quot;text/html&quot;</tspan>, page);</tspan><tspan
  286. x="-41.95536"
  287. y="157.02281"
  288. style="font-size:3.17499995px;stroke-width:0.26458332"
  289. id="tspan4594">}</tspan><tspan
  290. x="-41.95536"
  291. y="161.87352"
  292. style="font-size:3.17499995px;stroke-width:0.26458332"
  293. id="tspan4596" /><tspan
  294. x="-41.95536"
  295. y="166.72421"
  296. style="font-size:3.17499995px;stroke-width:0.26458332"
  297. id="tspan4598"><tspan
  298. style="fill:#3366cc"
  299. id="tspan4836">void</tspan> handleGPIO() {</tspan><tspan
  300. x="-41.95536"
  301. y="171.57491"
  302. style="font-size:3.17499995px;stroke-width:0.26458332"
  303. id="tspan5040"><tspan
  304. style="fill:#ff6600"
  305. id="tspan5088">ESP8266WebServer</tspan>&amp; server = portal.<tspan
  306. style="fill:#ff6600"
  307. id="tspan5084">host</tspan>();</tspan><tspan
  308. x="-41.95536"
  309. y="176.4256"
  310. style="font-size:3.17499995px;stroke-width:0.26458332"
  311. id="tspan4600"><tspan
  312. style="fill:#808080"
  313. id="tspan4838">if</tspan> (server.<tspan
  314. style="fill:#ff6600"
  315. id="tspan4842">arg</tspan>(<tspan
  316. style="fill:#003399"
  317. id="tspan4844">&quot;v&quot;</tspan>) == <tspan
  318. style="fill:#003399"
  319. id="tspan4846">&quot;low&quot;</tspan>)</tspan><tspan
  320. x="-41.95536"
  321. y="181.27629"
  322. style="font-size:3.17499995px;stroke-width:0.26458332"
  323. id="tspan4602"><tspan
  324. style="fill:#ff6600"
  325. id="tspan4850">digitalWrite</tspan>(BUILTIN_LED, <tspan
  326. style="fill:#ff6600"
  327. id="tspan4852">LOW</tspan>);</tspan><tspan
  328. x="-41.95536"
  329. y="186.12698"
  330. style="font-size:3.17499995px;stroke-width:0.26458332"
  331. id="tspan4604"><tspan
  332. style="fill:#808080"
  333. id="tspan4860">else</tspan><tspan
  334. style="fill:#808080"
  335. id="tspan4862">if</tspan> (server.<tspan
  336. style="fill:#ff6600"
  337. id="tspan4858">arg</tspan>(<tspan
  338. style="fill:#003399"
  339. id="tspan4856">&quot;v&quot;</tspan>) == <tspan
  340. style="fill:#003399"
  341. id="tspan4854">&quot;high&quot;</tspan>)</tspan><tspan
  342. x="-41.95536"
  343. y="190.97768"
  344. style="font-size:3.17499995px;stroke-width:0.26458332"
  345. id="tspan4606"><tspan
  346. style="fill:#ff6600"
  347. id="tspan4864">digitalWrite</tspan>(BUILTIN_LED, <tspan
  348. style="fill:#ff6600"
  349. id="tspan4866">HIGH</tspan>);</tspan><tspan
  350. x="-41.95536"
  351. y="195.82837"
  352. style="font-size:3.17499995px;stroke-width:0.26458332"
  353. id="tspan4608"> sendRedirect(&quot;/&quot;);</tspan><tspan
  354. x="-41.95536"
  355. y="200.67906"
  356. style="font-size:3.17499995px;stroke-width:0.26458332"
  357. id="tspan4610">}</tspan><tspan
  358. x="-41.95536"
  359. y="205.52977"
  360. style="font-size:3.17499995px;stroke-width:0.26458332"
  361. id="tspan4612" /><tspan
  362. x="-41.95536"
  363. y="210.38046"
  364. style="font-size:3.17499995px;stroke-width:0.26458332"
  365. id="tspan4614"><tspan
  366. style="fill:#3366cc"
  367. id="tspan4868">void</tspan> sendRedirect(<tspan
  368. style="fill:#3366cc"
  369. id="tspan4870">String</tspan> uri) {</tspan><tspan
  370. x="-41.95536"
  371. y="215.23116"
  372. style="font-size:3.17499995px;stroke-width:0.26458332"
  373. id="tspan5042"><tspan
  374. style="fill:#ff6600"
  375. id="tspan5090">ESP8266WebServer</tspan>&amp; server = portal.<tspan
  376. style="fill:#ff6600"
  377. id="tspan5086">host</tspan>();</tspan><tspan
  378. x="-41.95536"
  379. y="220.08185"
  380. style="font-size:3.17499995px;stroke-width:0.26458332"
  381. id="tspan4616"> server.<tspan
  382. style="fill:#ff6600"
  383. id="tspan4872">sendHeader</tspan>(<tspan
  384. style="fill:#003399"
  385. id="tspan4874">&quot;Location&quot;</tspan>, uri, <tspan
  386. style="fill:#3366cc"
  387. id="tspan4876">true</tspan>);</tspan><tspan
  388. x="-41.95536"
  389. y="224.93254"
  390. style="font-size:3.17499995px;stroke-width:0.26458332"
  391. id="tspan4618"> server.<tspan
  392. style="fill:#ff6600"
  393. id="tspan4880">send</tspan>(302, &quot;text/plain&quot;, <tspan
  394. style="fill:#003399"
  395. id="tspan4878">&quot;&quot;</tspan>);</tspan><tspan
  396. x="-41.95536"
  397. y="229.78323"
  398. style="font-size:3.17499995px;stroke-width:0.26458332"
  399. id="tspan4620"> server.<tspan
  400. style="fill:#ff6600"
  401. id="tspan4884">client</tspan>().<tspan
  402. style="fill:#ff6600"
  403. id="tspan4886">stop</tspan>();</tspan><tspan
  404. x="-41.95536"
  405. y="234.63393"
  406. style="font-size:3.17499995px;stroke-width:0.26458332"
  407. id="tspan4622">}</tspan><tspan
  408. x="-41.95536"
  409. y="239.48462"
  410. style="font-size:3.17499995px;stroke-width:0.26458332"
  411. id="tspan4624" /><tspan
  412. x="-41.95536"
  413. y="244.33533"
  414. style="font-size:3.17499995px;stroke-width:0.26458332"
  415. id="tspan4626"><tspan
  416. style="fill:#3366cc"
  417. id="tspan4890">void</tspan> setup() {</tspan><tspan
  418. x="-41.95536"
  419. y="249.18602"
  420. style="font-size:3.17499995px;stroke-width:0.26458332"
  421. id="tspan4628"><tspan
  422. style="fill:#ff6600"
  423. id="tspan4888">delay</tspan>(1000);</tspan><tspan
  424. x="-41.95536"
  425. y="254.03671"
  426. style="font-size:3.17499995px;stroke-width:0.26458332"
  427. id="tspan4630"><tspan
  428. style="fill:#ff6600"
  429. id="tspan4892">Serial</tspan>.<tspan
  430. style="fill:#ff6600"
  431. id="tspan4894">begin</tspan>(115200);</tspan><tspan
  432. x="-41.95536"
  433. y="258.88739"
  434. style="font-size:3.17499995px;stroke-width:0.26458332"
  435. id="tspan4632"><tspan
  436. style="fill:#ff6600"
  437. id="tspan4898">Serial</tspan>.<tspan
  438. style="fill:#ff6600"
  439. id="tspan4896">println</tspan>();</tspan><tspan
  440. x="-41.95536"
  441. y="263.7381"
  442. style="font-size:3.17499995px;stroke-width:0.26458332"
  443. id="tspan4634"><tspan
  444. style="fill:#ff6600"
  445. id="tspan4900">pinMode</tspan>(BUILTIN_LED, <tspan
  446. style="fill:#ff6600"
  447. id="tspan4902">OUTPUT</tspan>);</tspan><tspan
  448. x="-41.95536"
  449. y="268.58881"
  450. style="font-size:3.17499995px;stroke-width:0.26458332"
  451. id="tspan4636" /><tspan
  452. x="-41.95536"
  453. y="273.43948"
  454. style="font-size:3.17499995px;stroke-width:0.26458332"
  455. id="tspan4638"><tspan
  456. style="fill:#808080"
  457. id="tspan4904">// Put the home location of the web site.</tspan></tspan><tspan
  458. x="-41.95536"
  459. y="278.29019"
  460. style="font-size:3.17499995px;stroke-width:0.26458332"
  461. id="tspan4640"><tspan
  462. style="fill:#808080"
  463. id="tspan4906">// But in usually, setting the home uri is not needed cause default location is &quot;/&quot;.</tspan></tspan><tspan
  464. x="-41.95536"
  465. y="283.14087"
  466. style="font-size:3.17499995px;stroke-width:0.26458332"
  467. id="tspan4642"><tspan
  468. style="fill:#808080"
  469. id="tspan4908">//portal.home(&quot;/&quot;);</tspan></tspan><tspan
  470. x="-41.95536"
  471. y="287.99158"
  472. style="font-size:3.17499995px;stroke-width:0.26458332"
  473. id="tspan4644" /><tspan
  474. x="-41.95536"
  475. y="292.84225"
  476. style="font-size:3.17499995px;stroke-width:0.26458332"
  477. id="tspan4652"> // Starts user web site included the AutoConnect portal.</tspan><tspan
  478. x="-41.95536"
  479. y="297.69296"
  480. style="font-size:3.17499995px;stroke-width:0.26458332"
  481. id="tspan4654"><tspan
  482. style="fill:#808080"
  483. id="tspan4934">if</tspan> (portal.<tspan
  484. style="fill:#ff6600"
  485. id="tspan4918">begin</tspan>()) {</tspan><tspan
  486. x="-41.95536"
  487. y="302.54364"
  488. style="font-size:3.17499995px;stroke-width:0.26458332"
  489. id="tspan4656"><tspan
  490. style="fill:#ff6600"
  491. id="tspan5092">ESP8266WebServer</tspan>&amp; server = portal.<tspan
  492. style="fill:#ff6600"
  493. id="tspan5094">host</tspan>();</tspan><tspan
  494. x="-41.95536"
  495. y="307.39435"
  496. style="font-size:3.17499995px;stroke-width:0.26458332"
  497. id="tspan5044"> server.<tspan
  498. style="fill:#ff6600"
  499. id="tspan5096">on</tspan>(<tspan
  500. style="fill:#003399"
  501. id="tspan5100">&quot;/&quot;</tspan>, handleRoot);</tspan><tspan
  502. x="-41.95536"
  503. y="312.24506"
  504. style="font-size:3.17499995px;stroke-width:0.26458332"
  505. id="tspan5052"> server.<tspan
  506. style="fill:#ff6600"
  507. id="tspan5098">on</tspan>(<tspan
  508. style="fill:#003399"
  509. id="tspan5102">&quot;/io&quot;</tspan>, handleGPIO);</tspan><tspan
  510. x="-41.95536"
  511. y="317.09573"
  512. style="font-size:3.17499995px;stroke-width:0.26458332"
  513. id="tspan5060"><tspan
  514. style="fill:#ff6600"
  515. id="tspan4920">Serial</tspan>.<tspan
  516. style="fill:#ff6600"
  517. id="tspan4922">println</tspan>(<tspan
  518. style="fill:#003399"
  519. id="tspan4924">&quot;Started, IP:&quot;</tspan> + <tspan
  520. style="fill:#ff6600"
  521. id="tspan4926">WiFi</tspan>.<tspan
  522. style="fill:#ff6600"
  523. id="tspan4928">localIP</tspan>().<tspan
  524. style="fill:#ff6600"
  525. id="tspan4930">toString</tspan>());</tspan><tspan
  526. x="-41.95536"
  527. y="321.94644"
  528. style="font-size:3.17499995px;stroke-width:0.26458332"
  529. id="tspan4658"> }</tspan><tspan
  530. x="-41.95536"
  531. y="326.79712"
  532. style="font-size:3.17499995px;stroke-width:0.26458332"
  533. id="tspan4660"><tspan
  534. style="fill:#808080"
  535. id="tspan4936">else</tspan> {</tspan><tspan
  536. x="-41.95536"
  537. y="331.64783"
  538. style="font-size:3.17499995px;stroke-width:0.26458332"
  539. id="tspan4662"><tspan
  540. style="fill:#ff6600"
  541. id="tspan4938">Serial</tspan>.<tspan
  542. style="fill:#ff6600"
  543. id="tspan4940">println</tspan>(<tspan
  544. style="fill:#003399"
  545. id="tspan4942">&quot;Connection failed.&quot;</tspan>);</tspan><tspan
  546. x="-41.95536"
  547. y="336.4985"
  548. style="font-size:3.17499995px;stroke-width:0.26458332"
  549. id="tspan4664"><tspan
  550. style="fill:#808080"
  551. id="tspan4944">while</tspan> (<tspan
  552. style="fill:#3366cc"
  553. id="tspan4946">true</tspan>) { <tspan
  554. style="fill:#ff6600"
  555. id="tspan4948">yield</tspan>(); }</tspan><tspan
  556. x="-41.95536"
  557. y="341.34921"
  558. style="font-size:3.17499995px;stroke-width:0.26458332"
  559. id="tspan4666"> }</tspan><tspan
  560. x="-41.95536"
  561. y="346.19989"
  562. style="font-size:3.17499995px;stroke-width:0.26458332"
  563. id="tspan4668">}</tspan><tspan
  564. x="-41.95536"
  565. y="351.0506"
  566. style="font-size:3.17499995px;stroke-width:0.26458332"
  567. id="tspan4670" /><tspan
  568. x="-41.95536"
  569. y="355.90131"
  570. style="font-size:3.17499995px;stroke-width:0.26458332"
  571. id="tspan4672"><tspan
  572. style="fill:#3366cc"
  573. id="tspan4950">void</tspan> loop() {</tspan><tspan
  574. x="-41.95536"
  575. y="360.75198"
  576. style="font-size:3.17499995px;stroke-width:0.26458332"
  577. id="tspan4676"> portal.<tspan
  578. style="fill:#ff6600"
  579. id="tspan4954">handleClient</tspan>(); // Need handleClient only.</tspan><tspan
  580. x="-41.95536"
  581. y="365.60269"
  582. style="font-size:3.17499995px;stroke-width:0.26458332"
  583. id="tspan4678"><tspan
  584. style="fill:#808080"
  585. id="tspan4966">if</tspan> (<tspan
  586. style="fill:#ff6600"
  587. id="tspan4956">WiFi</tspan>.<tspan
  588. style="fill:#ff6600"
  589. id="tspan4958">status</tspan>() == <tspan
  590. style="fill:#3366cc"
  591. id="tspan4960">WL_IDLE_STATUS</tspan>) {</tspan><tspan
  592. x="-41.95536"
  593. y="370.45337"
  594. style="font-size:3.17499995px;stroke-width:0.26458332"
  595. id="tspan4680"> ESP.<tspan
  596. style="fill:#ff6600"
  597. id="tspan4962">reset</tspan>();</tspan><tspan
  598. x="-41.95536"
  599. y="375.30408"
  600. style="font-size:3.17499995px;stroke-width:0.26458332"
  601. id="tspan4682"><tspan
  602. style="fill:#ff6600"
  603. id="tspan4964">delay</tspan>(1000);</tspan><tspan
  604. x="-41.95536"
  605. y="380.15475"
  606. style="font-size:3.17499995px;stroke-width:0.26458332"
  607. id="tspan4684"> }</tspan><tspan
  608. x="-41.95536"
  609. y="385.00546"
  610. style="font-size:3.17499995px;stroke-width:0.26458332"
  611. id="tspan4686">}</tspan><tspan
  612. x="-41.95536"
  613. y="389.85617"
  614. style="font-size:3.17499995px;stroke-width:0.26458332"
  615. id="tspan4688" /></text>
  616. </g>
  617. <g
  618. id="layer3"
  619. style="display:inline">
  620. <path
  621. style="display:inline;opacity:1;vector-effect:none;fill:#558c3d;fill-opacity:0.71119133;stroke:none;stroke-width:2.26596642;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:2.2659663, 2.2659663;stroke-dashoffset:0;stroke-opacity:0.74117647;paint-order:stroke markers fill"
  622. id="path4984-8-8"
  623. d="m 119.94348,365.5661 -8.69884,-5.02228 8.69884,-5.02227 z" />
  624. <text
  625. xml:space="preserve"
  626. style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888855px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
  627. x="115.3639"
  628. y="27.289909"
  629. id="text4702"><tspan
  630. x="115.3639"
  631. y="27.289909"
  632. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  633. id="tspan4972">1. Declare AutoConnect only</tspan></text>
  634. <text
  635. xml:space="preserve"
  636. style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888855px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
  637. x="115.7594"
  638. y="373.71988"
  639. id="text4702-1"><tspan
  640. id="tspan4700-2"
  641. x="115.7594"
  642. y="373.71988"
  643. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332">4. Register request handlers</tspan><tspan
  644. x="115.7594"
  645. y="379.89349"
  646. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  647. id="tspan4974"> to ESP8266WebServer</tspan></text>
  648. <text
  649. xml:space="preserve"
  650. style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888855px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
  651. x="122.43944"
  652. y="358.74286"
  653. id="text4702-1-3"><tspan
  654. id="tspan4700-2-3"
  655. x="122.43944"
  656. y="358.74286"
  657. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332">3. Start AutoConnect,</tspan><tspan
  658. x="122.43944"
  659. y="364.91647"
  660. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  661. id="tspan4976"> no need server.begin()</tspan></text>
  662. <text
  663. xml:space="preserve"
  664. style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888855px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
  665. x="127.32045"
  666. y="422.84482"
  667. id="text4702-1-3-9-5"><tspan
  668. id="tspan4700-2-3-5-1"
  669. x="127.32045"
  670. y="422.84482"
  671. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332">5. Perform handleClient</tspan><tspan
  672. x="127.32045"
  673. y="429.01843"
  674. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  675. id="tspan4980"> for AutoConnect</tspan></text>
  676. <path
  677. style="opacity:1;vector-effect:none;fill:#558c3d;fill-opacity:0.71119133;stroke:none;stroke-width:2.26596642;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:2.26596625, 2.26596625;stroke-dashoffset:0;stroke-opacity:0.74117647;paint-order:stroke markers fill"
  678. id="path4984"
  679. d="m 113.53278,30.932772 -8.69884,-5.022277 8.69884,-5.022275 z" />
  680. <path
  681. style="display:inline;opacity:1;vector-effect:none;fill:#558c3d;fill-opacity:0.71119133;stroke:none;stroke-width:2.26596642;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:2.26596627, 2.26596627;stroke-dashoffset:0;stroke-opacity:0.74117647;paint-order:stroke markers fill"
  682. id="path4984-8"
  683. d="m 113.91916,379.99377 -8.69884,-5.02227 8.69884,-5.02228 z" />
  684. <path
  685. style="display:inline;opacity:1;vector-effect:none;fill:#558c3d;fill-opacity:0.71119133;stroke:none;stroke-width:2.26596642;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:2.26596632, 2.26596632;stroke-dashoffset:0;stroke-opacity:0.74117647;paint-order:stroke markers fill"
  686. id="path4984-8-8-6"
  687. d="m 124.96248,429.10303 -8.69884,-5.02228 8.69884,-5.02228 z" />
  688. <text
  689. xml:space="preserve"
  690. style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888855px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
  691. x="108.45959"
  692. y="235.34866"
  693. id="text4702-2"><tspan
  694. x="108.45959"
  695. y="235.34866"
  696. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  697. id="tspan4972-5">2. Refer to ESP8266WebServer</tspan></text>
  698. <path
  699. style="display:inline;opacity:1;vector-effect:none;fill:#558c3d;fill-opacity:0.71119133;stroke:none;stroke-width:2.26596642;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:2.26596627, 2.26596627;stroke-dashoffset:0;stroke-opacity:0.74117647;paint-order:stroke markers fill"
  700. id="path4984-6"
  701. d="m 105.91244,238.99179 -8.698832,-5.02228 8.698842,-5.02227 z" />
  702. </g>
  703. </g>
  704. </g>
  705. </svg>