feature complete

master
clemens 2017-11-23 12:07:06 +01:00
parent a4d37b5002
commit d6dc02a798
4 changed files with 24 additions and 10 deletions

View File

@ -4,9 +4,9 @@ services:
esp:
image: iot.wiai:1337/esp8266
build: ./esp
volumes:
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
env:
environment:
- PORT=/dev/ttyUSB0
@ -15,7 +15,7 @@ services:
image: iot.wiai:1337/flask
volumes:
- ./src/:/flask/
env:
environment:
- FLASK_APP=server.py
ports:
- 5000:5000

View File

@ -1,4 +1,4 @@
FROM alpine:edge
RUN apk --update --no-cache-dir add picocom esptool
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && apk --update add picocom esptool
ENV PORT /dev/ttyUSB0
CMD ["picocom", "-b", "115200", "${PORT}"]
CMD ["sh", "-c", "picocom -b 115200 ${PORT}"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@ -179,6 +179,7 @@ Flashen:
\item \texttt{picocom -b 115200 /dev/ttyUSB0}
\item $n$ beherzte \textit{<ENTER>}-Drücke
\item Docker: \texttt{docker-compose run esp} (evtl. TTY anpassen)
\item[exit] Ctrl-a Ctrl-x
\end{itemize}
Windows:
\begin{itemize}
@ -193,7 +194,7 @@ Windows:
\begin{frame}{REPL}
\framesubtitle{Hello World!}
%TODO: bild mit REPL (inkl ENTERs)
\image{.7\textwidth}{repl}{REPL}{img:repl}
\end{frame}
@ -226,8 +227,21 @@ import webrepl_setup
\end{frame}
\subsection{Init}
\begin{frame}{main.py}
\begin{frame}[fragile]{main.py}
Wird beim starten ... gestartet
\begin{lstlisting}[caption={main.py},label=mainpy]
def connect_wifi(ssid, passphrase):
#TODO ;)
pass
def setup():
#TODO configure sensors, ...
pass
connect_wifi()
setup()
\end{lstlisting}
\end{frame}
\subsection{Exkurs: Flask-Server}
@ -250,6 +264,7 @@ Starten:
\item[||] FLASK\_APP=server.py flask run
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Daten übertragen}
\begin{lstlisting}[caption={HTTP Requests},label=http]
import urequests
@ -325,9 +340,8 @@ d.humidity()
\begin{itemize}
\item Z.B. Callbacks von Tastern
\item pausieren main
\item dürf
\item dürfen keinen Speicher allozieren
\item Emergency exception buffer: \textit{micropython.alloc\_emergency\_exception\_buf(100)}
\item
\end{itemize}
\cite{mp-interrupt}
\end{frame}