기본 콘텐츠로 건너뛰기

MQTT + Flask Server(Raspberry PI) + nodeMCU를 이용한 IoT 제작

MQTT + Flask Server(Raspberry PI) + nodeMCU를 이용한 IoT 제작

function onLED (){

// location.href = "light/ledon";

location . href = "/nodemcu.iot.csee/1/light/ledon" ;

}

function offLED (){

// location.href = "light/ledoff";

location . href = "/nodemcu.iot.csee/1/light/ledoff" ;

}

function toggleLED (){

location . href = "/nodemcu.iot.csee/1/light/led" ;

}

function onUSBLED (){

location . href = "/nodemcu.iot.csee/1/light/usbledon" ;

}

function offUSBLED (){

location . href = "/nodemcu.iot.csee/1/light/usbledoff" ;

}

function toggleUSBLED (){

location . href = "/nodemcu.iot.csee/1/light/usbled" ;

}

< /script>

/head>

실전 프로젝트 IoT

MQTT를 이용한 nodemcu 컨트롤

Home으로 이동

LED 켜고 끄기 ver2

LED On

LED Off

LED Toggle

{% if flag == 1 %}

led on

{% else %}

led off

{% endif %}

USB LED 켜고 끄기 - 1217 오후ver

USB LED On

USB LED Off

USB LED Toggle

{% if flag2 == 1 %}

usb led on

{% else %}

usb led off

{% endif %}

$ (

function (){

$ ( "#toggle_led" ). change ( function (){

window . location . href = "/led" ;

}

)

}

)

< /script>

from http://covenant.tistory.com/72 by ccl(A) rewrite - 2020-03-06 09:54:18

댓글

이 블로그의 인기 게시물

Flask 13. pythonanywhere에 배포하기

Flask 13. pythonanywhere에 배포하기 Login: PythonAnywhere It's always a pleasure to hear from you! Ask us a question, or tell us what you love or hate about PythonAnywhere. We'll get back to you over email ASAP. Sorry, there was an error connecting to the server. Please try again in a few moments... www.pythonanywhere.com from http://ohdowon064.tistory.com/124 by ccl(A) rewrite - 2020-03-11 15:54:10

[ubuntu] FLASK_APP

[ubuntu] FLASK_APP Development/Debugging 🐞 FLASK_ENV=development FLASK_APP = app.py flask run zsh: command not found: FLASK_APP ✔️ FLASK_ENV=development FLASK_APP=app.py flask run 띄어쓰기를 해서 저런 오류를 출력할수도 있구나 😲 참고 : 108p에서 FLASK가 FKAS로 오타나있다. from http://hee-stories.tistory.com/18 by ccl(A) rewrite - 2020-03-24 17:20:11