Ever wonder why we can apply the smart home concept to our home? Here the first step to implementing a smart lighting system with micropython, code IoT device as easy as code with python.
2. Hello!
I am Tegar Imansyah
IoT Enthusiast Enthusiast
You can find me at @tegarimansyah
2
3. Today’s Agenda
● What is Smart Lighting System?
● Electronics Part
● Connecting Device
● Controlling from Worldwide
3
4. What is it?
We will learn What is the difference of Smart Lighting System, Smart
Home and IoT.
1
5. What is it?
5
Source: https://blogs.intel.com/iot/2015/04/01/all-for-one-and-one-
for-all-how-the-iot-is-centralizing-intelligence-across-industries/
Source:
http://condorestates.co.uk/featured/smart-homes-ready-or-not/
14. MicroPython
14
● Python programming language that is optimised to run on
microcontrollers.
● Created by Damien P. George at 2013
● Learn more https://micropython.org/
● Micropython is Installed on your microcontroller instead of
your computer
● Support REPL, Run from file and standalone.
15. Getting Started (on Ubuntu)
15
● Install Tools = [ esptools.py, Adafruit MicroPython Tool (ampy),
Serial Terminal ]
● Download images (http://micropython.org/download#esp8266)
● Install
○ Plug in microcontroller to your computer
○ $ esptool.py --port /dev/ttyUSB0 erase_flash
○ $ esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash
--flash_size=detect 0 esp8266-20170108-v1.8.7.bin
16. Getting Started (on Ubuntu)
16
● Open Serial
Terminal
● REPL active
if not blocked
17. Getting Started (on Ubuntu)
17
● Files on MicroPython
○ $ export AMPY_PORT=/dev/ttyUSB0
○ $ ampy run main.py # run main.py from computer in microcontroller
○ $ ampy ls # Checking file(s) on microcontroller
○ $ ampy put main.py # copy main.py from computer
● Hierarchy:
○ boot.py
○ main.py (if exist)
○ REPL