This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import paho.mqtt.client as mqtt | |
| import RPi.GPIO as GPIO | |
| def on_connect(client, userdata, rc): | |
| #print ("Connected with rc: " + str(rc)) | |
| client.subscribe("kwf/demo/led") | |
| def on_message(client, userdata, msg): |
To be able to make all procedures without pain you should have physical keyboard or just install ssh server and connect to your device shell from computer.
Folow this guide to setup ssh server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| KEYMAPOPTS="us us" | |
| HOSTNAMEOPTS="-n alpine" | |
| INTERFACESOPTS="auto lo | |
| iface lo inet loopback | |
| auto eth0 | |
| iface eth0 inet dhcp | |
| hostname alpine | |
| " | |
| TIMEZONEOPTS="-z UTC" |