Call to arms | Teensy + WiFi = true

Lmk your thoughts! Thanks!

Is the 1DX module power consumption always low enough to run from Teensy's 3.3V output? When I looked at the 1XK module almost 1 year ago, I was worried it might need more current than Teensy 4.1 can provide, especially if also powering a SD card and/or ethernet.

You might consider connecting the UART signals to Serial8. Looks like they're currently connected to Serial3, which should work but those Serial3 pins have other functions that are highly desired for many projects. Serial7 and Serial8 have the least overlap with other commonly used features.

One downside of using other hardware serial ports is the need to invert the module's UART RTS output before connecting to Teensy's CTS input, because the other serial ports only have CTS input through XBAR. Inverted CTS polarity when using any of the XBAR pins is documented on the Hardware Serial Ports page.
 
For me, I would probably use it in one of the simple boards @Paul has made in the past, like:
To be honest I love those little boards - am constituently using them along with one of the original break out boards I designed as well a Pauls' micromod board (which I have to figure out how to repair the usb connector on)
1781346061312.jpeg


EDIT: I think Paul pushed the small adapter board to OSH Park years ago?
 
I missed all these updates, been running around all kinds of places the past week.

I am sooo happy to see that the project is alive and well. This is really engaging the people of this community.

Absolutely wild, great work everyone! :love:
 
If anybody is interested in playing, I have gone through the QNEthernet_WIFI library and cleaned it up. This is just until @shawn decides if and when he is going to do his updated API.
This is a list of the major changes:
Code:
- Converted all files to C++.
- Completely reworked the ping API and sketch.
- Added a print debug switch to enable or disable printing debug information during initialization. Will be expanded later.
- Moved "secrets.h" file to "QNEthernet_WiFI/src/secrets.h". @defragster.
- Added guards against trying to use the default SSID and password in "QNEthernet_WiFI/src/secrets.h". Will throw a descriptive error.
- Removed some unused code.
- Updated "cyw43_scan.ino". Still needs work for intermittent failures.

This is most of the major changes to the library. There were also some minor bug fixes. Most of the work went into updating the ping portion of the library. Next task is to tackle the intermittent problem with the scan sketch.
Everything seems to work still including the original Ethernet library sketches which I adapted to WIFI use and can be found here.
I created a separate branch in QNEthernet_WIFI for the updated library found here...
 
Reworked the WIFI scan API. It no longer hangs up intermittently. It now uses an event handler that fires a scan callback when it recognizes a scan result packet. The event handler still needs to be polled but the results are much more stable than straight polling without using an event handler for scanning. Use the "QNEthernet_WIFI_Clean_Up" link below :
https://github.com/wwatson4506/QNEthernet_WIFI/tree/QNEthernet_WIFI_Clean_Up

I still want display the security type (WEP, WPA, WPA2 etc...) but am having a tough time finding it in the scan results. Still searching for more info on it. I'll add that in when I find where it is in the return info or if I need to initialize the scan differently...
 
Apologies for my delay, I had another project taking up all of my time for the last couple weeks, but I'm working on this again!

I've updated the design based on feedback here, and polished it up. Please let me know what you think! We'll do an internal review as well, and likely order prototypes next week (barring any other projects hogging all my attention).

Changes:
  • Switch from Serial3 to Serial8
  • Add inverter for CTS, since it's routing through XBAR
  • Extend the board length and move the antenna to "hang off the edge" (past the edge of a stacked Teensy 4.1)
    • To mitigate concerns about antenna interaction with the SD card slot, and give proper clearance for other PTH pads
  • Add 3.3V regulator
    • The 1YN datasheet says it can consume up to 370mA max, more than the 250mA limit of Teensy 4.1's 3.3V output
  • Add hole centered on Teensy 4.1 button so it can be pressed if stacked above
  • Connect BT_WAKE_D and move all control signals to pins 28-32 to mitigate pin conflicts with other boards
  • Antenna and SDIO traces are now routed with 50 Ohm impedance, and SDIO traces are length matched
    • Technically, I should account for length mismatch on Teensy 4.1, but I don't know what the trace lengths are
  • Add silkscreen labels and artwork
1782927180265.png

1782927189987.png

1782928395475.png

1782927238791.png


How Would I mount this? Above or below the Teensy?

Access to the USB Host pins? Other through hole pins on Teensy?
SDCard?

That is suppose I wish to use this with an Audio board (mostly likely not be) and have USB Host pins as well as access to SD slot

I'm now thinking it would be best to either stack the shield below the Teensy 4.1, or use a board like the ones @KurtE posted here. That gives the best physical access to everything on the Teensy 4.1. If you need to stack it on top for any reason, access to stuff like the USB host and Ethernet pins will be affected, but there's not a lot that I can do about that unfortunately.

