Hy guys,
I'm trying to use the WINC1500 breakout board to make my Teensy 4.0 connect to the wifi network without success.
My Arduino IDE version is: 1.8.13
My WiFi library version is: 1.2.7
My WiFi101 library version is: 0.16.1
I was able to update the WINC1500 firmware (to the 19.6.1 version) succesfully using the Teensy, following these instructions.
I have tried to use the board with an Arduino UNO using the following connections:
I've placed the line WiFi.setPins(8,7,4); at the beginning of the setup and I went through all the first examples (CheckWiFi101FirmwareVersion, ScanNetworks, ConnectWithWPA) with satisfactory results: even the green LED marked "wifi" on the WINC breakout board lights up at the end of execution of example ConnectWithWPA to indicate a successful connection.
I went through the same steps using Teensy and the results were not as satisfactory (partially satisfactory would be better to say).
I've used the same connections I've made for the Arduino
Even if with this setup I'm able to correctly check the firmware version:
I don't see any available WiFi network:
While, using the Arduino UNO, I saw, at least, 7 different WiFi networks.
Then, when I tried connecting to one of them I knew it is up and working, The Teensy get stuck in a loop:
Ps:
I've also read some other similar posts but I wasn't able to get any useful information (link, link, link, link and link)
PPS: thanks @BriComp, my code is almost the same as the code of the WiFi examples as I have explained.
here we are with the first example CheckWiFi101FirmwareVersion:
here's the second example ScanNetworks:
here's the third ConnectWithWPA:
I'm trying to use the WINC1500 breakout board to make my Teensy 4.0 connect to the wifi network without success.
My Arduino IDE version is: 1.8.13
My WiFi library version is: 1.2.7
My WiFi101 library version is: 0.16.1
I was able to update the WINC1500 firmware (to the 19.6.1 version) succesfully using the Teensy, following these instructions.
I have tried to use the board with an Arduino UNO using the following connections:
I've placed the line WiFi.setPins(8,7,4); at the beginning of the setup and I went through all the first examples (CheckWiFi101FirmwareVersion, ScanNetworks, ConnectWithWPA) with satisfactory results: even the green LED marked "wifi" on the WINC breakout board lights up at the end of execution of example ConnectWithWPA to indicate a successful connection.
I went through the same steps using Teensy and the results were not as satisfactory (partially satisfactory would be better to say).
I've used the same connections I've made for the Arduino
Even if with this setup I'm able to correctly check the firmware version:
Code:
WiFi101 firmware check.
WiFi101 shield: DETECTED
Firmware version installed: 19.6.1
Latest firmware version available : 19.6.1
Check result: PASSED
Code:
10:30:44.094 -> MAC: F8:F0:05:95:96:C6
10:30:44.094 -> Scanning available networks...
10:30:44.094 -> ** Scan Networks **
10:30:49.083 -> number of available networks:0
10:30:59.083 -> Scanning available networks...
10:30:59.083 -> ** Scan Networks **
10:30:59.083 -> number of available networks:0
Then, when I tried connecting to one of them I knew it is up and working, The Teensy get stuck in a loop:
Code:
10:32:42.323 -> Attempting to connect to WPA SSID: My_WiFi_network
10:33:52.329 -> Attempting to connect to WPA SSID: My_WiFi_network
10:34:02.849 -> Attempting to connect to WPA SSID: My_WiFi_network
10:34:13.379 -> Attempting to connect to WPA SSID: My_WiFi_network
10:34:23.944 -> Attempting to connect to WPA SSID: My_WiFi_network
10:34:34.473 -> Attempting to connect to WPA SSID: My_WiFi_network
10:34:44.997 -> Attempting to connect to WPA SSID: My_WiFi_network
10:34:55.549 -> Attempting to connect to WPA SSID: My_WiFi_network
- Why it is (not) working this way?
- Is there something I'm doing wrong? maybe some forbidden Teensy Pin I should substitute with another one?
- Maybe is it a question of current draw (which is not the case IMHO)?
Ps:
I've also read some other similar posts but I wasn't able to get any useful information (link, link, link, link and link)
PPS: thanks @BriComp, my code is almost the same as the code of the WiFi examples as I have explained.
here we are with the first example CheckWiFi101FirmwareVersion:
Code:
/*
* This example check if the firmware loaded on the WiFi101
* shield is updated.
*
* Circuit:
* - WiFi101 Shield attached
*
* Created 29 July 2015 by Cristian Maglie
* This code is in the public domain.
*/
#include <SPI.h>
#include <WiFi101.h>
#include <driver/source/nmasic.h>
void setup() {
// ref: https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/using-the-wifi-module
//Configure pins for Adafruit ATWINC1500 Feather
// WiFi.setPins(chipSelect, irq, reset, enable-facoltativo)
WiFi.setPins(8,7,4);
// Initialize serial
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// Print a welcome message
Serial.println("WiFi101 firmware check.");
Serial.println();
// Check for the presence of the shield
Serial.print("WiFi101 shield: ");
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("NOT PRESENT");
return; // don't continue
}
Serial.println("DETECTED");
// Print firmware version on the shield
String fv = WiFi.firmwareVersion();
String latestFv;
Serial.print("Firmware version installed: ");
Serial.println(fv);
if (REV(GET_CHIPID()) >= REV_3A0) {
// model B
latestFv = WIFI_FIRMWARE_LATEST_MODEL_B;
} else {
// model A
latestFv = WIFI_FIRMWARE_LATEST_MODEL_A;
}
// Print required firmware version
Serial.print("Latest firmware version available : ");
Serial.println(latestFv);
// Check if the latest version is installed
Serial.println();
if (fv >= latestFv) {
Serial.println("Check result: PASSED");
} else {
Serial.println("Check result: NOT PASSED");
Serial.println(" - The firmware version on the shield do not match the");
Serial.println(" version required by the library, you may experience");
Serial.println(" issues or failures.");
}
}
void loop() {
// do nothing
}
here's the second example ScanNetworks:
Code:
/*
This example prints the WiFi shield's MAC address, and
scans for available WiFi networks using the WiFi shield.
Every ten seconds, it scans again. It doesn't actually
connect to any network, so no encryption scheme is specified.
Circuit:
* WiFi shield attached
created 13 July 2010
by dlf (Metodo2 srl)
modified 21 Junn 2012
by Tom Igoe and Jaymes Dec
*/
#include <SPI.h>
#include <WiFi101.h>
void setup() {
//Initialize serial and wait for port to open:
// ref: https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/using-the-wifi-module
//Configure pins for Adafruit ATWINC1500 Feather
// WiFi.setPins(chipSelect, irq, reset, enable)
WiFi.setPins(8,7,4);
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while (true);
}
// Print WiFi MAC address:
printMacAddress();
// scan for existing networks:
Serial.println("Scanning available networks...");
listNetworks();
}
void loop() {
delay(10000);
// scan for existing networks:
Serial.println("Scanning available networks...");
listNetworks();
}
void printMacAddress() {
// the MAC address of your WiFi shield
byte mac[6];
// print your MAC address:
WiFi.macAddress(mac);
Serial.print("MAC: ");
printMacAddress(mac);
}
void listNetworks() {
// scan for nearby networks:
Serial.println("** Scan Networks **");
int numSsid = WiFi.scanNetworks();
if (numSsid == -1)
{
Serial.println("Couldn't get a wifi connection");
while (true);
}
// print the list of networks seen:
Serial.print("number of available networks:");
Serial.println(numSsid);
// print the network number and name for each network found:
for (int thisNet = 0; thisNet < numSsid; thisNet++) {
Serial.print(thisNet);
Serial.print(") ");
Serial.print(WiFi.SSID(thisNet));
Serial.print("\tSignal: ");
Serial.print(WiFi.RSSI(thisNet));
Serial.print(" dBm");
Serial.print("\tEncryption: ");
printEncryptionType(WiFi.encryptionType(thisNet));
Serial.flush();
}
}
void printEncryptionType(int thisType) {
// read the encryption type and print out the name:
switch (thisType) {
case ENC_TYPE_WEP:
Serial.println("WEP");
break;
case ENC_TYPE_TKIP:
Serial.println("WPA");
break;
case ENC_TYPE_CCMP:
Serial.println("WPA2");
break;
case ENC_TYPE_NONE:
Serial.println("None");
break;
case ENC_TYPE_AUTO:
Serial.println("Auto");
break;
}
}
void printMacAddress(byte mac[]) {
for (int i = 5; i >= 0; i--) {
if (mac[i] < 16) {
Serial.print("0");
}
Serial.print(mac[i], HEX);
if (i > 0) {
Serial.print(":");
}
}
Serial.println();
}
here's the third ConnectWithWPA:
Code:
/*
This example connects to an unencrypted WiFi network.
Then it prints the MAC address of the WiFi shield,
the IP address obtained, and other network details.
Circuit:
* WiFi shield attached
created 13 July 2010
by dlf (Metodo2 srl)
modified 31 May 2012
by Tom Igoe
*/
#include <SPI.h>
#include <WiFi101.h>
#include "arduino_secrets.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID; // your network SSID (name)
char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS; // the WiFi radio's status
void setup() {
//Initialize serial and wait for port to open:
// ref: https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/using-the-wifi-module
//Configure pins for Adafruit ATWINC1500 Feather
// WiFi.setPins(chipSelect, irq, reset, enable)
WiFi.setPins(8,7,4);
//Initialize serial and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Serial opened!");
Serial.print( "wifi status: " );
Serial.println( WiFi.status() );
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while( true );
}
Serial.println("WiFiShield presence test: passed!");
delay(5000);
// attempt to connect to WiFi network:
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network:
status = WiFi.begin(ssid, pass);
// wait 10 seconds for connection:
delay(10000);
}
// you're connected now, so print out the data:
Serial.print("You're connected to the network");
printCurrentNet();
printWiFiData();
}
void loop() {
// check the network connection once every 10 seconds:
delay(10000);
printCurrentNet();
}
void printWiFiData() {
// print your WiFi shield's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
Serial.println(ip);
// print your MAC address:
byte mac[6];
WiFi.macAddress(mac);
Serial.print("MAC address: ");
printMacAddress(mac);
}
void printCurrentNet() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print the MAC address of the router you're attached to:
byte bssid[6];
WiFi.BSSID(bssid);
Serial.print("BSSID: ");
printMacAddress(bssid);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.println(rssi);
// print the encryption type:
byte encryption = WiFi.encryptionType();
Serial.print("Encryption Type:");
Serial.println(encryption, HEX);
Serial.println();
}
void printMacAddress(byte mac[]) {
for (int i = 5; i >= 0; i--) {
if (mac[i] < 16) {
Serial.print("0");
}
Serial.print(mac[i], HEX);
if (i > 0) {
Serial.print(":");
}
}
Serial.println();
}
Last edited: