Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: adafruit/Adafruit_CircuitPython_PortalBase
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: eba700c54d4fe4576123cf66f4d54cfa934b10b1
Choose a base ref
...
head repository: adafruit/Adafruit_CircuitPython_PortalBase
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e23cc47d97a97a3dc65b951c0bfc085668c8d1b1
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Feb 23, 2024

  1. Remove legacy requests.set_socket

    justmobilize committed Feb 23, 2024
    Copy the full SHA
    2288323 View commit details
  2. Merge pull request #100 from justmobilize/remove-set-socket

    Remove legacy requests.set_socket
    tannewt authored Feb 23, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e23cc47 View commit details
Showing with 10 additions and 5 deletions.
  1. +9 −5 adafruit_portalbase/wifi_coprocessor.py
  2. +1 −0 requirements.txt
14 changes: 9 additions & 5 deletions adafruit_portalbase/wifi_coprocessor.py
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@
import board
from digitalio import DigitalInOut
from adafruit_esp32spi import adafruit_esp32spi, adafruit_esp32spi_wifimanager
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
import adafruit_requests as requests
import adafruit_connection_manager
import adafruit_requests

__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_PortalBase.git"
@@ -67,19 +67,23 @@ def __init__(self, *, status_led=None, esp=None, external_spi=None):
spi, esp32_cs, esp32_ready, esp32_reset, esp32_gpio0
)

requests.set_socket(socket, self.esp)
if self.esp.is_connected:
self.requests = requests
self._set_requests()
self._manager = None

gc.collect()

def _set_requests(self):
pool = adafruit_connection_manager.get_radio_socketpool(self.esp)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(self.esp)
self.requests = adafruit_requests.Session(pool, ssl_context)

def connect(self, ssid, password):
"""
Connect to WiFi using the settings found in secrets.py
"""
self.esp.connect({"ssid": ssid, "password": password})
self.requests = requests
self._set_requests()

def neo_status(self, value):
"""The status NeoPixel.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
Adafruit-Blinka-displayio
Adafruit-Blinka
adafruit-circuitpython-bitmap-font
adafruit-circuitpython-connectionmanager
adafruit-circuitpython-display-text
adafruit-circuitpython-neopixel
adafruit-circuitpython-adafruitio