add wiring images
parent
8e99d28423
commit
59aaad4152
|
|
@ -2,7 +2,7 @@
|
||||||
%Necessary Information
|
%Necessary Information
|
||||||
\author[C\&F]{Clemens, Franz}
|
\author[C\&F]{Clemens, Franz}
|
||||||
\title{IoT Night}
|
\title{IoT Night}
|
||||||
\subtitle{ESP8266 \& parts}
|
\subtitle{S stands for security}
|
||||||
%The day of the presentation
|
%The day of the presentation
|
||||||
\date{\today}
|
\date{\today}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,11 @@
|
||||||
@misc{micropython-doc,
|
@misc{micropython-doc,
|
||||||
url={https://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/intro.html}
|
url={https://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/intro.html}
|
||||||
}
|
}
|
||||||
|
@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}}}
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 106 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 122 KiB |
|
|
@ -187,14 +187,13 @@ Windows:
|
||||||
\item 115200 Baud
|
\item 115200 Baud
|
||||||
\item $n$ beherzte \textit{<ENTER>}-Drücke
|
\item $n$ beherzte \textit{<ENTER>}-Drücke
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
%TODO: bild mit REPL (inkl ENTERs)
|
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
\lstset{language=Python,captionpos=b}
|
\lstset{language=Python,captionpos=b}
|
||||||
|
|
||||||
\begin{frame}{REPL}
|
\begin{frame}{REPL}
|
||||||
\framesubtitle{Hello World!}
|
\framesubtitle{Hello World!}
|
||||||
%TODO: bild
|
%TODO: bild mit REPL (inkl ENTERs)
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -220,13 +219,17 @@ import webrepl_setup
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item \textit{import webrepl\_setup}
|
\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 visit \url{http://iot.wiai/webrepl/} or \url{http://micropython.org/webrepl/}
|
||||||
\item enter your ESP's IP (\textit{sta\_if.ifconfig()}) \& connect
|
\item enter your ESP's IP (\textit{sta\_if.ifconfig()}) \& connect
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
|
|
||||||
\subsection{Init}
|
\subsection{Init}
|
||||||
|
\begin{frame}{main.py}
|
||||||
|
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
\subsection{Exkurs: Flask-Server}
|
\subsection{Exkurs: Flask-Server}
|
||||||
\begin{frame}[fragile]{Gegenseite: Flask}
|
\begin{frame}[fragile]{Gegenseite: Flask}
|
||||||
\begin{lstlisting}[caption={C\&C Server},label=cnc]
|
\begin{lstlisting}[caption={C\&C Server},label=cnc]
|
||||||
|
|
@ -243,8 +246,8 @@ Starten:
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item[!] pip install Flask
|
\item[!] pip install Flask
|
||||||
\item python server.py
|
\item python server.py
|
||||||
\item docker-compose up (server.py in src/)
|
\item[||] docker-compose up (server.py in src/)
|
||||||
\item FLASK\_APP=server.py flask run
|
\item[||] FLASK\_APP=server.py flask run
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
\begin{frame}[fragile]{Daten übertragen}
|
\begin{frame}[fragile]{Daten übertragen}
|
||||||
|
|
@ -267,19 +270,20 @@ urequests.post(post_url, data=data, headers=json_header)
|
||||||
\section{Basteln}
|
\section{Basteln}
|
||||||
\subsection{Blinkende LED}
|
\subsection{Blinkende LED}
|
||||||
\begin{frame}{LED anschließen}
|
\begin{frame}{LED anschließen}
|
||||||
TODO schema
|
\image{.4\textwidth}{node-led}{LED \cite{node-led}}{img:led}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
\begin{frame}[fragile]{LEDs}
|
\begin{frame}[fragile]{LEDs}
|
||||||
\begin{lstlisting}[caption={LED},label=led]
|
\setbeamercovered{invisible}
|
||||||
|
\begin{lstlisting}[caption={LED},label=led,escapeinside={(*@}{@*)}]
|
||||||
import machine, time, math
|
import machine, time, math
|
||||||
pin = machine.Pin(0, machine.Pin.OUT)
|
pin = machine.Pin(0, machine.Pin.OUT)
|
||||||
pin.on()
|
pin.on()
|
||||||
pin.off()
|
pin.off()
|
||||||
|
(*@\onslide<2->@*)
|
||||||
pwm = machine.PWM(pin)
|
pwm = machine.PWM(pin)
|
||||||
pwm.duty(512)
|
pwm.duty(512)
|
||||||
pwm.deinit()
|
pwm.deinit()
|
||||||
|
(*@\onslide<3->@*)
|
||||||
def pulse(l, t):
|
def pulse(l, t):
|
||||||
for i in range(20):
|
for i in range(20):
|
||||||
l.duty(int(math.sin(i / 10 * math.pi) * 500 + 500))
|
l.duty(int(math.sin(i / 10 * math.pi) * 500 + 500))
|
||||||
|
|
@ -289,24 +293,23 @@ pulse(led, 50)
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
pulse(led, 20)
|
pulse(led, 20)
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
\end{frame}
|
\end{frame}
|
||||||
\subsection{Schalter und Taster}
|
\subsection{Schalter und Taster}
|
||||||
\begin{frame}[fragile]{Input}
|
\begin{frame}[fragile]{Input}
|
||||||
TODO: schema
|
\image{.35\textwidth}{button-nodemcu}{Taster \cite{node-button}}{img:button}
|
||||||
\begin{lstlisting}[caption={Input},label=input]
|
\begin{lstlisting}[caption={Input},label=input]
|
||||||
import machine
|
import machine
|
||||||
pin = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP)
|
pin = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP)
|
||||||
status = pin.value()
|
# status = pin.value()
|
||||||
|
|
||||||
def callback(p):
|
def callback(p):
|
||||||
print('changed', p)
|
print('changed', p)
|
||||||
|
|
||||||
pin.irq(trigger=machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING, handler=callback)
|
pin.irq(trigger=machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING, handler=callback)
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\end{frame}
|
\end{frame}
|
||||||
\subsection{Sensoren}
|
\subsection{Sensoren}
|
||||||
\begin{frame}[fragile]{Sensoren}
|
\begin{frame}[fragile]{Sensoren}
|
||||||
TODO: schema
|
\image{.35\textwidth}{nodemcu-dht22}{DHT22 \cite{node-dht}}{img:dht}
|
||||||
\begin{lstlisting}[caption={Sensoren},label=senors]
|
\begin{lstlisting}[caption={Sensoren},label=senors]
|
||||||
import dht
|
import dht
|
||||||
import machine
|
import machine
|
||||||
|
|
@ -317,6 +320,17 @@ d.humidity()
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\end{frame}
|
\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 %%%%%%%%%%
|
%%%%%%%%%% References %%%%%%%%%%
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue