Skip to content

Conversation

@dhalbert
Copy link
Collaborator

Implement wifi/socketpool/ssl for Airlift (NINA-FW) co-processors.

Starting this as a draft, for testing purposes. Tested with Adafruit NINA-FW 3.4.0.

  • Web workflow not yet implemented.
  • HTTP and HTTPS client work. UDP client and server work.
  • HTTP server gets an error after a minute or so of continuous polling, alternating GET_STATE_TCP_CMD and AVAIL_DATA_TCP_CMD. The failure is that the ready line from the AirLift is in the wrong state. This may be some failure or race condition on the AirLift side. I have some other ideas for investigating this as well. Adding some delays did not help. Error is repeated:
Traceback (most recent call last):
  File "adafruit_httpserver/server.py", line 482, in poll
TimeoutError: timeout waiting for ready False
  • Main implementation is in devices/airlift.
  • wifi.radio.init_airlift() added to specify pins to use.
  • CIRCUITPY_{WIFI,SSL,SOCKETPOOL} further refined as CIRCUITPY_*_NATIVE and CIRCUITPY_*_AIRLIFT. Compiled guards changed appropriately.
  • Fixed common_hal_socketpool_socket_bind() return type from size_t to int.
  • Fixed some socketpool function names which were not named canonically.
  • Added common_hal_wifi_radio_get_version(().
  • common_hal_socketpool_socket_recv_into() and socketpool_socket_recv_into() buffer args were const and should not have been.
  • Use -flto=auto instead of -flto=jobserver to fix spurious message about jobserver.
  • Simplify arg validation in Freeverb,c (found while consolidating some error messages).
  • Check for deinited SPI in SPI try_lock().
  • Add some internal IPv4 address conversion functions in IPv4Address. Simplify some conversion code.
  • Be more precise with uses of "host", "address", and "port" in socket documentaiton.
  • Add an elem_print_helper() routines in shared_bindings/util.c to make printing objects easier. Used to give more info when printing a Network object.
  • Add port_malloc_check() and port_realloc_check() routines. These are not used now, but were added when it looked like I needed to do port mallocs for talking to the AirLift.

There were a lot more commits with some dead ends and snapshot commits but I rebased to only a few.

get/set hostname

power mgmt, ip config; compiles

wip

compiles

SSID connection working

fix authmode in scanned results

getaddrinfo

fix incorrect const in socket recv API

wip: progress on socket ops

wip

wip; removing heap ops; still need to do sock ops

HTTP fetches work

wip ssl

HTTPS fetching works

wip: manage nina client and server

UDP working both ways
@dhalbert dhalbert marked this pull request as draft January 27, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant