@@ -66,8 +66,8 @@ To retrieve a parameter use function `getParameter()` which takes following argu
6666
6767Example:
6868``` Python
69- lo.addParameter(" messageRate" , 25 , INT );
70- lo.addParameter(" sendDHTData" , true ,BINARY , myCallbackFunction);
69+ lo.addParameter(" messageRate" , 25 , LiveObjects. INT );
70+ lo.addParameter(" sendDHTData" , true ,LiveObjects. BINARY , myCallbackFunction);
7171...
7272if lo.getParameter(" sendDHTData" ):
7373 lo.addToPayload(" temperature" ,DHT .readTemeprature())
@@ -153,5 +153,78 @@ def foo():
153153 # ...
154154 lo.loop(); # Keep this in main loop
155155 lo.disconnect()
156- }
157156```
157+
158+
159+ # Installation guide for uPython #
160+
161+ ## Requirements ##
162+ 1 . [ ampy] ( https://learn.adafruit.com/micropython-basics-load-files-and-run-code/install-ampy )
163+ 2 . [ umqttsimple, umqttrobust and ssl] ( https://github.com/micropython/micropython-lib )
164+ 3 . [ PuTTY] ( https://www.putty.org/ ) (for Windows)
165+
166+ ## Installation steps ##
167+ 1 . Copy files into device
168+ ```
169+ ampy -pCOMXX put umqttrobus.py
170+ ampy -pCOMXX put umqttsimple.py
171+ ampy -pCOMXX put ssl.py
172+ ampy -pCOMXX put LiveObjects //It will copy directory with its content
173+ ```
174+ 2 . Prepare your sketch and save it as main.py then copy file into device
175+ ```
176+ ampy -pCOMXX put main.py
177+ ```
178+ 3 . Setup internet connection in boot.py file and upload it into device. Example for esp8266
179+ ``` Python
180+ # This file is executed on every boot (including wake-boot from deepsleep)
181+ # import esp
182+ # esp.osdebug(None)
183+ import uos, machine
184+ # uos.dupterm(None, 1) # disable REPL on UART(0)
185+ import gc
186+ # import webrepl
187+ # webrepl.start()
188+ gc.collect()
189+
190+
191+ # Network connection
192+ import network
193+ sta_if = network.WLAN(network.STA_IF )
194+ if not sta_if.isconnected():
195+ print (' connecting to network...' )
196+ sta_if.active(True )
197+ sta_if.connect(' SSID' , ' PASS' )
198+ while not sta_if.isconnected():
199+ pass
200+ print (' network config:' , sta_if.ifconfig())
201+ ```
202+ You may want to get content of file first, then use
203+ ```
204+ ampy -pCOMXX get boot.py
205+ ```
206+ 4 . Connect to device and check if it's working using PuTTY
207+
208+ Crtl + D soft resets device
209+
210+ Ctrl + C Stops currently running script
211+
212+ ## Summary ##
213+ After all steps content of the device should look like this
214+ ```
215+ >ampy -pCOMXX ls
216+ /LiveObjects
217+ /boot.py
218+ /main.py
219+ /ssl.py
220+ /umqttrobust.py
221+ /umqttsimple.py
222+
223+ >ampy -pCOMXX ls LiveObjects
224+ /LiveObjects/Connection.py
225+ /LiveObjects/__init__.py
226+ /LiveObjects/certfile.cer
227+ ```
228+
229+ ## Troubleshooting ##
230+ If you are getting 'MQTT exception: 5' check your api key
0 commit comments