To continue this line of questioning, @sparkfro, I'd likely be attaching an OctoWS2811 board too. How would this fit in there?

I took a closer look at the pinout of the OctoWS2811, and I think it should be usable, but with some limitations:
  • The OctoWS2811 uses pins 2 and 5 for LED strips #1 and #8, but the wireless shield uses those pins for the Bluetooth audio (PCM_IN and PCM_OUT), so take caution there.
  • The OctoWS2811 connects pins 17, 22, and 23 to the 2x7 header pads, but the wireless shield uses those for SDIO (D2, CMD, and CLK), so don't connect anything to those pins on the 2x7 header.
  • The OctoWS2811 ties pins 15 and 16 together, but the wireless shield uses pin 16 for SDIO_D3. I don't think it will be an issue because pin 15 is unused, but just something to be aware of.
 
Thanks for that, @sparkfro. In addition to the pinout, I'm just wondering how everything would physically fit together with an OctoWS2811. For example, how would we physically connect the pins? Does it need another stack? How many double-high pins do I need? Etc.

Would you mind trying physically fitting things together on your end? I'm trying to avoid screwing a board up. My electronics assembly skills are likely not as good as yours.
 
Last edited:
Looks good :D I see the slight change to the pinouts so once it is tested and confirmed I will add this pinout to the documentation. I have one of Paul's three tier breakout boards and I agree with you that is probably the best thing to use, at least for testing purposes. I am just now finishing up reworking and adding WIFI encryption type (WEP, WPA etc...) decoding to the WIFI scan functions. Am I correct in assuming that we are using the CYW43439 1YN chip?

if so we (I) need to start hunting down examples of the firmware to use for that chip...
 
@sparkfro - design looks absolutely amazing. Can't wait. I did find that I had ordered some of those 3by board from OSHPark. Think @PaulStoffregen had posted them somewhere since they are his designs. But can't find them right now. Maybe can be shared with the community.
 
@sparkfro

A couple of questions
1. I don't see where the antenna connection is or is that by design.
2. Why is there a usb connector showing or is that just a leftover
 
Thanks for that, @sparkfro. In addition to the pinout, I'm just wondering how everything would physically fit together with an OctoWS2811. For example, how would we physically connect the pins? Does it need another stack? How many double-high pins do I need? Etc.

Would you mind trying physically fitting things together on your end? I'm trying to avoid screwing a board up. My electronics assembly skills are likely not as good as yours.

It will need some combination of headers. I'll admit that I haven't yet thought through exactly what combination would be best, but it's definitely doable, so I'm putting that off until I get prototypes in hand. Can share what I put together once I have it!

@sparkfro - design looks absolutely amazing. Can't wait. I did find that I had ordered some of those 3by board from OSHPark. Think @PaulStoffregen had posted them somewhere since they are his designs. But can't find them right now. Maybe can be shared with the community.

I can pass on a request for us to make and sell a board like that! If anyone can find the original design, would appreciate a link!

Am I correct in assuming that we are using the CYW43439 1YN chip?

Correct! The 1DX is NRND, the 1YN is the latest from Murata.

@sparkfro

A couple of questions
1. I don't see where the antenna connection is or is that by design.
2. Why is there a usb connector showing or is that just a leftover

  1. The board uses a PCB trace antenna that sits at the bottom edge. See below, I've highlighted the RF path for clarity.
  2. It's just silkscreen to help users determine board orientation. "Align the Teensy 4.1's USB connector with that end of the shield!" Same with the circles indicating the Ethernet headers, "it goes on that side!"
1782943999196.png
 
Maybe @gigapod might be interested?

Design-wise, it's only 10 sockets, 2 headers, and 3 QWIIC connectors. But for soldering, something needs to be in those sockets to hold them straight. Every time I've hand soldered these boards, I put a pair of long header pins into both sides of all the sockets.

The laser cut base has 5 tapped holes. If SparkFun sold a similar base, maybe they'd opt for different hardware? The weight of a ~5 mm thick acrylic base and 4 rubber feet really adds a convenience factor of keeping stuff from moving around while testing hardware.
... for some reason I missed this, even though Paul mentioned me .... I'll have to look at my messaging settings ...

Yes - this looks to be an pretty handy board and would be very interesting for us to explore. I'll have someone take a look - are the design files available publicly? If not, we can work with Paul.

I'm sure we could find some good options for the based from our supplier network. I can see it being very helpful!

-Kirk
 
It will need some combination of headers. I'll admit that I haven't yet thought through exactly what combination would be best, but it's definitely doable, so I'm putting that off until I get prototypes in hand. Can share what I put together once I have it!

Great! Lighting controls is my main use case, currently.

