pxt-common-packages/libs/esp32
Michał Moskal e1d8e0db4d
improvements for esp32 wifi driver (#1285)
* move CHK() esp32 macro to header

* fix warning

* move connect() logic to base net.Controller

* jacdac-ify net.AccessPoint class

* Add settings.read/writeJSON

* Support for access point priorities

* remove dead code

* reconnect in a loop

* Add ipInfo

* Add Controller.setConnected()

* Fix build

* dmesg wifi scan results

* Fix event handler execution exclusion

* Account for WPA2_Enterprise (no password)

* Implement ssid

* add missing sim method
2021-10-08 01:06:03 +02:00
..
README.md Docs: add more info on esp32 pins 2019-11-04 17:04:10 -08:00
atcontroller.ts improvements for esp32 wifi driver (#1285) 2021-10-08 01:06:03 +02:00
espflasher.cpp Esp32 refactoring (#907) 2019-09-12 10:23:44 -07:00
net.ts Esp32 cleanup (#973) 2019-10-10 12:44:11 -07:00
ninacontroller.ts improvements for esp32 wifi driver (#1285) 2021-10-08 01:06:03 +02:00
pxt.json Esp32 cleanup (#973) 2019-10-10 12:44:11 -07:00
test.ts Esp32 cleanup (#973) 2019-10-10 12:44:11 -07:00

README.md

ESP32

Communication layer to a accessory ESP32 chip.

Ported from Adafruit Circuit Python https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI.

Configuration

Nina-FW over SPI

The companion firmware is https://github.com/adafruit/nina-fw over SPI. The pins of the main board need to be configured either in the bootloader or using namespace userconfig { ... }. The ESP32 pins are listed next to each key below (the number in parenthesis is the pin number on WROOM-32 module).

  • PIN_WIFI_CS, ESP32 CS pin mapping, IO5 (29)
  • PIN_WIFI_BUSY, ESP32 BUSY pin mapping, IO33 (9)
  • PIN_WIFI_RESET, ESP32 RESET pin mapping, EN (3)
  • PIN_WIFI_GPIO0 (optional), ESP32 GPIO0 pin mapping, IO0 (25)

The driver uses the default SPI pins. You can override this behavior by specifying these 3 keys.

  • PIN_WIFI_MOSI (optional), dedicated SPI MOSI pin, IO14 (13)
  • PIN_WIFI_MISO (optional), dedicated SPI MISO pin, IO23 (37)
  • PIN_WIFI_SCK (optional), dedicated SPI SCK pin, IO18 (30)

Expressif AT commands over serial

Not supported yet.

  • PIN_WIFI_AT_RX, ESP32 RX pin mapping
  • PIN_WIFI_AT_TX, ESP32 TX pin mapping

Access Points and passwords

The module uses access points and password information stored in the device secrets. These secrets can be set programmatically using net.updateAccessPoint or via the menu items in Arcade (added via the net-game extension).

Friendly reminder: Do not share .uf2 files or programs with secrets!!

Example

See net package readme.