I have the beta version of CircuitPython (8) UF2 installed. I am using Thonny.
Problem 1) When I first connect my Pico W to thonny, thonny gives me this list of errors in a dialog box (below). I can close the dialog and execute the "hello World" example successfully. Wondering what this is and how to address?
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/thonny/workbench.py", line 1711, in event_generate
handler(event)
File "/usr/lib/python3/dist-packages/thonny/shell.py", line 449, in _handle_toplevel_response
self._insert_text_directly(welcome_text, ("welcome",))
File "/usr/lib/python3/dist-packages/thonny/shell.py", line 1039, in _insert_text_directly
_insert_and_highlight_urls(txt, tags)
File "/usr/lib/python3/dist-packages/thonny/shell.py", line 999, in _insert_and_highlight_urls
_insert(part, tags)
File "/usr/lib/python3/dist-packages/thonny/shell.py", line 993, in _insert
self.direct_insert("output_insert", txt, tags)
File "/usr/lib/python3/dist-packages/thonny/ui_utils.py", line 833, in direct_insert
result = tktextext.EnhancedText.direct_insert(self, index, chars, tags=tags, **kw)
File "/usr/lib/python3/dist-packages/thonny/tktextext.py", line 748, in direct_insert
super().direct_insert(index, chars, tags, **kw)
File "/usr/lib/python3/dist-packages/thonny/tktextext.py", line 162, in direct_insert
self._original_insert(index, chars, tags, **kw)
File "/usr/lib/python3/dist-packages/thonny/tktextext.py", line 38, in original_function
self.tk.call((self._original_widget_name, operation) + args)
_tkinter.TclError: character U+1f40d is above the range (U+0000-U+FFFF) allowed by Tcl
Problem 2)
When I run the example code (below) I get:
Traceback (most recent call last):
File "<stdin>", line 6, in <module>
ImportError: no module named 'ipaddress'
but this example states that no libraries are needed... So I am confused.
Code: Select all
SPDX-FileCopyrightText: 2022 Liz Clark for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import os
import ipaddress
import wifi
import socketpool
print()
print("Connecting to WiFi")
# connect to your SSID
wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY_WIFI_PASSWORD'))
print("Connected to WiFi")
pool = socketpool.SocketPool(wifi.radio)
# prints MAC address to REPL
print("My MAC addr:", [hex(i) for i in wifi.radio.mac_address])
# prints IP address to REPL
print("My IP address is", wifi.radio.ipv4_address)
# pings Google
ipv4 = ipaddress.ip_address("8.8.4.4")
print("Ping google.com: %f ms" % (wifi.radio.ping(ipv4)*1000))