Correct! The 1DX is NRND, the 1YN is the latest from Murata.

@sparkfro I ran into a wall when trying to find information from Infineon about the raw protocol of the CYW43439 1YN. Eg. A user guide or a protocol document, etc. (But not a datasheet, because that usually just has electrical specs and such, and usually not protocol information.)

Given that you're going to be the one purchasing these, probably in quantity, and given that SparkFun has more clout than I do, do you think you could inquire about this kind of document from them?

If you're unsuccessful, I can likely glean most of the information I need from their published software drivers.
 
  1. The board uses a PCB trace antenna that sits at the bottom edge. See below, I've highlighted the RF path for clarity.
  2. It's just silkscreen to help users determine board orientation. "Align the Teensy 4.1's USB connector with that end of the shield!" Same with the circles indicating the Ethernet headers, "it goes on that side!"
Ah that explains it. My eyes aint as good as they use to be - re the antenna,. Now it all makes sense.
 
Code:
CPU speed: 600 MHz
initialization done
MAC address - 70:87:A7:10:64:B5
Setup complete

====== STARTING SCAN ======

Scan Entries = 18

**********************************************************************************************
* #          SSID                             RSSI   Channel       BSSID          Security   *
**********************************************************************************************
  1    catscats2                             -73 dBm    1    10:E1:77:00:FD:D6    WPA2   (4)
  2    TP-Link_Guest_0DAC                    -87 dBm    2    1E:61:B4:1A:0D:AB    WPA2   (4)
  3    duckyscastle                          -73 dBm   11    1E:9E:CC:50:D8:88    WPA2   (4)
  4    Verizon_XT67W4                        -79 dBm    8    24:41:FE:27:44:D6    WPA2   (4)
  5    wswn_eero                             -27 dBm   11    30:29:2B:AB:CF:05    WPA2   (4)
  6    CasaGirlypop                          -84 dBm    1    38:3F:B3:39:6A:16    WPA2   (4)
  7    wswn_xf                               -21 dBm   11    62:9C:8E:18:A0:9B    WPA2   (4)
  8    TheCatDen                             -82 dBm    6    6C:5A:B0:16:E4:F2    AUTO   (6)
  9    Hen House                             -76 dBm    6    72:13:01:3F:C3:11    AUTO   (8)
 10    watch out when IP                     -77 dBm    8    74:FE:CE:13:0D:8B    WPA2   (4)
 11    Tree House                            -90 dBm    1    98:F7:81:41:DC:45    WPA2   (4)
 12    cozypoohma                            -96 dBm    1    A8:70:5D:68:A5:F3    WPA2   (4)
 13    ryanwifi                              -77 dBm   11    BC:9B:68:0C:FA:93    WPA2   (4)
 14    Phoeberella2.4                        -93 dBm    6    C0:56:27:34:33:E7    AUTO   (6)
 15    wswn_xf                               -48 dBm   11    C6:4F:D5:C9:74:A9    AUTO   (8)
 16    June Bug                              -84 dBm    6    D4:AB:82:C4:03:6F    WPA2   (4)
 17    TMOBILE-6B66                          -87 dBm    6    DC:8D:8A:DB:6B:6F    AUTO   (8)
 18    DIRECT-pq-EPSON-XP-6100 Series        -39 dBm   11    DE:CD:2F:CF:6B:16    WPA2   (4)
Scan complete

