Adding WiFi to Teensy 3.x

Status
Not open for further replies.
Yes, that is correct, It hands on WiFi.scanNetworks() which is my first interaction at startup.

I do not find this to be so unusual, as I use several Arduino/Teensy hardware based libraries that will hang if the corresponding hardware is not connected.

Richard
 
it is unusual and could be critical if your doing greenhouse or any other important tasks and the winc1500 decides to fail, leaving your controls in a complete lockup and can cause flooding or any other type of behaviour in critial projects.

that and not everybody knows the winc1500 lockup issue, they would think the mcu is dead and debug trying to find the issue
 
Hi,

I'm new to the whole Teensy world but had a few other devices I tried before, but as the Teensy 3.6 provides everything I need I want to get it running.
Currently I'm in the same situation as some of you and want to get the Adafruit ATWINC1500 Breakout Board running.

Reading through the previous posts, I connected it and got it "up and running", but once I try to send data via UDP nothing reaches the server.
So I explain a little bit more in detail.

Why do I assume it's "up and running":
- I can read the firmware version (19.4.4)
- I can connect to my Wifi
- I get an IP address
- My router says it's connected
- WiFi LED is constantly green, Net LED is blinking when sending data (strangly the Teensy LED also blinks with the same frequency)

How is it connected:
Code:
#include <SPI.h>
#include <Adafruit_WINC1500.h>
#include <Adafruit_WINC1500Udp.h>

#define WINC_CS 10
#define WINC_IRQ 9
#define WINC_RST 8
#define WINC_MOSI0 11
#define WINC_MISO0 12
#define WINC_SCK0 13
#define WINC_EN 15

SPI.setSCK(WINC_SCK0);
SPI.setMOSI(WINC_MOSI0);
SPI.setMISO(WINC_MISO0);
SPI.setCS(WINC_CS);
pinMode(WINC_CS, OUTPUT);
digitalWrite(WINC_CS, HIGH);
SPI.begin();
  
#ifdef WINC_EN
  pinMode(WINC_EN, OUTPUT);
  digitalWrite(WINC_EN, HIGH);
#endif

How do I try to send data:
Code:
if (Udp.beginPacket(serverIp, port) == 1) {
    Udp.write("Foo");
    int result = Udp.endPacket();
    if(result != -1) {
      debugLog("Sent packet");   ///It's reaching this point, but no data are received on server side....
    }else {
      debugLog(String(result));
    }
} else {
    debugLog("BeginPacket failed");
}

Why is it not a server-side problem?
- Because I have a Feather M0 ATWINC1500 running the same code without any problems.
- Because I have an iPhone App sending the same data to the same server without any problems.
- Because Wireshark on the server does not log any data when trying to send from the Teensy (iPhone & Feather Wireshark logs data)

What else did I try?
- I tried replacing "SPI.begin()" with "SPI.beginTransaction(SPISettings(12000000, MSBFIRST, SPI_MODE0))" ==> Nothing works at all
- I tried using the Wifi101 samples without any luck


So...anyone any other ideas :)
 
Are you instantiating?

Adafruit_WINC1500 WiFi(WINC_CS, WINC_IRQ, WINC_RST);

After your Udp.write() I do not see a
Udp.endPacket();

Richard
 
Are you instantiating?

Adafruit_WINC1500 WiFi(WINC_CS, WINC_IRQ, WINC_RST);

After your Udp.write() I do not see a
Udp.endPacket();

Richard

Hi,

don't know what you mean by instantiating? Do you have sample what you mean as "Adafruit_WINC1500 WiFi(WINC_CS, WINC_IRQ, WINC_RST);" is basically calling the constructor as far as I understand.
For the "missing" Udp.endPacket(), have a look at my code sample it's right the next line after Udp.write...
 
Ok, got a little further. I adapted the Adafruit library that it returns the error code from "sendto" in "endPacket".
And now I'm getting -6 which means "An invalid argument is passed to a function." (SOCK_ERR_INVALID_ARG)

http://asf.atmel.com/docs/latest/samd21/html/group___socket_error_code.html#ga3d22d700a5ecefd5027c0f3c923ee095

Ok, found my problem - my own stupid mistake :)
I forgot "Udp.begin", which led to the state that no socket was opened and this then caused that nothing could be sent.
 
Hello,
I also attempted to hook up an Adafruit WINC1500 to Teensy 3.6 using the following pins:
CS0= 10
MOSI0 = 11
MISO0 = 12
SCK0 = 13
IRQ = 34
RST = 33
Vin set to the 3.3 V on the Teensy board, with EN tied to Vin.
I'm using SPI and WiFi 101 with the WiFi.setPins (10, 34, 33);
I know WINC1500 board works as I have used it with the Arduino Mega with no issues.
I have attempted to check firmware and run simple example sketches to no avail.
Any help would be appreciated. Thanks.

search the threads, Came across this as I'm thinking of doing the same, did you ever get this working ?
 
Status
Not open for further replies.
Back
Top