From 9fc6f5f94f1f831b53934eb33137a9c1d305bcb9 Mon Sep 17 00:00:00 2001 From: Pierrick C Date: Sun, 5 Apr 2020 18:15:20 +0200 Subject: [PATCH] Reorganisation Add pyportal-controller "sub-project" --- .gitignore | 1 + .../lib/adafruit_esp32spi/PWMOut.mpy | Bin 0 -> 2055 bytes .../adafruit_esp32spi/adafruit_esp32spi.mpy | Bin 0 -> 20225 bytes .../adafruit_esp32spi_socket.mpy | Bin 0 -> 4317 bytes .../adafruit_esp32spi_wifimanager.mpy | Bin 0 -> 6152 bytes .../adafruit_esp32spi_wsgiserver.mpy | Bin 0 -> 4271 bytes .../lib/adafruit_esp32spi/digitalio.mpy | Bin 0 -> 4259 bytes pyportal-controller/lib/adafruit_requests.mpy | Bin 0 -> 4535 bytes pyportal-controller/main.py | 46 ++++++++++++++++++ {code => station-esp8266}/config_template.py | 0 .../lib-src/adafruit_max31865.py | 0 .../lib-src/bme280_i2c.py | 0 .../lib-src/umqtt/robust.py | 0 .../lib-src/umqtt/simple.py | 0 .../lib/adafruit_max31865.mpy | Bin {code => station-esp8266}/lib/bme280_i2c.mpy | Bin .../lib/umqtt/robust.mpy | Bin .../lib/umqtt/simple.mpy | Bin {code => station-esp8266}/main.py | 0 19 files changed, 47 insertions(+) create mode 100644 pyportal-controller/lib/adafruit_esp32spi/PWMOut.mpy create mode 100644 pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi.mpy create mode 100644 pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi_socket.mpy create mode 100644 pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi_wifimanager.mpy create mode 100644 pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi_wsgiserver.mpy create mode 100644 pyportal-controller/lib/adafruit_esp32spi/digitalio.mpy create mode 100644 pyportal-controller/lib/adafruit_requests.mpy create mode 100644 pyportal-controller/main.py rename {code => station-esp8266}/config_template.py (100%) rename {code => station-esp8266}/lib-src/adafruit_max31865.py (100%) rename {code => station-esp8266}/lib-src/bme280_i2c.py (100%) rename {code => station-esp8266}/lib-src/umqtt/robust.py (100%) rename {code => station-esp8266}/lib-src/umqtt/simple.py (100%) rename {code => station-esp8266}/lib/adafruit_max31865.mpy (100%) rename {code => station-esp8266}/lib/bme280_i2c.mpy (100%) rename {code => station-esp8266}/lib/umqtt/robust.mpy (100%) rename {code => station-esp8266}/lib/umqtt/simple.mpy (100%) rename {code => station-esp8266}/main.py (100%) diff --git a/.gitignore b/.gitignore index f4ec25f..decdf8a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ config.py *~ +.ropeproject* diff --git a/pyportal-controller/lib/adafruit_esp32spi/PWMOut.mpy b/pyportal-controller/lib/adafruit_esp32spi/PWMOut.mpy new file mode 100644 index 0000000000000000000000000000000000000000..af7d4d4da923f0a56f19dfd0e79542375b66c65b GIT binary patch literal 2055 zcmbVNO>Y}T7@qOkj@L=kxWsmdzXo;fC`x6Vq;3TQ6ogvpLmQ(+<={%=wRhZZSns;K z>!wB=Hb5_k@F_sRg-ZMYCxFxw5`Uu-TsUz>f-Af;yRjWW7U~{$XJ_aAdYn1{YeJX|K}vx~QWTW=9eD?D zzx&|*!w)|E=;Kd5{p|BEzWnOzZyvsu)UcAmOFL-s9XGX%cfC{w?=GaWcvnTr5^7>) z9yLSC0%}T15jVq131@yq%?Oxfa3+Iuf1qa6e}U~8SS{nsve=G^mqa7TdRl!kN=>!P zD2-F3Ml__PW%WO(vi{0m2QH}9$b5wVzzhqjhXInjHyOVAwB19n*a5Awo zG8ktxUIoX;8%Vw;qnIS2vrAkUmDOu&#bOayJ09jz_~*+p?|4|s;p(iH-9qW;@t+#L zg^z}%JpO)ID&X&iC4zq#mY(4XI;m_L!v8=mMtl2R+SASXmtEJ^TYZ;Zv2Du^bMej6 zF_IC1piBW!vBD_qFry>Ev6;ZdxTpy<{(}LhSl3Nb)QIj7({hPQ?x}{Z5y2;UwO-pM zaG-oHgb+qZp69qc4~PsKW6GwLi2T%^j=}=$7r6b4+&*8#9kd~U^7)?TCD20PEXMA) zsXOQ~nJ*yUK070}Y_-i=YWocZ+8eT+D?%e4Y!N}B#~Fef!3oYGbbv3aX<`43`G}$* zm6ae;iATChR?qX&a^U`#%d(fXQ5tiJBpRnwJT2rXK>Q}JOYk4i>oojB!*?)W;PrmeTQjf@`}w=mjTBn+b4lDOE@d%{X%9l zypZj!6+uynQ#8yKaAQJ5)3QHR<|KLnTn5Mhl#~!rZZ^rv`fBmw>Nr;RM|6~ZgtFhF zdPoah0tkC39THuZmVWyw9X_gDeEeM0OGh48L*C{FKLH@athX#Mk{q4$fN5 z^m}XE$QOun$LbpzrwGCk%O)aXxs$k5t!`G!mC?1{kt*d%M_Mmeob~CRTFl+&x`6XS z4PbIY?=q)XBd6#kxG|m<|C?QZ1_ivXL2m=EXN3Db;FS-}VP5D5<|Dz`PQYX0$zwfr p!*Xlgp252OSD{U|MwtImoC|@Zub%vT#6;7_CV;U&*mml*zX4ukd%gew literal 0 HcmV?d00001 diff --git a/pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi.mpy b/pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi.mpy new file mode 100644 index 0000000000000000000000000000000000000000..e14009b9a44a215708f1a17cd37527241e5f3b91 GIT binary patch literal 20225 zcmdU1d2k$8neR8cPfPN6ETI<2l1L-TcG%+ZnPj=cVY~_Vy4V7i-5i91qR9Tf*T-~^ z4hAQ#t<535tKae6@B6-|y;+Xi6Axtx^v{-7!O0S<;+1uEO-+5ZlRG5ypRU^4R2e0| zCjOLdncxRyz4 zS&M5Old4#yAXT%tbdV*aes)3{U?-)!*(vEBHYwf9J|Nx49+vKBr=@qXGtwZNk{)2r z#Dw%W{O7yzos93i_|Av#hVb1mzVqWd1>Xhm-64E;7~_H%_aMd{!MG77dYNmK`5n?I zD<90?F&g%djVO24`ux5?bSxN?6*aQ8MU4cvENE$rjOVJc=-6;f|CJpJjw<{|&Tu%S z#)?LR!_jbLJa#x7(pt2i1zo|Y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|$Q$4Un97dm$L40QC$ z2fI7EQqKW+)M0z7jz>83wv8l<;tM5K!3N6`n6rdnKN!#3Hqf%AuBOM`v^elD0r-d+ zn7~i@2;&1OZn~^r4ZgyVAOLR&-PEojVV)3>jS3-vTXj{(CU} z;q(6)YSJ$iK?|;I=C=iLIldSkyZ;sFYvAbX*w@j!f47D`{$`3NlH(G< zq$uLUr~4c~(&I~gzBWnDk?-EiXcqhV#@j#$+%6UzfeB6N4QLn$CUIabMcnu2%#v__sBR@yx0?~$X;|;$a>Z%wX3Bpk! zTTY^`qni-^bOhl<>lUrucafyGG^8lNH$o}TcXjXDf3REhS*}O)dc(XnDgH*)g}<86 z&~R7x?w);OXZOK@o?Shi9RuC!rpCVRz1oDDvCFTxOAOwS8jLvH2>u9(7KCfw+SH`I zi)^%}mtotB9LFR$ClTD=-+F@kkhBQFbu344<0*o({85VkR|FSPkLUzfWI2M0T*Nd= ybE~30K*S&3XjD0|Sw6WLVk@=K&%yoUc^3 literal 0 HcmV?d00001 diff --git a/pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi_socket.mpy b/pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi_socket.mpy new file mode 100644 index 0000000000000000000000000000000000000000..a7e5c0c8fa61a45f1bf890b5be08c9efd98e3aa2 GIT binary patch literal 4317 zcmbtX&u<&Y6`om=B1KBJnA#*AQPkR5QKI$3u55~p6Vy^^8KG@Sv_v~jSzx*1&PwZ& zOP0HIs{)0W0%|}&@(=VDToQU885>DWTFp77DC_dJ>D~#b|zvqP* zHsOx5Vrc9SCd@Lz3m1swtHL zYhCsQxgs1w7@@!k45>NI^N@`upc~A;=&?V@dV)vDqtZqEWEi0VO+_;Ou0_)Wq~8c#F0MQV+Jhn2v|DOme^=>q@W@ZK<4B!%CO?9J|Z z2@iLn+lzq5D36431gsSVwA(O)!K^1DAt8c-SxiZN78f|-IV!k>*KxruT)-wB_Xuh0 zWA|;A2Pt~BbL@(5dMv8`8Cz|Z}Wlc4RuS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it_esp32spi_wifimanager.mpy b/pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi_wifimanager.mpy new file mode 100644 index 0000000000000000000000000000000000000000..57f8722ed8136723cacb7993fc7f0e3aa26c0baf GIT binary patch literal 6152 zcmcIo-BTOa72l%|KmucMh#;|~tYMK176QvrXt5KlV%c#DwhF|gqt5KE*(7URSKUCm;JUe~vTVFcuOgo+FAJ9JZH9hy<6_P;yqDG9wz2|=B84PcP})s-bQXD{bxs?Fu1gz|pq}FM7Y5Rl|1rxAje{YVJ7Ysu5%o z{yThR*5gU0kIa)kB9ZOt=4ZqidsagaZ*OhDBA?fY?bvD_rp| zA_4000JGOr6h`0|Q;H~QKcCs{+kJC)bT@{7Z|t7IFaG^(Xg9oj3JrNy6r^{kAtXtt zOEGvL#bNkCeW(x^Qw3>EP(Ydk#V1_^#V=h3B_QQM2})N$>5(1_O0TpGN}sd>N=Ui| zN?5uLBlWKeFsAlP1yBa0bx=-87eE=5K0z~g+4M0C-Y3h3x=my`EXy1=vfO3n0a^aM zrdD{@o?Ew9S8~hY{H^u;YGL)}S{`T74aAuow1`cdUId3hHl0E5zid>kZM72Gw20~u zSvAiz8;Ic$%d~Wx__v4?FsruXH)~GNRGrOok47rQApui2w!*q8tD1(>+XJTlC8@}^ zqdGPFw5@L$Dy><>*mBCk>H2!VAoL1>*ckP*1vfl7IhCHAoS7`AmZwt7$<)*ZwAEfC zA;Rw)iAmUxB;Z^lk%0a9V?ov4l}gF3}k!V2ne*q#;0jB9h0WbX(k-) z^<=YDHcOqldBVrAu^-((sFAz1t$=Oo8vCKg-Dj${eXnY1t%B+}WZQJ?A=$H#UNvNA z$0P^t6Gr=bPU!hsh+6`!(qS340@_!mYxW%}uw5L8Y3C5_qiguvtt7OB2Q$}fVzDVY z3bc8E&ec?}qXI&}CY2IBlU|!3A{~2xDtt)S41hl3l- z^37|@d3kL;xBl@OKj79e50!Ll`<`kM`3qv%=nA|kw31sADH$!$$@{U^q$XNFWpAp6 zY!C-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odnpM&xxr;BL!Q*?>LoiIt9w~AqpE; zdf1g^aGff4SwX#CMlJ7oh^hB6(0{RYeB~*&Jz|}hZXN1SMMEa0&CZUjo3z%p1<%ix zf`WkLJ&4yHc$8O^ z+Og;{RBJsU^_Eo|Utp}31mBn|)#ua$CB0JdbP3`$v__h*GM`Y5R?%o($(!c;3mBA& Who2CSv4489U4sup8olj%8~h*k`lC(& literal 0 HcmV?d00001 diff --git a/pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi_wsgiserver.mpy b/pyportal-controller/lib/adafruit_esp32spi/adafruit_esp32spi_wsgiserver.mpy new file mode 100644 index 0000000000000000000000000000000000000000..8097b3bbedea094097e35a82a61da1b1fc33b731 GIT binary patch literal 4271 zcmb7HOKcm*8J;0UJt*oyM_S4eMXzL%E6IAlXsAtMRc0hLwn&ML9YKfXnw%9Ep_ZGS zr2{1hOc_uMA9C-#K!KtcYHi0!33Ix3rXmV^W=|8)q#3gMY5~wBr z$ISfmKfeFpn{L-7-Hq5^-y-V6hg|vP(b1VJ$=p$!jL?r|f4(1w`!RfTILzTP_W&hv z{%=TmfWi;Z9PoGW&;Sl!1koS{(aTsF#Nk0a=Z^$&28D-k-{HORCCq0q$K#wU%wzv< z`_K1_xl)0=IxFQQSuZJuNT@bHM>S=-i6g#C_Y_L>yF{PT4qQr+efF~O@nnlCH9Gf| ztX|X(jC@hGIrekBX{V_sj!28yw}~nOIgxIiBU&wCd5=?^$l_5*2=~W@9osuM#{Qr-B0AY+=38B$Opc}hs!)4 zhR9UFy}^q(G=wWMID6N*@A>`OU}o*&4r>weDC`cm?TiWVV9$rwGyI3%quwLm(ZJEj zQ5Tpt$fNKj1knzMQC~UP>rc7|BorP%865rrWnAGIoNCd zmp=am+C@>7_K7HZMbXYK_<80~pD4alk_xs8=qf5Co#>&4q#Ku; z7j;NT$S%^GEht1aMCq=i6r?)^(j!`HP8EFO9z>L=cNM*;qPDl%5o$s1o&i=(8CY=Ax`Fsx4YkH>%OCezmbAS4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=dyxV2ppE3b;cAGum0p;i@WNgFv*5 z>7F7>B4;lQk>Uv?O$h2EGN+ zd+};p2$J+H3xMj8L$9txlbL46pY$Tb0SbAVheAjjw8 z*g$VBco>fD#aTSdLayquY^C<(V!5Pf3=l_!hNq)Yl4RAA#}dPZ>^8)Ck5Dn*9~MrA zdIW09^<<46$f6dTjOXA)%TAweB%S)kJMjdk^RtP6Ec3Iwg1)Lajb}<42vZ=7G_}Y~ zqMfEOVfSQmmEwY^=HDgtGNF+xR*HH0RGZHmgHW-gh15!!Dn{hn%OMWAkmE;iOG%wQDGt4BV6b{+BHzL^ZI+fQT$hkf+junEU{0&=NmU(-~0Zv zM6C|HTU_`4L!tJa!1upNHtYB4ktgs9FycOc22u5~jGxg;Hi_?ltizz~B+lCP@E3G0 zf*b1(JB|PRFn9)-q`2Q_xp<<1 z&7L)8A1sIIVrst?lx1ca?L3Rz^K`ne1ClBhrceW=QvY0v!^`%COs40t?S0&=QIpzB?$OhTB zX=T#iG;rkW?}1O=?D-nv`EdMb9Siwp>W2xWk0ti%pew6obI3rqX$xw#zj+Ia_13J_ z^i_>|hgvS=H5>z?aslcX4%s^61D-c&WiyhJNq`)*2OM-7o!|}vJZSP5q*?w&XI2Xh zr6kKrzL+iTn4La5IweleoEslG{bJV4Gu!PC?fs5oH6!80^! zG}C=E(D@C9q%y>ep<0YqY@j&wYKm)pSFc{}qn7LgjSTmZVM~*>?C|2ZP(p{deTR*;v-j-tF`^RRBoKLcy2wBBn3`aycRsCuZCFzu7$BV!0r zN3>Yof!6-Ru*FI?S6M>mav!=OlIc46kf~CIW~T3 Jd}iEW_kR|CYc>D? literal 0 HcmV?d00001 diff --git a/pyportal-controller/main.py b/pyportal-controller/main.py new file mode 100644 index 0000000..38d9e07 --- /dev/null +++ b/pyportal-controller/main.py @@ -0,0 +1,46 @@ +import board +import busio +from digitalio import DigitalInOut +import adafruit_esp32spi.adafruit_esp32spi_socket as socket +from adafruit_esp32spi import adafruit_esp32spi +import adafruit_requests as requests +import config + +# If you are using a board with pre-defined ESP32 Pins: +esp32_cs = DigitalInOut(board.ESP_CS) +esp32_ready = DigitalInOut(board.ESP_BUSY) +esp32_reset = DigitalInOut(board.ESP_RESET) + +spi = busio.SPI(board.SCK, board.MOSI, board.MISO) +esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset) + +requests.set_socket(socket, esp) + +if esp.status == adafruit_esp32spi.WL_IDLE_STATUS: + print("ESP32 found and in idle mode") +print("Firmware vers.", esp.firmware_version) +print("MAC addr:", [hex(i) for i in esp.MAC_address]) + +print("Connecting to AP...") + + +def WifiConnect(ssid, psk): + """Connect to the wifi with given credentials.""" + nets = esp.scan_networks() + for net in nets: + net_ssid = net['ssid'] + if net_ssid == bytearray(ssid): + print('Network found!') + esp.connect_AP(net_ssid, psk) + while not esp.is_connected: + machine.idle() # save power while waiting + print('WLAN connection succeeded!') + break + if not esp.is_connected: + print("WLAN not found/not connected") + + +WifiConnect(config.WIFI_SSID, config.WIFI_PSK) + +print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi) +print("My IP address is", esp.pretty_ip(esp.ip_address)) diff --git a/code/config_template.py b/station-esp8266/config_template.py similarity index 100% rename from code/config_template.py rename to station-esp8266/config_template.py diff --git a/code/lib-src/adafruit_max31865.py b/station-esp8266/lib-src/adafruit_max31865.py similarity index 100% rename from code/lib-src/adafruit_max31865.py rename to station-esp8266/lib-src/adafruit_max31865.py diff --git a/code/lib-src/bme280_i2c.py b/station-esp8266/lib-src/bme280_i2c.py similarity index 100% rename from code/lib-src/bme280_i2c.py rename to station-esp8266/lib-src/bme280_i2c.py diff --git a/code/lib-src/umqtt/robust.py b/station-esp8266/lib-src/umqtt/robust.py similarity index 100% rename from code/lib-src/umqtt/robust.py rename to station-esp8266/lib-src/umqtt/robust.py diff --git a/code/lib-src/umqtt/simple.py b/station-esp8266/lib-src/umqtt/simple.py similarity index 100% rename from code/lib-src/umqtt/simple.py rename to station-esp8266/lib-src/umqtt/simple.py diff --git a/code/lib/adafruit_max31865.mpy b/station-esp8266/lib/adafruit_max31865.mpy similarity index 100% rename from code/lib/adafruit_max31865.mpy rename to station-esp8266/lib/adafruit_max31865.mpy diff --git a/code/lib/bme280_i2c.mpy b/station-esp8266/lib/bme280_i2c.mpy similarity index 100% rename from code/lib/bme280_i2c.mpy rename to station-esp8266/lib/bme280_i2c.mpy diff --git a/code/lib/umqtt/robust.mpy b/station-esp8266/lib/umqtt/robust.mpy similarity index 100% rename from code/lib/umqtt/robust.mpy rename to station-esp8266/lib/umqtt/robust.mpy diff --git a/code/lib/umqtt/simple.mpy b/station-esp8266/lib/umqtt/simple.mpy similarity index 100% rename from code/lib/umqtt/simple.mpy rename to station-esp8266/lib/umqtt/simple.mpy diff --git a/code/main.py b/station-esp8266/main.py similarity index 100% rename from code/main.py rename to station-esp8266/main.py