diff --git a/presentation/config/metainfo.tex b/presentation/config/metainfo.tex index e835eee..062dec3 100644 --- a/presentation/config/metainfo.tex +++ b/presentation/config/metainfo.tex @@ -2,7 +2,7 @@ %Necessary Information \author[C\&F]{Clemens, Franz} \title{IoT Night} -\subtitle{ESP8266 \& parts} +\subtitle{S stands for security} %The day of the presentation \date{\today} diff --git a/presentation/content/bib.bib b/presentation/content/bib.bib index 57a1081..13f5dea 100644 --- a/presentation/content/bib.bib +++ b/presentation/content/bib.bib @@ -6,4 +6,12 @@ } @misc{micropython-doc, url={https://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/intro.html} -} \ No newline at end of file +} +@misc{node-dht, + url={https://www.mikrocontroller.net/topic/389850}} +@misc{node-led, + url={https://www.pinterest.de/pin/658088564269958262/}} +@misc{node-button, + url={https://alexbloggt.com/esp8266-pushover/}} +@misc{mp-interrupt, + url={{https://docs.micropython.org/en/latest/esp8266/reference/isr_rules.html}}} diff --git a/presentation/images/button-nodemcu.png b/presentation/images/button-nodemcu.png new file mode 100644 index 0000000..b18f97b Binary files /dev/null and b/presentation/images/button-nodemcu.png differ diff --git a/presentation/images/node-led.jpg b/presentation/images/node-led.jpg new file mode 100644 index 0000000..aed6313 Binary files /dev/null and b/presentation/images/node-led.jpg differ diff --git a/presentation/images/nodemcu-dht22.png b/presentation/images/nodemcu-dht22.png new file mode 100644 index 0000000..ba96cfc Binary files /dev/null and b/presentation/images/nodemcu-dht22.png differ diff --git a/presentation/presentation.tex b/presentation/presentation.tex index 4a4b386..b20ab04 100644 --- a/presentation/presentation.tex +++ b/presentation/presentation.tex @@ -187,14 +187,13 @@ Windows: \item 115200 Baud \item $n$ beherzte \textit{}-Drücke \end{itemize} -%TODO: bild mit REPL (inkl ENTERs) \end{frame} \lstset{language=Python,captionpos=b} \begin{frame}{REPL} \framesubtitle{Hello World!} -%TODO: bild +%TODO: bild mit REPL (inkl ENTERs) \end{frame} @@ -220,13 +219,17 @@ import webrepl_setup \end{lstlisting} \begin{itemize} \item \textit{import webrepl\_setup} - \item reset/start webrepl (import webrepl \& webrepl.start()) + \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 \end{itemize} \end{frame} \subsection{Init} +\begin{frame}{main.py} + +\end{frame} + \subsection{Exkurs: Flask-Server} \begin{frame}[fragile]{Gegenseite: Flask} \begin{lstlisting}[caption={C\&C Server},label=cnc] @@ -243,8 +246,8 @@ Starten: \begin{itemize} \item[!] pip install Flask \item python server.py - \item docker-compose up (server.py in src/) - \item FLASK\_APP=server.py flask run + \item[||] docker-compose up (server.py in src/) + \item[||] FLASK\_APP=server.py flask run \end{itemize} \end{frame} \begin{frame}[fragile]{Daten übertragen} @@ -267,19 +270,20 @@ urequests.post(post_url, data=data, headers=json_header) \section{Basteln} \subsection{Blinkende LED} \begin{frame}{LED anschließen} -TODO schema +\image{.4\textwidth}{node-led}{LED \cite{node-led}}{img:led} \end{frame} \begin{frame}[fragile]{LEDs} -\begin{lstlisting}[caption={LED},label=led] +\setbeamercovered{invisible} +\begin{lstlisting}[caption={LED},label=led,escapeinside={(*@}{@*)}] import machine, time, math pin = machine.Pin(0, machine.Pin.OUT) pin.on() pin.off() - +(*@\onslide<2->@*) pwm = machine.PWM(pin) pwm.duty(512) pwm.deinit() - +(*@\onslide<3->@*) def pulse(l, t): for i in range(20): l.duty(int(math.sin(i / 10 * math.pi) * 500 + 500)) @@ -289,24 +293,23 @@ pulse(led, 50) for i in range(10): pulse(led, 20) \end{lstlisting} + \end{frame} \subsection{Schalter und Taster} \begin{frame}[fragile]{Input} -TODO: schema +\image{.35\textwidth}{button-nodemcu}{Taster \cite{node-button}}{img:button} \begin{lstlisting}[caption={Input},label=input] import machine pin = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP) -status = pin.value() - +# status = pin.value() def callback(p): print('changed', p) - pin.irq(trigger=machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING, handler=callback) \end{lstlisting} \end{frame} \subsection{Sensoren} \begin{frame}[fragile]{Sensoren} -TODO: schema +\image{.35\textwidth}{nodemcu-dht22}{DHT22 \cite{node-dht}}{img:dht} \begin{lstlisting}[caption={Sensoren},label=senors] import dht import machine @@ -317,6 +320,17 @@ d.humidity() \end{lstlisting} \end{frame} +\subsection{Interrupts} +\begin{frame}{Here be dragons} + \begin{itemize} + \item Z.B. Callbacks von Tastern + \item pausieren main + \item dürf + \item Emergency exception buffer: \textit{micropython.alloc\_emergency\_exception\_buf(100)} + \item + \end{itemize} + \cite{mp-interrupt} +\end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%% References %%%%%%%%%%