diff --git a/presentation/meta/config/images/logo.png b/presentation/meta/config/images/logo.png index 1813e18..103de68 100644 Binary files a/presentation/meta/config/images/logo.png and b/presentation/meta/config/images/logo.png differ diff --git a/presentation/meta/config/images/logow.eps b/presentation/meta/config/images/logow.eps deleted file mode 100644 index 6469f22..0000000 Binary files a/presentation/meta/config/images/logow.eps and /dev/null differ diff --git a/presentation/meta/config/images/logow.png b/presentation/meta/config/images/logow.png deleted file mode 100644 index 838b3d5..0000000 Binary files a/presentation/meta/config/images/logow.png and /dev/null differ diff --git a/presentation/presentation.tex b/presentation/presentation.tex index 79d6ed7..86b78d3 100644 --- a/presentation/presentation.tex +++ b/presentation/presentation.tex @@ -137,19 +137,20 @@ Cooler: \href{https://micropython.org/}{MicroPython} \item Frei \& Open Source \item Einige Funktionalität eingeschränkt (z.B. Multithreading) \item Verscheidene Boards/Controller unterstützt: PyBoard, ESP32, \dots - \item Doku: \url{http://docs.micropython.org/en/latest/esp8266/index.html} (\url{http://iot.wiai/doc}) + \item Doku: \url{http://docs.micropython.org/en/latest/esp8266/index.html} \end{itemize} Lowlevel: C, Arduino Studio \end{frame} \section{Setup} \subsection{Tools} -\begin{frame}{Tools}\framesubtitle{Alle Downloads unter \url{http://iot.wiai/}} +\begin{frame}{Tools} Linux \begin{itemize} \item Debian, Gentoo (testing): \texttt{\{apt install,emerge\} esptool picocom} \item \texttt{adduser \$USER dialout} - \item Alternative: Docker (bin/docker): \textit{docker-compose run esp esptool} + \item neuer Login (sudo su \$USER) + %\item Alternative: Docker (bin/docker): \textit{docker-compose run esp esptool} \end{itemize} Windows \begin{itemize} @@ -163,25 +164,24 @@ Windows \end{itemize} Mac \begin{itemize} - \item Homebrew (\url{https://brew.sh}) installieren + \texttt{brew install python3 \&\& pip install esptool} + \item Homebrew (\url{https://brew.sh}) installieren + \item \texttt{brew install python3 \&\& pip install esptool} \end{itemize} -Offline pip: \textit{pip install -f http://iot.wiai/webrepl/}%TODO: --no-index? \end{frame} \subsection{Firmware} -\begin{frame}{Firmware}\framesubtitle{Alle Downloads unter \url{http://iot.wiai/}} +\begin{frame}{Firmware} Windows-Spezial: \begin{itemize} - \item Portbezeichner: Gerätemanager $\rightarrow$ Serielle Geräte (COM+LPT) $\rightarrow$ COM$X$ - \item python -m esptool + \item Portbezeichner: Gerätemanager $\rightarrow$ Serielle Geräte (COM+LPT) $\rightarrow$ COM$X$ (z.B. COM12) \end{itemize} Flashen: \begin{itemize} - \item \url{https://micropython.org/download\#esp8266} %TODO: WIAI-link + \item MicroPython Download: \url{https://micropython.org/download\#esp8266} (esp8266-20171101-v1.9.3) \item[*nix] \texttt{esptool.py --port /dev/ttyUSB0 erase\_flash} \item[win] \texttt{python -m esptool --port COM12 erase\_flash} - \item[*nix] \texttt{esptool.py --port /dev/ttyUSB0 --baud 460800 write\_flash --flash\_size=detect 0 esp8266-20170823-v1.9.2.bin} - \item[win] \texttt{python -m esptool --port COM12 --baud 460800 write\_flash --flash\_size=detect 0 esp8266-20170823-v1.9.2.bin} + \item[*nix] \texttt{esptool.py --port /dev/ttyUSB0 --baud 460800 write\_flash --flash\_size=detect 0 esp8266-20171101-v1.9.3.bin} + \item[win] \texttt{python -m esptool --port COM12 --baud 460800 write\_flash --flash\_size=detect 0 esp8266-20171101-v1.9.3.bin} \item reset \end{itemize} \end{frame} @@ -192,8 +192,9 @@ Flashen: \begin{itemize} \item \texttt{picocom -b 115200 /dev/ttyUSB0} \item $n$ beherzte \textit{}-Drücke - \item Docker: \texttt{docker-compose run esp} (evtl. TTY anpassen) + %\item Docker: \texttt{docker-compose run esp} (evtl. TTY anpassen) \item[exit] Ctrl-a Ctrl-x + \item Alternativ: screen, \dots \end{itemize} Windows: \begin{itemize} @@ -222,7 +223,7 @@ ap_if = network.WLAN(network.AP_IF) ap_if.active(False) sta_if.active(True) -sta_if.connect('SSID', 'SECRET') # TODO: setup +sta_if.connect('wiaiot', 'toiaiw') sta_if.isconnected() sta_if.ifconfig() \end{lstlisting} @@ -234,18 +235,20 @@ import webrepl_setup \end{lstlisting} \begin{itemize} \item \textit{import webrepl\_setup} - \item reset/start webrepl (\textit{import webrepl \& webrepl.start()}) - \item visit \url{http://iot.wiai/webrepl/} or \url{http://micropython.org/webrepl/} - \item enter your ESP's IP (\textit{sta\_if.ifconfig()}) \& connect + \item WebREPL einrichten (\textit{import webrepl \& webrepl.start()}) + \item WebREPL Client \url{http://micropython.org/webrepl/} + \item IP des ESP's für WebSocket verwenden (\textit{sta\_if.ifconfig()}) + \item Datei Up-/Download (z.B. für main.py) \end{itemize} \end{frame} \subsection{Init} \begin{frame}[fragile]{main.py} - Wird beim starten ... gestartet + Wird beim starten \dots gestartet \begin{lstlisting}[caption={main.py},label=mainpy] -def connect_wifi(ssid, passphrase): +from secrets import SSID, PASS +def connect_wifi(ssid=SSID, passphrase=PASS): #TODO ;) pass @@ -351,14 +354,22 @@ d.humidity() \end{frame} \subsection{Interrupts} -\begin{frame}{Here be dragons} +\begin{frame}{Interrupts} + \framesubtitle{Here be dragons} \begin{itemize} \item Z.B. Callbacks von Tastern \item pausieren main \item dürfen keinen Speicher allozieren + \begin{itemize} + \item[\checkmark] \textit{alarm = True \#only with previously allocated variable!} + \item[\checkmark] \textit{counter = counter + 1} + \item[\checkmark] \textit{interrupts[2] += 1} + \item[X] \textit{events.append(Interrupt())} + \item[X] \textit{} + \end{itemize} \item Emergency exception buffer: \textit{micropython.alloc\_emergency\_exception\_buf(100)} \end{itemize} - \cite{mp-interrupt} + Siehe Doku :) \cite{mp-interrupt} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%