Table of Contents

is Wi-Fi connected?

Description

The block reports if the Wi-Fi is connected to the Quarky or ESP32 or not. This block is only available in Upload Mode.

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