Table of Contents

connect to Wi-Fi () with password ()

Description

The block connects the Quarky or ESP32 to the specified Wi-Fi and password. The block is only available in the Upload Mode when the code is uploaded to Quarky.

Example

In this example, we look at how to establish and see if the Wi-Fi is connected to Quarky or not.

In this example, we look at how to establish and see if the Wi-Fi is connected to Quarky or not.

Code

The following code can be used for it:

The following code is generated by PictoBlox:

# This python code is generated by PictoBlox

from quarky import *
# This python code is generated by PictoBlox

# imported modules
import iot

wifi = iot.wifi()


wifi.connecttowifi("IoT","12345678")
while True:
	if wifi.iswificonnected():
		quarky.drawpattern("ccccccccccccccccccccccccccccccccccc")
	
	else:
		pass
		quarky.drawpattern("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")

Output

Troubleshooting

  1. If the Green Light comes, your Wi-Fi is connected.
  2. If the Red Light comes, your Wi-Fi is not connected. Change the Wi-Fi and the password and try again.
  3. If the Red Cross sign comes, Quarky, Python error has occurred. Check the serial monitor and try to reset the Quarky.
Read More
All articles loaded
No more articles to load