Skip to content

Instantly share code, notes, and snippets.

@PaulskPt
Last active September 24, 2022 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PaulskPt/b0d3e075f654658fc47c3a8f6c83aaa4 to your computer and use it in GitHub Desktop.
Save PaulskPt/b0d3e075f654658fc47c3a8f6c83aaa4 to your computer and use it in GitHub Desktop.
UM_FeatherS2_with_CircuitPython_V7.3.3._WiFi_test
import time, gc, os
import board
import feathers3
import wifi
import socketpool
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
print()
try:
wifi.AuthMode.WPA2
wifi.radio.connect(secrets["ssid"], secrets["password"])
ip = wifi.radio.ipv4_address
if ip:
print("Connected to %s!"%secrets["ssid"])
print("My IP address is", ip)
except ConnectionError as e:
print("Wifi", e)
pass
time.sleep(5)
# Say hello
print("\nHello from FeatherS3!")
print("------------------\n")
# Show available memory
print("Memory Info - gc.mem_free()")
print("---------------------------")
print("{} Bytes\n".format(gc.mem_free()))
flash = os.statvfs('/')
flash_size = flash[0] * flash[2]
flash_free = flash[0] * flash[3]
# Show flash size
print("Flash - os.statvfs('/')")
print("---------------------------")
print("Size: {} Bytes\nFree: {} Bytes\n".format(flash_size, flash_free))
# Rainbow colours on the NeoPixel
print("Entering loop")
loop_nr = 0
while True:
#time.sleep(3)
loop_nr += 1
if loop_nr > 0 and loop_nr % 100 == 0:
print("loop nr: ",loop_nr)
if loop_nr >= 10000:
loop_nr = 0
time.sleep(2)
@PaulskPt
Copy link
Author

PaulskPt commented Sep 24, 2022

REPL output:

Adafruit CircuitPython 7.3.3 on 2022-08-29; FeatherS3 with ESP32S3
>>> 
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Wifi Unknown failure 205

Hello from FeatherS3!
------------------

Memory Info - gc.mem_free()
---------------------------
8190944 Bytes

Flash - os.statvfs('/')
---------------------------
Size: 12224512 Bytes
Free: 12201984 Bytes

Entering loop
loop nr:  100
loop nr:  200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment