fix install esptool ubuntu and flask

master
Michael Traeger 2017-11-27 20:17:15 +01:00
parent 28b15337e0
commit 4c11796157
1 changed files with 4 additions and 1 deletions

View File

@ -148,6 +148,7 @@ Lowlevel: C, Arduino Studio
Linux
\begin{itemize}
\item Debian, Gentoo (testing): \texttt{\{apt install,emerge\} esptool picocom}
\item Ubuntu: \texttt{pip3 install esptool \&\& apt install picocom}
\item \texttt{adduser \$USER dialout}
\item neuer Login (sudo su \$USER)
%\item Alternative: Docker (bin/docker): \textit{docker-compose run esp esptool}
@ -266,19 +267,21 @@ setup()
\begin{lstlisting}[caption={C\&C Server},label=cnc]
from flask import Flask, request
app = Flask(__name__)
app.debug = True
@app.route("/")
def hello():
return "Hello ESP8266!"
@app.route("/id/<id:id>", methods=['GET','POST'])
def log(id):
app.logger.info("%s was here and delivered '%s'", id, request.data.decode("utf8"))
return "You were here!"
\end{lstlisting}
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[||] FLASK\_APP=server.py flask run --host 0.0.0.0
\end{itemize}
\end{frame}