Finished decoding and displaying the security encryption types. It is a pretty hefty learning curve. I just needed to find the site security type and map that to one of 8 simple display types (NONE, WEP, WPA2, WPA3 etc...). First step is finding the RSN ((Robust Security Network ) in the IE (Information Element) section of the scan results data section. It starts with an Element ID that is normally number 48.
This is the RSN protocol. There is an error in the image that messed me up at first till I noticed that "Version" is 2 bytes instead of the indicated one byte:
cwsp-rsn-5.png

We need to move to the "Authentication Suite Count", record that as it tells us how many "Authentication Suite" (AKM) sections that are used. The last byte in the 4 byte group (00-0F-AC-xx) is what we use to determine the security type. Usually 1 or 2 AKM's based on the "Authentication Suite Count". There are several combinations of these AKM values that are used to determine the many types of encryption that can be used. The ones we are using are:
Code:
// For determining security type from a scan
#define DOT11_CAP_PRIVACY             (0x0010) -----> Found in BSS.info.capabilites
#define DOT11_IE_ID_RSN               (48)
#define DOT11_IE_ID_VENDOR_SPECIFIC   (221) -----> Special Case
#define WPA_OUI_TYPE1                 "\x00\x50\xF2\x01"  --> WPA1 Vendor OUI: 00:50:F2 with Type 1

// Custom security bitfield returns
#define SEC_OPEN   0        // 0
#define SEC_WEP    (1 << 0) // 1
#define SEC_WPA    (1 << 1) // 2
#define SEC_WPA2   (1 << 2) // 4
#define SEC_WPA3   (1 << 3) // 8
// Some combinations of these like WPA/WPA2 (6) and WPA2/WPA3 (8) are shown as "AUTO" in the displayed scan results.

Here is a small list of some security types and combinational types:
Code:
0x00 / 0: CYW43_AUTH_OPEN (Open / No security)
0x01 / 1: CYW43_AUTH_WEP (WEP)
0x02 / 2: CYW43_AUTH_WPA_TKIP_PSK or WPA_MIXED_PSK
0x03 / 3: CYW43_AUTH_WPA2_AES_PSK (WPA2 Personal)
0x04 / 4: CYW43_AUTH_WPA2_MIXED_PSK (WPA/WPA2 Mixed)
0x05 / 5: CYW43_AUTH_WPA2_ENTERPRISE (WPA2 Enterprise)
0x06 / 6: CYW43_AUTH_WPA3_PSK (WPA3 Personal)
Lastly, I setup a function to sort the scan results by BSSID (MAC address), remove any duplicate scan entries and updated the scan entry display function. The updated QNEthernet_WIFI library is found at https://github.com/wwatson4506/QNEthernet_WIFI/tree/QNEthernet_WIFI_Clean_Up.
There is more cleanup to do but for now I am going to concentrate on finding info on the CYW43439 (1YN) chip...
 
Nice update! Scan completes with added detail and cleanup and ReCan works without hang!

Code:
CPU speed: 600 MHz
initialization done
MAC address - 70:87:A7:11:98:A5
Setup complete


====== STARTING SCAN ======

Scan Entries = 7

**********************************************************************************************
* #       SSID                               RSSI   Channel        BSSID          Security   *
**********************************************************************************************
  1    TP-Link_DBFE                          -86 dBm    6    78:20:51:71:4F:19    AUTO   (8)
  2    FiberEagle                            -27 dBm    9    E0:C2:50:27:8B:60    AUTO   (8)
  3    FiberEagle                            -60 dBm    9    E0:C2:50:28:99:48    AUTO   (8)
  4    NTGRBH_E0C250278B62                   -25 dBm    9    E6:C2:50:27:8B:60    AUTO   (8)
  5    NTGRBH_E0C250278B62                   -65 dBm    9    E6:C2:50:28:99:48    AUTO   (8)
  6    FiberEagle-Guest                      -29 dBm    9    EA:C2:50:27:8B:60    AUTO   (8)
  7    FiberEagle-Guest                      -65 dBm    9    EA:C2:50:28:99:48    AUTO   (8)
Scan complete
Press any key to continue...


====== STARTING SCAN ======

Scan Entries = 7

**********************************************************************************************
* #       SSID                               RSSI   Channel        BSSID          Security   *
**********************************************************************************************
  1    TP-Link_DBFE                          -86 dBm    6    78:20:51:71:4F:19    AUTO   (8)
  2    FiberEagle                            -26 dBm    9    E0:C2:50:27:8B:60    AUTO   (8)
  3    FiberEagle                            -62 dBm    9    E0:C2:50:28:99:48    AUTO   (8)
  4    NTGRBH_E0C250278B62                   -26 dBm    9    E6:C2:50:27:8B:60    AUTO   (8)
  5    NTGRBH_E0C250278B62                   -67 dBm    9    E6:C2:50:28:99:48    AUTO   (8)
  6    FiberEagle-Guest                      -26 dBm    9    EA:C2:50:27:8B:60    AUTO   (8)
  7    FiberEagle-Guest                      -64 dBm    9    EA:C2:50:28:99:48    AUTO   (8)
Scan complete
 
@defragster - You probably noticed that there are duplicate SSID's (site names) but if you look at the MAC address's for that site they are different. I guess you say they accommodate multiple protocols. It was interesting researching the security encryption types:D

EDIT: I let the scan run continuously for 48 hours without any hangs at all...
 
Great! Lighting controls is my main use case, currently.



@sparkfro I ran into a wall when trying to find information from Infineon about the raw protocol of the CYW43439 1YN. Eg. A user guide or a protocol document, etc. (But not a datasheet, because that usually just has electrical specs and such, and usually not protocol information.)

Given that you're going to be the one purchasing these, probably in quantity, and given that SparkFun has more clout than I do, do you think you could inquire about this kind of document from them?

If you're unsuccessful, I can likely glean most of the information I need from their published software drivers.

I can try to reach out. Heads up that vendors often lock this info behind NDAs, so can't make any promises.
 
Back
Top