@@ -39,22 +39,39 @@ First, connect the ESP32 board to the WiFi by creating boot.py file and writing
3939``` python
4040import network
4141import esp
42+ import time
4243esp.osdebug(None )
4344import gc
4445gc.collect()
4546
46- ssid = ' WIFI_NAME'
47- password = ' WIFI_PASSWORD'
47+ # set WiFi credentials
48+ ssid = ' '
49+ password = ' '
4850
49- station = network.WLAN(network.STA_IF )
51+ # check if there is username and password for wifi
52+ if (ssid != ' ' and password != ' ' ):
5053
51- station.active(True )
52- station.connect(ssid, password)
54+ station = network.WLAN(network.STA_IF )
5355
54- while station.isconnected() == False :
55- pass
56+ station.active( True )
57+ station.connect(ssid, password)
5658
57- print (' Connected to WiFi successfully, IP: %s ' % station.ifconfig()[0 ])
59+ timeout_interval = 10
60+
61+ # try to connect with timeout interval
62+ for i in range (0 ,timeout_interval):
63+ if (station.isconnected() == False ):
64+ time.sleep(1 )
65+ pass
66+ else :
67+ break ;
68+
69+ if (station.isconnected()):
70+ print (' Connected to WiFi successfully, IP: %s ' % station.ifconfig()[0 ])
71+ else :
72+ print (" Something went wrong, connection timeout, try again!" )
73+ else :
74+ print (" Please add WiFi credentials properly" )
5875```
5976
6077Make sure to change WiFi ESSID and Password. Once the ESP32 is connected to the Wifi, run the following commands:
@@ -68,6 +85,27 @@ This will install the latest version of micropython-eduponics package through up
6885
6986Examples are available in the examples/ directory.
7087
88+ ## Using firmwares
89+
90+ Alternatively, you can burn a ready made firmware which located under the repository firmwares directory
91+ currently 2 firmware available:
92+
93+ 1 . 4M-eduponics-micropython.bin - firmware includes micropython-eduponics library pre-installed (without the MQTT client).
94+ 2 . 4M-eduponics-MQTT.bin - firmware includes the MQTT library and everything you need to get started with the Eduponics mobile app.
95+
96+ To flash the firmware, run the following command using esptool.py
97+ ```
98+ esptool.py --baud 115200 --port <port_name> write_flash 0x0 <firmware_name>.bin
99+ ```
100+ Where <firmware_name> is the file name (the bin file you want to flash) and <port_name> is the port name to flash through.
101+
102+ Current firmware version: MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32
103+
104+ ## Changing MQTT broker
105+
106+ In order to change the MQTT broker, change the umqttsimple.py file inside the [ /Eduponics/] ( /Eduponics/umqttsimple.py ) directory
107+ Make sure to properly mark whenever you use SSL or not.
108+
71109## License
72110
73111MIT License
0 commit comments