handleClient.svg 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  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.10721 454.36032"
  11. height="454.36032mm"
  12. width="191.10721mm">
  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. style="display:inline"
  29. transform="translate(5.0000008,4.9999992)"
  30. id="layer2">
  31. <path
  32. id="path4982"
  33. style="fill:none;stroke:#000000;stroke-width:0.0264583px"
  34. 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" />
  35. </g>
  36. <g
  37. style="display:inline"
  38. transform="translate(46.95536,63.837051)"
  39. id="layer1">
  40. <text
  41. id="text4506"
  42. y="-56.407742"
  43. x="-41.95536"
  44. 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"
  45. xml:space="preserve"><tspan
  46. style="font-size:3.17499995px;stroke-width:0.26458332"
  47. y="-56.407742"
  48. x="-41.95536"
  49. id="tspan4504"><tspan
  50. id="tspan4776"
  51. style="fill:#669900">#include</tspan> &lt;<tspan
  52. id="tspan4780"
  53. style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:'monospace Italic'">ESP8266WiFi.h</tspan>&gt;</tspan><tspan
  54. id="tspan4508"
  55. style="font-size:3.17499995px;stroke-width:0.26458332"
  56. y="-51.557049"
  57. x="-41.95536"><tspan
  58. id="tspan4778"
  59. style="fill:#669900">#include</tspan> &lt;<tspan
  60. id="tspan4782"
  61. style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:'monospace Italic'">ESP8266WebServer.h</tspan>&gt;</tspan><tspan
  62. id="tspan4510"
  63. style="font-size:3.17499995px;stroke-width:0.26458332"
  64. y="-46.706352"
  65. x="-41.95536"><tspan
  66. id="tspan4786"
  67. style="fill:#669900">#include</tspan> &lt;<tspan
  68. id="tspan4784"
  69. style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:'monospace Italic'">AutoConnect.h</tspan>&gt;</tspan><tspan
  70. id="tspan4512"
  71. style="font-size:3.17499995px;stroke-width:0.26458332"
  72. y="-41.855659"
  73. x="-41.95536" /><tspan
  74. id="tspan4514"
  75. style="font-size:3.17499995px;stroke-width:0.26458332"
  76. y="-37.004963"
  77. x="-41.95536"><tspan
  78. id="tspan4788"
  79. style="fill:#ff6600">ESP8266WebServer</tspan> server;</tspan><tspan
  80. id="tspan4516"
  81. style="font-size:3.17499995px;stroke-width:0.26458332"
  82. y="-32.15427"
  83. x="-41.95536"><tspan
  84. id="tspan4790"
  85. style="fill:#ff6600">AutoConnect</tspan> portal(server);</tspan><tspan
  86. id="tspan4518"
  87. style="font-size:3.17499995px;stroke-width:0.26458332"
  88. y="-27.303574"
  89. x="-41.95536" /><tspan
  90. id="tspan4520"
  91. style="font-size:3.17499995px;stroke-width:0.26458332"
  92. y="-22.452879"
  93. x="-41.95536"><tspan
  94. id="tspan4792"
  95. style="fill:#3366cc">void</tspan> handleRoot() {</tspan><tspan
  96. id="tspan4522"
  97. style="font-size:3.17499995px;stroke-width:0.26458332"
  98. y="-17.602184"
  99. x="-41.95536"> <tspan
  100. id="tspan4794"
  101. style="fill:#3366cc">String</tspan> page = PSTR(</tspan><tspan
  102. id="tspan4524"
  103. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  104. y="-12.751491"
  105. x="-41.95536">&quot;&lt;html&gt;&quot;</tspan><tspan
  106. id="tspan4526"
  107. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  108. y="-7.9007959"
  109. x="-41.95536">&quot;&lt;head&gt;&quot;</tspan><tspan
  110. id="tspan4528"
  111. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  112. y="-3.0501018"
  113. x="-41.95536"> &quot;&lt;meta name=\&quot;viewport\&quot; content=\&quot;width=device-width, initial-scale=1\&quot;&gt;&quot;</tspan><tspan
  114. id="tspan4530"
  115. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  116. y="1.8005929"
  117. x="-41.95536"> &quot;&lt;style type=\&quot;text/css\&quot;&gt;&quot;</tspan><tspan
  118. id="tspan4532"
  119. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  120. y="6.6512876"
  121. x="-41.95536"> &quot;body {&quot;</tspan><tspan
  122. id="tspan4534"
  123. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  124. y="11.501982"
  125. x="-41.95536"> &quot;-webkit-appearance:none;&quot;</tspan><tspan
  126. id="tspan4536"
  127. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  128. y="16.352676"
  129. x="-41.95536"> &quot;-moz-appearance:none;&quot;</tspan><tspan
  130. id="tspan4538"
  131. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  132. y="21.203371"
  133. x="-41.95536"> &quot;font-family:'Arial',sans-serif;&quot;</tspan><tspan
  134. id="tspan4540"
  135. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  136. y="26.054066"
  137. x="-41.95536"> &quot;text-align:center;&quot;</tspan><tspan
  138. id="tspan4542"
  139. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  140. y="30.90476"
  141. x="-41.95536"> &quot;}&quot;</tspan><tspan
  142. id="tspan4544"
  143. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  144. y="35.755455"
  145. x="-41.95536"> &quot;.menu {&quot;</tspan><tspan
  146. id="tspan4546"
  147. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  148. y="40.606148"
  149. x="-41.95536"> &quot;text-align:right;&quot;</tspan><tspan
  150. id="tspan4548"
  151. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  152. y="45.456844"
  153. x="-41.95536"> &quot;}&quot;</tspan><tspan
  154. id="tspan4550"
  155. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  156. y="50.307537"
  157. x="-41.95536"> &quot;.button {&quot;</tspan><tspan
  158. id="tspan4552"
  159. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  160. y="55.158234"
  161. x="-41.95536"> &quot;display:inline-block;&quot;</tspan><tspan
  162. id="tspan4554"
  163. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  164. y="60.008926"
  165. x="-41.95536"> &quot;border-radius:7px;&quot;</tspan><tspan
  166. id="tspan4556"
  167. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  168. y="64.859619"
  169. x="-41.95536"> &quot;background:#73ad21;&quot;</tspan><tspan
  170. id="tspan4558"
  171. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  172. y="69.71032"
  173. x="-41.95536"> &quot;margin:0 10px 0 10px;&quot;</tspan><tspan
  174. id="tspan4560"
  175. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  176. y="74.561012"
  177. x="-41.95536"> &quot;padding:10px 20px 10px 20px;&quot;</tspan><tspan
  178. id="tspan4562"
  179. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  180. y="79.411705"
  181. x="-41.95536"> &quot;text-decoration:none;&quot;</tspan><tspan
  182. id="tspan4564"
  183. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  184. y="84.262398"
  185. x="-41.95536"> &quot;color:#000000;&quot;</tspan><tspan
  186. id="tspan4566"
  187. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  188. y="89.113098"
  189. x="-41.95536"> &quot;}&quot;</tspan><tspan
  190. id="tspan4568"
  191. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  192. y="93.963791"
  193. x="-41.95536"> &quot;&lt;/style&gt;&quot;</tspan><tspan
  194. id="tspan4570"
  195. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  196. y="98.814484"
  197. x="-41.95536">&quot;&lt;/head&gt;&quot;</tspan><tspan
  198. id="tspan4572"
  199. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  200. y="103.66518"
  201. x="-41.95536">&quot;&lt;body&gt;&quot;</tspan><tspan
  202. id="tspan4574"
  203. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  204. y="108.51587"
  205. x="-41.95536"> &quot;&lt;p class=\&quot;menu\&quot;&gt;&quot; <tspan
  206. id="tspan4798"
  207. style="fill:#000000">AUTOCONNECT_LINK(BAR_32)</tspan> &quot;&lt;/p&gt;&quot;</tspan><tspan
  208. id="tspan4576"
  209. style="font-size:3.17499995px;fill:#003399;stroke-width:0.26458332"
  210. y="113.36657"
  211. x="-41.95536"> &quot;BUILT-IN LED&lt;br&gt;&quot;</tspan><tspan
  212. id="tspan4578"
  213. style="font-size:3.17499995px;stroke-width:0.26458332"
  214. y="118.21726"
  215. x="-41.95536"><tspan
  216. id="tspan4796"
  217. style="fill:#003399"> &quot;GPIO(&quot;</tspan>);</tspan><tspan
  218. id="tspan4580"
  219. style="font-size:3.17499995px;stroke-width:0.26458332"
  220. y="123.06796"
  221. x="-41.95536"> page += <tspan
  222. id="tspan4800"
  223. style="fill:#3366cc">String</tspan>(BUILTIN_LED);</tspan><tspan
  224. id="tspan4582"
  225. style="font-size:3.17499995px;stroke-width:0.26458332"
  226. y="127.91865"
  227. x="-41.95536"> page += <tspan
  228. id="tspan4802"
  229. style="fill:#3366cc">String</tspan>(F(<tspan
  230. id="tspan4804"
  231. style="fill:#003399">&quot;) : &lt;span style=\&quot;font-weight:bold;color:&quot;</tspan>));</tspan><tspan
  232. id="tspan4584"
  233. style="font-size:3.17499995px;stroke-width:0.26458332"
  234. y="132.76935"
  235. x="-41.95536"> page += <tspan
  236. id="tspan4806"
  237. style="fill:#ff6600">digitalRead</tspan>(BUILTIN_LED) ? <tspan
  238. id="tspan4808"
  239. style="fill:#3366cc">String</tspan>(<tspan
  240. id="tspan4812"
  241. style="fill:#003399">&quot;Tomato\&quot;&gt;HIGH&quot;</tspan>) : <tspan
  242. id="tspan4814"
  243. style="fill:#3366cc">String</tspan>(<tspan
  244. id="tspan4816"
  245. style="fill:#003399">&quot;SlateBlue\&quot;&gt;LOW&quot;</tspan>);</tspan><tspan
  246. id="tspan4586"
  247. style="font-size:3.17499995px;stroke-width:0.26458332"
  248. y="137.62004"
  249. x="-41.95536"> page += <tspan
  250. id="tspan4818"
  251. style="fill:#ff6600">String</tspan>(F(<tspan
  252. id="tspan4820"
  253. style="fill:#003399">&quot;&lt;/span&gt;&quot;</tspan>));</tspan><tspan
  254. id="tspan4588"
  255. style="font-size:3.17499995px;stroke-width:0.26458332"
  256. y="142.47073"
  257. x="-41.95536"> page += <tspan
  258. id="tspan4822"
  259. style="fill:#ff6600">String</tspan>(F(<tspan
  260. id="tspan4826"
  261. style="fill:#003399">&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. id="tspan4968"
  263. style="font-size:3.17499995px;stroke-width:0.26458332"
  264. y="147.32143"
  265. x="-41.95536"><tspan
  266. id="tspan4970"
  267. style="fill:#003399"> &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. id="tspan4590"
  269. style="font-size:3.17499995px;stroke-width:0.26458332"
  270. y="152.17212"
  271. x="-41.95536"> page += <tspan
  272. id="tspan4824"
  273. style="fill:#ff6600">String</tspan>(F(<tspan
  274. id="tspan4828"
  275. style="fill:#003399">&quot;&lt;/body&gt;&lt;/html&gt;&quot;</tspan>));</tspan><tspan
  276. id="tspan4592"
  277. style="font-size:3.17499995px;stroke-width:0.26458332"
  278. y="157.02281"
  279. x="-41.95536"> server().<tspan
  280. id="tspan4832"
  281. style="fill:#ff6600">send</tspan>(200, <tspan
  282. id="tspan4834"
  283. style="fill:#003399">&quot;text/html&quot;</tspan>, page);</tspan><tspan
  284. id="tspan4594"
  285. style="font-size:3.17499995px;stroke-width:0.26458332"
  286. y="161.87352"
  287. x="-41.95536">}</tspan><tspan
  288. id="tspan4596"
  289. style="font-size:3.17499995px;stroke-width:0.26458332"
  290. y="166.72421"
  291. x="-41.95536" /><tspan
  292. id="tspan4598"
  293. style="font-size:3.17499995px;stroke-width:0.26458332"
  294. y="171.57491"
  295. x="-41.95536"><tspan
  296. id="tspan4836"
  297. style="fill:#3366cc">void</tspan> handleGPIO() {</tspan><tspan
  298. id="tspan4600"
  299. style="font-size:3.17499995px;stroke-width:0.26458332"
  300. y="176.4256"
  301. x="-41.95536"> <tspan
  302. id="tspan4838"
  303. style="fill:#808080">if</tspan> (server.<tspan
  304. id="tspan4842"
  305. style="fill:#ff6600">arg</tspan>(<tspan
  306. id="tspan4844"
  307. style="fill:#003399">&quot;v&quot;</tspan>) == <tspan
  308. id="tspan4846"
  309. style="fill:#003399">&quot;low&quot;</tspan>)</tspan><tspan
  310. id="tspan4602"
  311. style="font-size:3.17499995px;stroke-width:0.26458332"
  312. y="181.27629"
  313. x="-41.95536"> <tspan
  314. id="tspan4850"
  315. style="fill:#ff6600">digitalWrite</tspan>(BUILTIN_LED, <tspan
  316. id="tspan4852"
  317. style="fill:#ff6600">LOW</tspan>);</tspan><tspan
  318. id="tspan4604"
  319. style="font-size:3.17499995px;stroke-width:0.26458332"
  320. y="186.12698"
  321. x="-41.95536"> <tspan
  322. id="tspan4860"
  323. style="fill:#808080">else</tspan> <tspan
  324. id="tspan4862"
  325. style="fill:#808080">if</tspan> (server.<tspan
  326. id="tspan4858"
  327. style="fill:#ff6600">arg</tspan>(<tspan
  328. id="tspan4856"
  329. style="fill:#003399">&quot;v&quot;</tspan>) == <tspan
  330. id="tspan4854"
  331. style="fill:#003399">&quot;high&quot;</tspan>)</tspan><tspan
  332. id="tspan4606"
  333. style="font-size:3.17499995px;stroke-width:0.26458332"
  334. y="190.97768"
  335. x="-41.95536"> <tspan
  336. id="tspan4864"
  337. style="fill:#ff6600">digitalWrite</tspan>(BUILTIN_LED, <tspan
  338. id="tspan4866"
  339. style="fill:#ff6600">HIGH</tspan>);</tspan><tspan
  340. id="tspan4608"
  341. style="font-size:3.17499995px;stroke-width:0.26458332"
  342. y="195.82837"
  343. x="-41.95536"> sendRedirect(&quot;/&quot;);</tspan><tspan
  344. id="tspan4610"
  345. style="font-size:3.17499995px;stroke-width:0.26458332"
  346. y="200.67906"
  347. x="-41.95536">}</tspan><tspan
  348. id="tspan4612"
  349. style="font-size:3.17499995px;stroke-width:0.26458332"
  350. y="205.52977"
  351. x="-41.95536" /><tspan
  352. id="tspan4614"
  353. style="font-size:3.17499995px;stroke-width:0.26458332"
  354. y="210.38046"
  355. x="-41.95536"><tspan
  356. id="tspan4868"
  357. style="fill:#3366cc">void</tspan> sendRedirect(<tspan
  358. id="tspan4870"
  359. style="fill:#3366cc">String</tspan> uri) {</tspan><tspan
  360. id="tspan4616"
  361. style="font-size:3.17499995px;stroke-width:0.26458332"
  362. y="215.23116"
  363. x="-41.95536"> server.<tspan
  364. id="tspan4872"
  365. style="fill:#ff6600">sendHeader</tspan>(<tspan
  366. id="tspan4874"
  367. style="fill:#003399">&quot;Location&quot;</tspan>, uri, <tspan
  368. id="tspan4876"
  369. style="fill:#3366cc">true</tspan>);</tspan><tspan
  370. id="tspan4618"
  371. style="font-size:3.17499995px;stroke-width:0.26458332"
  372. y="220.08185"
  373. x="-41.95536"> server.<tspan
  374. id="tspan4880"
  375. style="fill:#ff6600">send</tspan>(302, &quot;text/plain&quot;, <tspan
  376. id="tspan4878"
  377. style="fill:#003399">&quot;&quot;</tspan>);</tspan><tspan
  378. id="tspan4620"
  379. style="font-size:3.17499995px;stroke-width:0.26458332"
  380. y="224.93254"
  381. x="-41.95536"> server.<tspan
  382. id="tspan4884"
  383. style="fill:#ff6600">client</tspan>().<tspan
  384. id="tspan4886"
  385. style="fill:#ff6600">stop</tspan>();</tspan><tspan
  386. id="tspan4622"
  387. style="font-size:3.17499995px;stroke-width:0.26458332"
  388. y="229.78323"
  389. x="-41.95536">}</tspan><tspan
  390. id="tspan4624"
  391. style="font-size:3.17499995px;stroke-width:0.26458332"
  392. y="234.63393"
  393. x="-41.95536" /><tspan
  394. id="tspan4626"
  395. style="font-size:3.17499995px;stroke-width:0.26458332"
  396. y="239.48462"
  397. x="-41.95536"><tspan
  398. id="tspan4890"
  399. style="fill:#3366cc">void</tspan> setup() {</tspan><tspan
  400. id="tspan4628"
  401. style="font-size:3.17499995px;stroke-width:0.26458332"
  402. y="244.33533"
  403. x="-41.95536"> <tspan
  404. id="tspan4888"
  405. style="fill:#ff6600">delay</tspan>(1000);</tspan><tspan
  406. id="tspan4630"
  407. style="font-size:3.17499995px;stroke-width:0.26458332"
  408. y="249.18602"
  409. x="-41.95536"> <tspan
  410. id="tspan4892"
  411. style="fill:#ff6600">Serial</tspan>.<tspan
  412. id="tspan4894"
  413. style="fill:#ff6600">begin</tspan>(115200);</tspan><tspan
  414. id="tspan4632"
  415. style="font-size:3.17499995px;stroke-width:0.26458332"
  416. y="254.03671"
  417. x="-41.95536"> <tspan
  418. id="tspan4898"
  419. style="fill:#ff6600">Serial</tspan>.<tspan
  420. id="tspan4896"
  421. style="fill:#ff6600">println</tspan>();</tspan><tspan
  422. id="tspan4634"
  423. style="font-size:3.17499995px;stroke-width:0.26458332"
  424. y="258.88739"
  425. x="-41.95536"> <tspan
  426. id="tspan4900"
  427. style="fill:#ff6600">pinMode</tspan>(BUILTIN_LED, <tspan
  428. id="tspan4902"
  429. style="fill:#ff6600">OUTPUT</tspan>);</tspan><tspan
  430. id="tspan4636"
  431. style="font-size:3.17499995px;stroke-width:0.26458332"
  432. y="263.7381"
  433. x="-41.95536" /><tspan
  434. id="tspan4638"
  435. style="font-size:3.17499995px;stroke-width:0.26458332"
  436. y="268.58881"
  437. x="-41.95536"> <tspan
  438. id="tspan4904"
  439. style="fill:#808080">// Put the home location of the web site.</tspan></tspan><tspan
  440. id="tspan4640"
  441. style="font-size:3.17499995px;stroke-width:0.26458332"
  442. y="273.43948"
  443. x="-41.95536"> <tspan
  444. id="tspan4906"
  445. style="fill:#808080">// But in usually, setting the home uri is not needed cause default location is &quot;/&quot;.</tspan></tspan><tspan
  446. id="tspan4642"
  447. style="font-size:3.17499995px;stroke-width:0.26458332"
  448. y="278.29019"
  449. x="-41.95536"> <tspan
  450. id="tspan4908"
  451. style="fill:#808080">//portal.home(&quot;/&quot;);</tspan></tspan><tspan
  452. id="tspan4644"
  453. style="font-size:3.17499995px;stroke-width:0.26458332"
  454. y="283.14087"
  455. x="-41.95536" /><tspan
  456. id="tspan4646"
  457. style="font-size:3.17499995px;stroke-width:0.26458332"
  458. y="287.99158"
  459. x="-41.95536"> server.<tspan
  460. id="tspan4910"
  461. style="fill:#ff6600">on</tspan>(<tspan
  462. id="tspan4912"
  463. style="fill:#003399">&quot;/&quot;</tspan>, handleRoot);</tspan><tspan
  464. id="tspan4648"
  465. style="font-size:3.17499995px;stroke-width:0.26458332"
  466. y="292.84225"
  467. x="-41.95536"> server.<tspan
  468. id="tspan4916"
  469. style="fill:#ff6600">on</tspan>(<tspan
  470. id="tspan4914"
  471. style="fill:#003399">&quot;/io&quot;</tspan>, handleGPIO);</tspan><tspan
  472. id="tspan4650"
  473. style="font-size:3.17499995px;stroke-width:0.26458332"
  474. y="297.69296"
  475. x="-41.95536" /><tspan
  476. id="tspan4652"
  477. style="font-size:3.17499995px;stroke-width:0.26458332"
  478. y="302.54364"
  479. x="-41.95536"> // Starts user web site included the AutoConnect portal.</tspan><tspan
  480. id="tspan4654"
  481. style="font-size:3.17499995px;stroke-width:0.26458332"
  482. y="307.39435"
  483. x="-41.95536"> <tspan
  484. id="tspan4934"
  485. style="fill:#808080">if</tspan> (portal.<tspan
  486. id="tspan4918"
  487. style="fill:#ff6600">begin</tspan>()) {</tspan><tspan
  488. id="tspan4656"
  489. style="font-size:3.17499995px;stroke-width:0.26458332"
  490. y="312.24506"
  491. x="-41.95536"> <tspan
  492. id="tspan4920"
  493. style="fill:#ff6600">Serial</tspan>.<tspan
  494. id="tspan4922"
  495. style="fill:#ff6600">println</tspan>(<tspan
  496. id="tspan4924"
  497. style="fill:#003399">&quot;Started, IP:&quot;</tspan> + <tspan
  498. id="tspan4926"
  499. style="fill:#ff6600">WiFi</tspan>.<tspan
  500. id="tspan4928"
  501. style="fill:#ff6600">localIP</tspan>().<tspan
  502. id="tspan4930"
  503. style="fill:#ff6600">toString</tspan>());</tspan><tspan
  504. id="tspan4658"
  505. style="font-size:3.17499995px;stroke-width:0.26458332"
  506. y="317.09573"
  507. x="-41.95536"> }</tspan><tspan
  508. id="tspan4660"
  509. style="font-size:3.17499995px;stroke-width:0.26458332"
  510. y="321.94644"
  511. x="-41.95536"> <tspan
  512. id="tspan4936"
  513. style="fill:#808080">else</tspan> {</tspan><tspan
  514. id="tspan4662"
  515. style="font-size:3.17499995px;stroke-width:0.26458332"
  516. y="326.79712"
  517. x="-41.95536"> <tspan
  518. id="tspan4938"
  519. style="fill:#ff6600">Serial</tspan>.<tspan
  520. id="tspan4940"
  521. style="fill:#ff6600">println</tspan>(<tspan
  522. id="tspan4942"
  523. style="fill:#003399">&quot;Connection failed.&quot;</tspan>);</tspan><tspan
  524. id="tspan4664"
  525. style="font-size:3.17499995px;stroke-width:0.26458332"
  526. y="331.64783"
  527. x="-41.95536"> <tspan
  528. id="tspan4944"
  529. style="fill:#808080">while</tspan> (<tspan
  530. id="tspan4946"
  531. style="fill:#3366cc">true</tspan>) { <tspan
  532. id="tspan4948"
  533. style="fill:#ff6600">yield</tspan>(); }</tspan><tspan
  534. id="tspan4666"
  535. style="font-size:3.17499995px;stroke-width:0.26458332"
  536. y="336.4985"
  537. x="-41.95536"> }</tspan><tspan
  538. id="tspan4668"
  539. style="font-size:3.17499995px;stroke-width:0.26458332"
  540. y="341.34921"
  541. x="-41.95536">}</tspan><tspan
  542. id="tspan4670"
  543. style="font-size:3.17499995px;stroke-width:0.26458332"
  544. y="346.19989"
  545. x="-41.95536" /><tspan
  546. id="tspan4672"
  547. style="font-size:3.17499995px;stroke-width:0.26458332"
  548. y="351.0506"
  549. x="-41.95536"><tspan
  550. id="tspan4950"
  551. style="fill:#3366cc">void</tspan> loop() {</tspan><tspan
  552. id="tspan4674"
  553. style="font-size:3.17499995px;stroke-width:0.26458332"
  554. y="355.90131"
  555. x="-41.95536"> server.<tspan
  556. id="tspan4952"
  557. style="fill:#ff6600">handleClient</tspan>();</tspan><tspan
  558. id="tspan4676"
  559. style="font-size:3.17499995px;stroke-width:0.26458332"
  560. y="360.75198"
  561. x="-41.95536"> portal.<tspan
  562. id="tspan4954"
  563. style="fill:#ff6600">handleRequest</tspan>(); // Need to handle AutoConnect menu.</tspan><tspan
  564. id="tspan4678"
  565. style="font-size:3.17499995px;stroke-width:0.26458332"
  566. y="365.60269"
  567. x="-41.95536"> <tspan
  568. id="tspan4966"
  569. style="fill:#808080">if</tspan> (<tspan
  570. id="tspan4956"
  571. style="fill:#ff6600">WiFi</tspan>.<tspan
  572. id="tspan4958"
  573. style="fill:#ff6600">status</tspan>() == <tspan
  574. id="tspan4960"
  575. style="fill:#3366cc">WL_IDLE_STATUS</tspan>) {</tspan><tspan
  576. id="tspan4680"
  577. style="font-size:3.17499995px;stroke-width:0.26458332"
  578. y="370.45337"
  579. x="-41.95536"> ESP.<tspan
  580. id="tspan4962"
  581. style="fill:#ff6600">reset</tspan>();</tspan><tspan
  582. id="tspan4682"
  583. style="font-size:3.17499995px;stroke-width:0.26458332"
  584. y="375.30408"
  585. x="-41.95536"> <tspan
  586. id="tspan4964"
  587. style="fill:#ff6600">delay</tspan>(1000);</tspan><tspan
  588. id="tspan4684"
  589. style="font-size:3.17499995px;stroke-width:0.26458332"
  590. y="380.15475"
  591. x="-41.95536"> }</tspan><tspan
  592. id="tspan4686"
  593. style="font-size:3.17499995px;stroke-width:0.26458332"
  594. y="385.00546"
  595. x="-41.95536">}</tspan><tspan
  596. id="tspan4688"
  597. style="font-size:3.17499995px;stroke-width:0.26458332"
  598. y="389.85617"
  599. x="-41.95536" /></text>
  600. </g>
  601. <g
  602. style="display:inline"
  603. id="layer3">
  604. <path
  605. d="m 119.94348,375.62042 -8.69884,-5.02228 8.69884,-5.02227 z"
  606. id="path4984-8-8"
  607. 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" />
  608. <text
  609. id="text4702"
  610. y="28.892231"
  611. x="94.665428"
  612. 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"
  613. xml:space="preserve"><tspan
  614. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  615. y="28.892231"
  616. x="94.665428"
  617. id="tspan4700">1. Declare AutoConnect</tspan><tspan
  618. id="tspan4972"
  619. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  620. y="35.065842"
  621. x="94.665428"> and bind it to ESP8266WebServer</tspan></text>
  622. <text
  623. id="text4702-1"
  624. y="349.37784"
  625. x="115.7594"
  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. xml:space="preserve"><tspan
  628. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  629. y="349.37784"
  630. x="115.7594"
  631. id="tspan4700-2">2. Register request handlers</tspan><tspan
  632. id="tspan4974"
  633. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  634. y="355.55145"
  635. x="115.7594"> to ESP8266WebServer</tspan></text>
  636. <text
  637. id="text4702-1-3"
  638. y="368.79718"
  639. x="122.43944"
  640. 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"
  641. xml:space="preserve"><tspan
  642. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  643. y="368.79718"
  644. x="122.43944"
  645. id="tspan4700-2-3">3. Start AutoConnect,</tspan><tspan
  646. id="tspan4976"
  647. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  648. y="374.97079"
  649. x="122.43944"> no need server.begin()</tspan></text>
  650. <text
  651. id="text4702-1-3-9"
  652. y="417.13007"
  653. x="121.19266"
  654. 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"
  655. xml:space="preserve"><tspan
  656. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  657. y="417.13007"
  658. x="121.19266"
  659. id="tspan4700-2-3-5">4. Perform handleClient</tspan><tspan
  660. id="tspan4978"
  661. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  662. y="423.30368"
  663. x="121.19266"> for ESP8266WebServer</tspan></text>
  664. <text
  665. id="text4702-1-3-9-5"
  666. y="429.72409"
  667. x="121.46516"
  668. 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"
  669. xml:space="preserve"><tspan
  670. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  671. y="429.72409"
  672. x="121.46516"
  673. id="tspan4700-2-3-5-1">5. Perform handleRequest</tspan><tspan
  674. id="tspan4980"
  675. style="fill:#558c3d;fill-opacity:1;stroke-width:0.26458332"
  676. y="435.89771"
  677. x="121.46516"> for AutoConnect</tspan></text>
  678. <path
  679. d="m 92.895309,35.166107 -8.698836,-5.022276 8.698836,-5.022275 z"
  680. id="path4984"
  681. 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" />
  682. <path
  683. d="m 113.91916,355.65173 -8.69884,-5.02227 8.69884,-5.02228 z"
  684. id="path4984-8"
  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.26596627, 2.26596627;stroke-dashoffset:0;stroke-opacity:0.74117647;paint-order:stroke markers fill" />
  686. <path
  687. d="m 119.14169,423.39187 -8.69884,-5.02227 8.69884,-5.02228 z"
  688. id="path4984-8-8-1"
  689. 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" />
  690. <path
  691. d="m 119.14169,435.9823 -8.69884,-5.02228 8.69884,-5.02227 z"
  692. id="path4984-8-8-6"
  693. 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" />
  694. </g>
  695. </svg>