diff --git a/examples/wifinina/mqttclient/main.go b/examples/wifinina/mqttclient/main.go index 3af0b9d..3418911 100644 --- a/examples/wifinina/mqttclient/main.go +++ b/examples/wifinina/mqttclient/main.go @@ -35,10 +35,7 @@ const server = "tcp://test.mosquitto.org:1883" var ( // these are the default pins for the Arduino Nano33 IoT. - uart = machine.UART2 - tx = machine.NINA_TX - rx = machine.NINA_RX - spi = machine.NINA_SPI + spi = machine.NINA_SPI // this is the ESP chip that has the WIFININA firmware flashed on it adaptor *wifinina.Device @@ -48,7 +45,6 @@ var ( func main() { time.Sleep(3000 * time.Millisecond) - uart.Configure(machine.UARTConfig{TX: tx, RX: rx}) rand.Seed(time.Now().UnixNano()) // Configure SPI for 8Mhz, Mode 0, MSB First @@ -94,7 +90,7 @@ func main() { println(err.Error()) } } - time.Sleep(1 * time.Millisecond) + time.Sleep(100 * time.Millisecond) } // Right now this code is never reached. Need a way to trigger it... diff --git a/examples/wifinina/mqttsub/main.go b/examples/wifinina/mqttsub/main.go index 249c743..4dcb23d 100644 --- a/examples/wifinina/mqttsub/main.go +++ b/examples/wifinina/mqttsub/main.go @@ -32,12 +32,8 @@ const server = "tcp://test.mosquitto.org:1883" // change these to connect to a different UART or pins for the ESP8266/ESP32 var ( - // these are the default pins for the Arduino Nano33 IoT. - uart = machine.UART2 - tx = machine.NINA_TX - rx = machine.NINA_RX - spi = machine.NINA_SPI + spi = machine.NINA_SPI // this is the ESP chip that has the WIFININA firmware flashed on it adaptor *wifinina.Device @@ -55,7 +51,6 @@ func subHandler(client mqtt.Client, msg mqtt.Message) { func main() { time.Sleep(3000 * time.Millisecond) - uart.Configure(machine.UARTConfig{TX: tx, RX: rx}) rand.Seed(time.Now().UnixNano()) // Configure SPI for 8Mhz, Mode 0, MSB First diff --git a/examples/wifinina/ntpclient/main.go b/examples/wifinina/ntpclient/main.go index 261094b..0e58345 100644 --- a/examples/wifinina/ntpclient/main.go +++ b/examples/wifinina/ntpclient/main.go @@ -28,10 +28,7 @@ const NTP_PACKET_SIZE = 48 var ( // these are the default pins for the Arduino Nano33 IoT. - uart = machine.UART2 - tx = machine.NINA_TX - rx = machine.NINA_RX - spi = machine.NINA_SPI + spi = machine.NINA_SPI // this is the ESP chip that has the WIFININA firmware flashed on it adaptor *wifinina.Device @@ -39,8 +36,6 @@ var ( ) func setup() { - uart.Configure(machine.UARTConfig{TX: tx, RX: rx}) - // Configure SPI for 8Mhz, Mode 0, MSB First spi.Configure(machine.SPIConfig{ Frequency: 8 * 1e6, diff --git a/examples/wifinina/tcpclient/main.go b/examples/wifinina/tcpclient/main.go index 9449d3f..7d2d580 100644 --- a/examples/wifinina/tcpclient/main.go +++ b/examples/wifinina/tcpclient/main.go @@ -29,10 +29,7 @@ const serverIP = "" var ( // these are the default pins for the Arduino Nano33 IoT. - uart = machine.UART2 - tx = machine.NINA_TX - rx = machine.NINA_RX - spi = machine.NINA_SPI + spi = machine.NINA_SPI // this is the ESP chip that has the WIFININA firmware flashed on it adaptor *wifinina.Device @@ -42,8 +39,6 @@ var buf = &bytes.Buffer{} func main() { - uart.Configure(machine.UARTConfig{TX: tx, RX: rx}) - // Configure SPI for 8Mhz, Mode 0, MSB First spi.Configure(machine.SPIConfig{ Frequency: 8 * 1e6, diff --git a/examples/wifinina/tlsclient/main.go b/examples/wifinina/tlsclient/main.go index f9d0a5d..0583305 100644 --- a/examples/wifinina/tlsclient/main.go +++ b/examples/wifinina/tlsclient/main.go @@ -30,10 +30,7 @@ const server = "tinygo.org" var ( // these are the default pins for the Arduino Nano33 IoT. - uart = machine.UART2 - tx = machine.NINA_TX - rx = machine.NINA_RX - spi = machine.NINA_SPI + spi = machine.NINA_SPI // this is the ESP chip that has the WIFININA firmware flashed on it adaptor *wifinina.Device @@ -45,8 +42,6 @@ var lastRequestTime time.Time var conn net.Conn func setup() { - uart.Configure(machine.UARTConfig{TX: tx, RX: rx}) - // Configure SPI for 8Mhz, Mode 0, MSB First spi.Configure(machine.SPIConfig{ Frequency: 8 * 1e6, diff --git a/examples/wifinina/webclient/main.go b/examples/wifinina/webclient/main.go index 9c40098..1c02fd5 100644 --- a/examples/wifinina/webclient/main.go +++ b/examples/wifinina/webclient/main.go @@ -27,10 +27,7 @@ const server = "tinygo.org" var ( // these are the default pins for the Arduino Nano33 IoT. - uart = machine.UART2 - tx = machine.NINA_TX - rx = machine.NINA_RX - spi = machine.NINA_SPI + spi = machine.NINA_SPI // this is the ESP chip that has the WIFININA firmware flashed on it adaptor *wifinina.Device @@ -42,8 +39,6 @@ var lastRequestTime time.Time var conn net.Conn func setup() { - uart.Configure(machine.UARTConfig{TX: tx, RX: rx}) - // Configure SPI for 8Mhz, Mode 0, MSB First spi.Configure(machine.SPIConfig{ Frequency: 8 * 1e6, diff --git a/wifinina/README.md b/wifinina/README.md index e9b7b5f..7a475ef 100644 --- a/wifinina/README.md +++ b/wifinina/README.md @@ -10,9 +10,9 @@ For information on how to use this driver, please take a look at the examples lo ## nina-fw Firmware -**PLEASE NOTE: New Arduino Nano33 IoT boards most likely already have a recent version of the nina-fw firmware pre-installed, so you should not need to install the firmware yourself.** +**PLEASE NOTE: New Adafruit Boards with WiFi and Arduino Nano33 IoT boards most likely already have a recent version of the nina-fw firmware pre-installed. You should not need to install the firmware yourself.** -In order to use this driver, you must have the nina-fw firmware installed on the ESP32 chip. If it is already installed, you can just use it. You do not need to flash the firmware again. +In order to use this driver, you must have the nina-fw firmware installed on the ESP32 chip. If it is already installed, you can just use it. You do not need to flash the firmware again. The following instructions are only for those who want or need to update the firmware on your board. ### Installing esptool to flash nina-fw firmware @@ -24,7 +24,7 @@ pip install esptool Once you have installed `esptool` you can follow the correct procedure for flashing your board. -### Updating the Arduino Nano33 IoT +### Updating nina-fw on the Arduino Nano33 IoT In the `updater` directory we have a precompiled binary of the "passthrough" code you will need to flash first, in order to update the ESP32 co-processor on your board. @@ -48,3 +48,9 @@ esptool --port /dev/ttyACM0 --before default_reset --baud 115200 write_flash 0 . ``` You only need to do this one time, and then the correct nina-fw firmware will be on the NINA ESP32 chip, and you can just flash the Arduino Nano33 IoT board using TinyGo. + +## Updating Adafruit ESP32 WiFi Boards + +Adafruit provides very good instructions for updating their boards that provide a ESP32 WiFi-BLE co-processor. For more information, please see: + +https://learn.adafruit.com/upgrading-esp32-firmware