Call to arms | Teensy + WiFi = true

I have now gone 21 days without water. My Camel died days ago after I was forced to drink it's last water to stay alive. But I keep my hopes up. Paul shall arrive soon with a truck full of fresh water. He might even bring me a new Camel if I'm lucky.
#inTheDesert

Day 18. A truck drove by, emblazoned on the side with a big Q.

I refuse to go to the dark side, even if it means rescue....
 
Decided to quit staring at the @Dogbone06 WIFI adapter that had been sitting on one of my desks for months and at least try to get most or all of the picowi documentation example working with the T4.1. After months of learning and experimenting I have a completely rewritten CYW4343W_T4 library that has most all of the picowi examples working. It no longer feels like a wasted effort. Those with the hardware, if you can, please test. This is the REPO.

Will explain more tomorrow:sneaky:
 
REPO and picowi-main (indicated on READ.me) copied to sketchbook\libraries

Need to check my pin wiring ... so long ago ... From the TOP down I see this PIN order:
Code:
INT (34)    WL_ON (33)
CMD (22)    CLK (23)
D0 (40)        D2 (17)
D1 (41)        D3 (16)
GND            3.3v

IDE1 doesn't like this? IGNORE: This is the @wwatson SOURCE - not needed
Code:
Invalid library found in T:\T_Drive\tCode\libraries\picowi-main: no headers files (.h) found in T:\T_Drive\tCode\libraries\picowi-main

"...\libraries\T4_WIFI_CYW4343W\examples\WiFi_scan_T4\WiFi_scan_T4.ino"

REMOVED: MISSING/BAD WIRES
 
Last edited:
Rewired (4 inch jumpers to T_4.1): secrets should be right?
example WiFi_scan_T4 : on GUEST network without many online
Code:
CPU speed: 600 MHz
===========================
CYW4343W Card::begin: SDIO2
===========================
Attaching OOB interrupt to pin 34
Enabled CYW4343W bus high speed interface
BUS_IORDY_REG (Ready indication) returned OK
SDHC bus set to 4-bit, speed set to 33MHz
*************
CardID: 43430
*************
Set SRAM_IOCTRL_REG validated
Set SRAM_IOCTRL_REG second validation
Set SRAM_RESETCTRL_REG validated
Uploading firmware data
Uploaded firmware, 419798 of 419798 bytes
Uploading NVRAM data
Uploaded NVRAM, 680 of 680 bytes
Set BAK_CHIP_CLOCK_CSR_REG validated
Set BUS_IORDY_REG validated
Configuring WL_IRQ OOB
==============================
End W4343WCard::begin: SDIO2
==============================
Uploading CLM, size: 7222
CLM uploaded 7222/7222 result: 1
CLM version API: 12.2
Data: 9.10.39
Compiler: 1.29.4
ClmImport: 1.36.3
Creation: 2020-02-16 22:32:13

initialization done
MAC address - 70:87:A7:11:98:A5
Firmware wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

Setup complete

Setting scan channel time

WiFi CPU running

Events enabled

Set data escan
BSSID - C8:99:B2:ED:57:4B  |  Signal:  -94 dBm  |  Channel #3  |  SSID: 'TMOBILE-5749'
BSSID - A4:40:3D:00:36:7C  |  Signal:  -90 dBm  |  Channel #1  |  SSID: '[hidden]'
Number of scan entries: 2, Unfiltered scan (duplicate and hidden entries shown!)
Wait for next scan...

Setting scan channel time
None matching request: cmd.flags: 34672, ioctl_reqid: 30
 
Last edited:
Running PING_T4 :
Code:
CPU speed: 600 MHz
===========================
CYW4343W Card::begin: SDIO2
===========================
Attaching OOB interrupt to pin 34
Enabled CYW4343W bus high speed interface
BUS_IORDY_REG (Ready indication) returned OK
SDHC bus set to 4-bit, speed set to 33MHz
*************
CardID: 43430
*************
Set SRAM_IOCTRL_REG validated
Set SRAM_IOCTRL_REG second validation
Set SRAM_RESETCTRL_REG validated
Uploading firmware data
Uploaded firmware, 419798 of 419798 bytes
Uploading NVRAM data
Uploaded NVRAM, 680 of 680 bytes
Set BAK_CHIP_CLOCK_CSR_REG validated
Set BUS_IORDY_REG validated
Configuring WL_IRQ OOB
==============================
End W4343WCard::begin: SDIO2
==============================
Uploading CLM, size: 7222
CLM uploaded 7222/7222 result: 1
CLM version API: 12.2
Data: 9.10.39
Compiler: 1.29.4
ClmImport: 1.36.3
Creation: 2020-02-16 22:32:13

initialization done
MAC address - 70:87:A7:11:98:A5
Firmware wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

Setup complete
In joinNetworks
WiFi CPU running
Set country succesfully
Join events enabled
Joining network FiberEagle-Guest

0.000 len=60 seq=30 chan=01 hdrlen=0E flow=00 credit=40
60009fff3001000e00400000
dest=7087A71198A5 srce=7287A71198A5 type=886C sub=8001 len=38 oui=1018 usr=01
ver=02 flags=00 type=03 status=00 reason=00 auth=00 dlen=00 addr=EAC250278B60 AUTH SUCCESS
000020000001000100007087a71198a57287a71198a5886c8001003800001018
0001000200000000000300000000000000000000000000000000eac250278b60
776c300000000000000000000000000000000000

0.000 len=7A seq=31 chan=01 hdrlen=0E flow=00 credit=40
7a0085ff3101000e00400000
dest=7087A71198A5 srce=7287A71198A5 type=886C sub=8001 len=52 oui=1018 usr=01
ver=02 flags=01 type=10 status=00 reason=00 auth=00 dlen=1A addr=EAC250278B60 LINK SUCCESS
000020000001000100007087a71198a57287a71198a5886c8001005200001018
000100020001000000100000000000000000000000000000001aeac250278b60
776c3000000000000000000000000000000030180100000fac040100000fac04
0200000fac02000fac088c000000

0.000 len=60 seq=32 chan=01 hdrlen=0E flow=00 credit=40
60009fff3201000e00400000
dest=7087A71198A5 srce=7287A71198A5 type=886C sub=8001 len=38 oui=1018 usr=01
ver=02 flags=00 type=2E status=06 reason=00 auth=00 dlen=00 addr=000030010000 PSK_SUP UNSOLICITED
000020000001000100007087a71198a57287a71198a5886c8001003800001018
0001000200000000002e00000006000000000000000000000000000030010000
776c300000000000000000000000000000000000

********************* LINK Established *********************

********************* Joined Network ***********************


0.000 len=70 seq=33 chan=01 hdrlen=0E flow=00 credit=40
70008fff3301000e00400000
dest=7087A71198A5 srce=7287A71198A5 type=886C sub=8001 len=48 oui=1018 usr=01
ver=02 flags=00 type=00 status=00 reason=00 auth=00 dlen=10 addr=EAC250278B60 SET_SSID SUCCESS
000020000001000100007087a71198a57287a71198a5886c8001004800001018
0001000200000000000000000000000000000000000000000010eac250278b60
776c3000000000000000000000000000000046696265724561676c652d477565
73740000
ARP timeout
ARP timeout
ARP timeout
 
Last edited:
Running WiFi_join_T4: - but router not showing connected device
And added output from : USE_ACTIVITY_DISPLAY true:
Code:
CYW4343W JOIN NETWORK v1.00
CPU speed: 600 MHz
===========================
CYW4343W Card::begin: SDIO2
===========================
Attaching OOB interrupt to pin 34
Enabled CYW4343W bus high speed interface
BUS_IORDY_REG (Ready indication) returned OK
SDHC bus set to 4-bit, speed set to 33MHz
*************
CardID: 43430
*************
Set SRAM_IOCTRL_REG validated
Set SRAM_IOCTRL_REG second validation
Set SRAM_RESETCTRL_REG validated
Uploading firmware data
Uploaded firmware, 419798 of 419798 bytes
Uploading NVRAM data
Uploaded NVRAM, 680 of 680 bytes
Set BAK_CHIP_CLOCK_CSR_REG validated
Set BUS_IORDY_REG validated
Configuring WL_IRQ OOB
==============================
End W4343WCard::begin: SDIO2
==============================
Uploading CLM, size: 7222
CLM uploaded 7222/7222 result: 1
CLM version API: 12.2
Data: 9.10.39
Compiler: 1.29.4
ClmImport: 1.36.3
Creation: 2020-02-16 22:32:13

Initialization Done
MAC address - 70:87:A7:11:98:A5
Firmware wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

Setup complete
To display network activity after network is joined,
set '#define USE_ACTIVITY_DISPLAY false' to true in
the file 'misc_defs.h'.
This can display a pretty heavy spew of information.
Especially when we are being ARP'ed by the host machine and/or multicast is enabled.
The host machine will ARP us approximately every 5 minutes or so.
You will need to set your SSID and passphrase in the
'secrets.h' file located in the src folder.
Press anykey to join network...
In joinNetworks
WiFi CPU running
Set country succesfully
Join events enabled
Joining network FiberEagle-Guest

0.000 len=60 seq=30 chan=01 hdrlen=0E flow=00 credit=40
60009fff3001000e00400000
dest=7087A71198A5 srce=7287A71198A5 type=886C sub=8001 len=38 oui=1018 usr=01
ver=02 flags=00 type=03 status=02 reason=00 auth=00 dlen=00 addr=EAC250278B60 AUTH TIMEOUT
000020000001000100007087a71198a57287a71198a5886c8001003800001018
0001000200000000000300000002000000000000000000000000eac250278b60
776c300000000000000000000000000000000000

0.000 len=60 seq=31 chan=01 hdrlen=0E flow=00 credit=40
60009fff3101000e00400000
dest=7087A71198A5 srce=7287A71198A5 type=886C sub=8001 len=38 oui=1018 usr=01
ver=02 flags=00 type=03 status=00 reason=00 auth=00 dlen=00 addr=EAC25028A779 AUTH SUCCESS
000020000001000100007087a71198a57287a71198a5886c8001003800001018
0001000200000000000300000000000000000000000000000000eac25028a779
776c300000000000000000000000000000000000

0.000 len=7A seq=32 chan=01 hdrlen=0E flow=00 credit=40
7a0085ff3201000e00400000
dest=7087A71198A5 srce=7287A71198A5 type=886C sub=8001 len=52 oui=1018 usr=01
ver=02 flags=01 type=10 status=00 reason=00 auth=00 dlen=1A addr=EAC25028A779 LINK SUCCESS
000020000001000100007087a71198a57287a71198a5886c8001005200001018
000100020001000000100000000000000000000000000000001aeac25028a779
776c3000000000000000000000000000000030180100000fac040100000fac04
0200000fac02000fac088c000000

0.000 len=60 seq=33 chan=01 hdrlen=0E flow=00 credit=40
60009fff3301000e00400000
dest=7087A71198A5 srce=7287A71198A5 type=886C sub=8001 len=38 oui=1018 usr=01
ver=02 flags=00 type=2E status=06 reason=00 auth=00 dlen=00 addr=000000000000 PSK_SUP UNSOLICITED
000020000001000100007087a71198a57287a71198a5886c8001003800001018
0001000200000000002e00000006000000000000000000000000000000000000
776c300000000000000000000000000000000000

********************* LINK Established *********************

********************* Joined Network ***********************


0.000 len=70 seq=34 chan=01 hdrlen=0E flow=00 credit=40
70008fff3401000e00400000
dest=7087A71198A5 srce=7287A71198A5 type=886C sub=8001 len=48 oui=1018 usr=01
ver=02 flags=00 type=00 status=00 reason=00 auth=00 dlen=10 addr=EAC25028A779 SET_SSID SUCCESS
000020000001000100007087a71198a57287a71198a5886c8001004800001018
0001000200000000000000000000000000000000000000000010eac25028a779
776c3000000000000000000000000000000046696265724561676c652d477565
73740000
 
Last edited:
Sorry about that. We had VT100 color formatting in the code for debugging. That's what you are seeing. For now just use a VT100 capable terminal program. I will remove all of the color formatting code when I get back from errands :)
 
Just comment out line 81 in misc_defs.h, and they'll not appear, no need for extensive code changes

Code:
#define USE_DEBUG_COLORS
 
extensive code changes
Some, there are a few of these that ERROR then:
event.cpp:158:22: error: 'SER_WHITE' was not declared in this scope

color formatting in the code for debugging
That would be nice - just tried two and they are lame - as they need to see the device before connect so startup is missed.
TyCommander so much better for Teensy usage - would be nice with VT100 support added
 
Thanks @beermat, Forgot about that one. I'll change it in the repo. I still need to to setup a debugging for all of the commented out debug printing.
As you probably noticed I moved a lot of code out of cyw43_T4_SDIO.cpp and cyw43_T4_SDIO.h into separate files. I was really getting lost trying to navigate all of the different strctures that are involved:confused: Anyway most all of the examples are working. Some of the timeouts may need to be tweaked in the sketches. those are located close to the top of the sketch. Something like:
Code:
#define EVENT_POLL_USEC     100000
#define PING_RESP_USEC      300000 <--- This one affects the ping sketch.
#define PING_DATA_SIZE      32
 
@defragster - I will check that out and then post examples of output of the examples...

edit: Fixed:
Code:
#define SER_RED ""
#define SER_GREEN ""
#define SER_YELLOW ""
#define SER_MAGENTA ""
#define SER_CYAN ""
#define SER_WHITE ""   <---- Added this missing line in misc_defs.h
#define SER_RESET ""
 
Last edited:
Some, there are a few of these that ERROR then:
event.cpp:158:22: error: 'SER_WHITE' was not declared in this scope


That would be nice - just tried two and they are lame - as they need to see the device before connect so startup is missed.
TyCommander so much better for Teensy usage - would be nice with VT100 support added
Must have added SER_WHITE to the colors and forgot to add it to the "blank" section

Colored messages make it so much easier to "scan" console logs, even simply making error logging red means you see it at a glance rather than hunting, and with color-coded messages for different classes, your brain can quickly tune into that and only "see" the one you want. I use VSCode / PlatformIO and the VSCode console and adding the line:

Code:
monitor_filters = direct

in platformio.ini turns on the serial color capability
 
Results for "WiFi_scan_T4.ino":
Code:
Set data escan
BSSID - 10:E1:77:00:FD:D6  |  Signal:  -70 dBm  |  Channel #1  |  SSID: 'catscats2'
BSSID - 0E:E1:77:00:FD:D6  |  Signal:  -71 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 16:E1:77:00:FD:D6  |  Signal:  -71 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 98:F7:81:41:DC:45  |  Signal:  -83 dBm  |  Channel #1  |  SSID: 'Tree House'
BSSID - 96:F7:81:41:DC:45  |  Signal:  -83 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 62:9C:8E:18:A0:99  |  Signal:  -23 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 62:9C:8E:18:A0:9B  |  Signal:  -23 dBm  |  Channel #1  |  SSID: 'wswn_xf'
BSSID - 62:9C:8E:18:A0:9E  |  Signal:  -24 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - DE:CD:2F:CF:6B:16  |  Signal:  -25 dBm  |  Channel #1  |  SSID: 'DIRECT-pq-EPSON-XP-6100 Series'
BSSID - 16:E1:77:00:FD:D6  |  Signal:  -71 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 62:9C:8E:18:A0:99  |  Signal:  -23 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 62:9C:8E:18:A0:9B  |  Signal:  -23 dBm  |  Channel #1  |  SSID: 'wswn_xf'
BSSID - 62:9C:8E:18:A0:9E  |  Signal:  -21 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 1C:61:B4:1A:0D:AB  |  Signal:  -85 dBm  |  Channel #2  |  SSID: 'Peaches'
BSSID - 1E:61:B4:1A:0D:AB  |  Signal:  -84 dBm  |  Channel #2  |  SSID: 'TP-Link_Guest_0DAC'
BSSID - 3E:61:B4:1A:0D:AB  |  Signal:  -82 dBm  |  Channel #2  |  SSID: '[hidden]'
BSSID - CE:6C:6D:5B:DB:B1  |  Signal:  -88 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 10:E1:77:00:FD:D6  |  Signal:  -76 dBm  |  Channel #1  |  SSID: 'catscats2'
BSSID - 0E:E1:77:00:FD:D6  |  Signal:  -82 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 16:E1:77:00:FD:D6  |  Signal:  -83 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 62:9C:8E:18:A0:99  |  Signal:  -26 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 62:9C:8E:18:A0:9B  |  Signal:  -27 dBm  |  Channel #1  |  SSID: 'wswn_xf'
BSSID - 84:C9:B2:61:45:4A  |  Signal:  -29 dBm  |  Channel #1  |  SSID: 'wswn'
BSSID - 62:9C:8E:18:A0:9E  |  Signal:  -28 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 3E:61:B4:1A:0D:AB  |  Signal:  -84 dBm  |  Channel #2  |  SSID: '[hidden]'
BSSID - 10:E1:77:00:FD:D6  |  Signal:  -74 dBm  |  Channel #1  |  SSID: 'catscats2'
BSSID - 0E:E1:77:00:FD:D6  |  Signal:  -81 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 16:E1:77:00:FD:D6  |  Signal:  -81 dBm  |  Channel #1  |  SSID: '[hidden]'
BSSID - 6E:5A:B0:26:E4:F2  |  Signal:  -82 dBm  |  Channel #6  |  SSID: '[hidden]'
BSSID - 1C:61:B4:1A:0D:AB  |  Signal:  -88 dBm  |  Channel #2  |  SSID: 'Peaches'
BSSID - 1E:61:B4:1A:0D:AB  |  Signal:  -84 dBm  |  Channel #2  |  SSID: 'TP-Link_Guest_0DAC'
BSSID - 3E:61:B4:1A:0D:AB  |  Signal:  -86 dBm  |  Channel #2  |  SSID: '[hidden]'
BSSID - 40:AE:30:A6:5F:C2  |  Signal:  -88 dBm  |  Channel #5  |  SSID: 'Family Wifi'
BSSID - C6:4F:D5:FB:53:79  |  Signal:  -93 dBm  |  Channel #6  |  SSID: 'EthicalDilemmaViaTheInternet'
BSSID - BC:9B:68:0C:FA:93  |  Signal:  -85 dBm  |  Channel #6  |  SSID: 'ryanwifi'
BSSID - BC:9B:68:0C:FA:98  |  Signal:  -85 dBm  |  Channel #6  |  SSID: '[hidden]'
BSSID - 72:13:01:3F:C3:11  |  Signal:  -76 dBm  |  Channel #6  |  SSID: 'Hen House'
BSSID - 72:13:01:3F:C3:16  |  Signal:  -76 dBm  |  Channel #6  |  SSID: '[hidden]'
BSSID - BC:9B:68:0C:FA:96  |  Signal:  -86 dBm  |  Channel #6  |  SSID: '[hidden]'
BSSID - 6C:5A:B0:16:E4:F2  |  Signal:  -82 dBm  |  Channel #6  |  SSID: 'TheCatDen'
BSSID - 6E:5A:B0:26:E4:F2  |  Signal:  -81 dBm  |  Channel #6  |  SSID: '[hidden]'
BSSID - 74:FE:CE:13:0D:8B  |  Signal:  -78 dBm  |  Channel #9  |  SSID: 'Bay Harbor Butcher'
BSSID - 76:FE:CE:23:0D:8B  |  Signal:  -78 dBm  |  Channel #9  |  SSID: '[hidden]'
BSSID - 94:A6:7E:1B:BB:0F  |  Signal:  -87 dBm  |  Channel #11 |  SSID: 'NETGEAR98'
BSSID - 6C:CD:D6:8E:63:CF  |  Signal:  -94 dBm  |  Channel #10 |  SSID: 'Chateau Pueget'
BSSID - 84:00:2D:4F:EE:78  |  Signal:  -91 dBm  |  Channel #11 |  SSID: 'thehillsarealive'
BSSID - 38:3F:B3:39:6A:16  |  Signal:  -87 dBm  |  Channel #11 |  SSID: 'CasaGirlypop'
BSSID - C6:4F:D5:C9:74:A9  |  Signal:  -47 dBm  |  Channel #11 |  SSID: 'wswn_xf'
BSSID - C6:4F:D5:C9:74:AE  |  Signal:  -48 dBm  |  Channel #11 |  SSID: '[hidden]'
BSSID - C6:4F:D5:C9:74:AF  |  Signal:  -45 dBm  |  Channel #11 |  SSID: '[hidden]'
BSSID - 94:A6:7E:1B:BB:0F  |  Signal:  -88 dBm  |  Channel #11 |  SSID: 'NETGEAR98'
BSSID - 38:3F:B3:39:6A:1C  |  Signal:  -89 dBm  |  Channel #11 |  SSID: '[hidden]'
BSSID - 92:00:2D:4F:EE:78  |  Signal:  -92 dBm  |  Channel #11 |  SSID: '[hidden]'
BSSID - 9A:00:2D:4F:EE:78  |  Signal:  -91 dBm  |  Channel #11 |  SSID: '[hidden]'
BSSID - BA:5E:71:4B:CF:0E  |  Signal:  -94 dBm  |  Channel #11 |  SSID: 'Home18b23'
Number of scan entries: 56, Unfiltered scan (duplicate and hidden entries shown!)
Wait for next scan...
This is an unfiltered scan in my area showing duplicate entries and hidden entries. Normally the scan wold not show duplicates or hidden entries.
I have added some more entries to the print out. The one I am still trying to find is the security entry. Probably buried in one of the many structures.

Results for "WiFi_join_T4.ino":
Code:
CYW4343W JOIN NETWORK v1.00
CPU speed: 600 MHz
===========================
CYW4343W Card::begin: SDIO2
===========================
Attaching OOB interrupt to pin 34
Enabled CYW4343W bus high speed interface
BUS_IORDY_REG (Ready indication) returned OK
SDHC bus set to 4-bit, speed set to 33MHz
*************
CardID: 43430
*************
Set SRAM_IOCTRL_REG validated
Set SRAM_IOCTRL_REG second validation
Set SRAM_RESETCTRL_REG validated
Uploading firmware data
Uploaded firmware, 419798 of 419798 bytes
Uploading NVRAM data
Uploaded NVRAM, 680 of 680 bytes
Set BAK_CHIP_CLOCK_CSR_REG validated
Set BUS_IORDY_REG validated
Configuring WL_IRQ OOB
==============================
End W4343WCard::begin: SDIO2
==============================
Uploading CLM, size: 7222
CLM uploaded 7222/7222 result: 1
CLM version API: 12.2
Data: 9.10.39
Compiler: 1.29.4
ClmImport: 1.36.3
Creation: 2020-02-16 22:32:13

Initialization Done
MAC address - 70:87:A7:10:64:B5
Firmware wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

Setup complete
To display network activity after network is joined,
set '#define USE_ACTIVITY_DISPLAY false' to true in
the file 'misc_defs.h'.
This can display a pretty heavy spew of information.
Especially when we are being ARP'ed by the host machine and/or multicast is enabled.
The host machine will ARP us approximately every 5 minutes or so.
You will need to set your SSID and passphrase in the
'secrets.h' file located in the src folder.
Press anykey to join network...
In joinNetworks
WiFi CPU running
Set country succesfully
Join events enabled
Joining network wswn

********************* LINK Established *********************

********************* Joined Network ***********************

This shows the ability to link to and join a local network. It establishes a link first using ARP functions then joins.
Setting "#define USE_ACTIVITY_DISPLAY" to true will display some debug activity showing the join process and then subsequent ARP activity from the router. And if multicast is is enabled that will show as well. Again a BIG spew of info.

Results for "ping_T4.ino":
Code:
CPU speed: 600 MHz
===========================
CYW4343W Card::begin: SDIO2
===========================
Attaching OOB interrupt to pin 34
Enabled CYW4343W bus high speed interface
BUS_IORDY_REG (Ready indication) returned OK
SDHC bus set to 4-bit, speed set to 33MHz
*************
CardID: 43430
*************
Set SRAM_IOCTRL_REG validated
Set SRAM_IOCTRL_REG second validation
Set SRAM_RESETCTRL_REG validated
Uploading firmware data
Uploaded firmware, 419798 of 419798 bytes
Uploading NVRAM data
Uploaded NVRAM, 680 of 680 bytes
Set BAK_CHIP_CLOCK_CSR_REG validated
Set BUS_IORDY_REG validated
Configuring WL_IRQ OOB
==============================
End W4343WCard::begin: SDIO2
==============================
Uploading CLM, size: 7222
CLM uploaded 7222/7222 result: 1
CLM version API: 12.2
Data: 9.10.39
Compiler: 1.29.4
ClmImport: 1.36.3
Creation: 2020-02-16 22:32:13

initialization done
MAC address - 70:87:A7:10:64:B5
Firmware wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

Setup complete
In joinNetworks
WiFi CPU running
Set country succesfully
Join events enabled
Joining network wswn

********************* LINK Established *********************

********************* Joined Network ***********************

Round-trip time 100.0 ms
Round-trip time 147.8 ms
Round-trip time 147.9 ms
Round-trip time 148.0 ms
Round-trip time 148.1 ms
Round-trip time 148.2 ms
Round-trip time 148.2 ms
Round-trip time 48.3 ms
Round-trip time 48.4 ms
Round-trip time 148.5 ms
Round-trip time 48.6 ms
Round-trip time 148.7 ms
Round-trip time 48.8 ms
Round-trip time 148.9 ms
Round-trip time 49.0 ms
Round-trip time 149.1 ms
Round-trip time 49.2 ms
Round-trip time 149.3 ms

This is an example of a ping operation using an IP address of a computer of laptop on your local network. Sometimes you may see an "ARP timeout" or "ICMP timeout" This can happen when the network is busy or if "#define PING_RESP_USEC 300000" in the sketch is set to low for a slower network. You can play with this.

Results for "DHCP_T4.ino":
Code:
CPU speed: 600 MHz
===========================
CYW4343W Card::begin: SDIO2
===========================
Attaching OOB interrupt to pin 34
Enabled CYW4343W bus high speed interface
BUS_IORDY_REG (Ready indication) returned OK
SDHC bus set to 4-bit, speed set to 33MHz
*************
CardID: 43430
*************
Set SRAM_IOCTRL_REG validated
Set SRAM_IOCTRL_REG second validation
Set SRAM_RESETCTRL_REG validated
Uploading firmware data
Uploaded firmware, 419798 of 419798 bytes
Uploading NVRAM data
Uploaded NVRAM, 680 of 680 bytes
Set BAK_CHIP_CLOCK_CSR_REG validated
Set BUS_IORDY_REG validated
Configuring WL_IRQ OOB
==============================
End W4343WCard::begin: SDIO2
==============================
Uploading CLM, size: 7222
CLM uploaded 7222/7222 result: 1
CLM version API: 12.2
Data: 9.10.39
Compiler: 1.29.4
ClmImport: 1.36.3
Creation: 2020-02-16 22:32:13

initialization done
MAC address - 70:87:A7:10:64:B5
Firmware wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

TEENSY 4.1 DHCP CLIENT

In joinNetworks
WiFi CPU running
Set country succesfully
Join events enabled
Joining network wswn

********************* LINK Established *********************

********************* Joined Network ***********************

Rx DHCP OFFER 192.168.0.103
Rx DHCP ACK 192.168.0.103 mask 255.255.255.0 router 192.168.0.1 DNS 192.168.0.1

DHCP complete, IP address 192.168.0.103 router 192.168.0.1

Example of using DHCP to get an IP address for the Teensy 4.1. This and join network are used together.

Results for "udp_server_T4.ino":
Code:
CPU speed: 600 MHz
===========================
CYW4343W Card::begin: SDIO2
===========================
Attaching OOB interrupt to pin 34
Enabled CYW4343W bus high speed interface
BUS_IORDY_REG (Ready indication) returned OK
SDHC bus set to 4-bit, speed set to 33MHz
*************
CardID: 43430
*************
Set SRAM_IOCTRL_REG validated
Set SRAM_IOCTRL_REG second validation
Set SRAM_RESETCTRL_REG validated
Uploading firmware data
Uploaded firmware, 419798 of 419798 bytes
Uploading NVRAM data
Uploaded NVRAM, 680 of 680 bytes
Set BAK_CHIP_CLOCK_CSR_REG validated
Set BUS_IORDY_REG validated
Configuring WL_IRQ OOB
==============================
End W4343WCard::begin: SDIO2
==============================
Uploading CLM, size: 7222
CLM uploaded 7222/7222 result: 1
CLM version API: 12.2
Data: 9.10.39
Compiler: 1.29.4
ClmImport: 1.36.3
Creation: 2020-02-16 22:32:13

initialization done
MAC address - 70:87:A7:10:64:B5
Firmware wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

T4 DHCP client
In joinNetworks
WiFi CPU running
Set country succesfully
Join events enabled
Joining network wswn
UDP server on port 8080

********************* LINK Established *********************

********************* Joined Network ***********************

Rx DHCP OFFER 192.168.0.103
Rx DHCP ACK 192.168.0.103 mask 255.255.255.0 router 192.168.0.1 DNS 192.168.0.1
Client 192.168.0.105: Teensy 4.1 <---------- Results from client computer on local network.

Message sent from local computer through UDP to the Teensy 4.1.
Code:
wwatson@wwatsond1:~$ echo -n "Teensy 4.1" | nc -4u -w1 192.168.0.103 8080
Test 1 <------- Message sent back through UDP to local computer
wwatson@wwatsond1:~$ echo -n "Teensy 4.1" | nc -4u -w1 192.168.0.103 8080
Test 2<------- Message sent back through UDP to local computer
wwatson@wwatsond1:~$
wwatson@wwatsond1:~$ echo -n "Teensy 4.1" | nc -4u -w1 192.168.0.103 8080
Test 3<------- Message sent back through UDP to local computer
wwatson@wwatsond1:~$

This shows the Teensy 4.1 being used as a UDP server on a local network.

Results for "dns_T4.ino":
Code:
CPU speed: 600 MHz
===========================
CYW4343W Card::begin: SDIO2
===========================
Attaching OOB interrupt to pin 34
Enabled CYW4343W bus high speed interface
BUS_IORDY_REG (Ready indication) returned OK
SDHC bus set to 4-bit, speed set to 33MHz
*************
CardID: 43430
*************
Set SRAM_IOCTRL_REG validated
Set SRAM_IOCTRL_REG second validation
Set SRAM_RESETCTRL_REG validated
Uploading firmware data
Uploaded firmware, 419798 of 419798 bytes
Uploading NVRAM data
Uploaded NVRAM, 680 of 680 bytes
Set BAK_CHIP_CLOCK_CSR_REG validated
Set BUS_IORDY_REG validated
Configuring WL_IRQ OOB
==============================
End W4343WCard::begin: SDIO2
==============================
Uploading CLM, size: 7222
CLM uploaded 7222/7222 result: 1
CLM version API: 12.2
Data: 9.10.39
Compiler: 1.29.4
ClmImport: 1.36.3
Creation: 2020-02-16 22:32:13

initialization done
MAC address - 70:87:A7:10:64:B5
Firmware wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

TEENSY 4.1 DNS TEST

In joinNetworks
WiFi CPU running
Set country succesfully
Join events enabled
Joining network wswn

********************* LINK Established *********************

********************* Joined Network ***********************

Rx DHCP OFFER 192.168.0.103
Rx DHCP ACK 192.168.0.103 mask 255.255.255.0 router 192.168.0.1 DNS 192.168.0.1
DHCP complete, IP address 192.168.0.103 router 192.168.0.1

**********************************************
Tx DNS 1 query: www.pjrc.com type A
**********************************************
Rx DNS 1 query, 2 resp: www.pjrc.com type A
www.pjrc.com type CNAME
pjrc.com type A 162.254.150.250
**********************************************
Press anykey to continue...

An example of DNS usage and response. It will process compressed DNS responses as well as multi IP responses. See below:
Code:
**********************************************
Tx DNS 1 query: pool.ntp.org type A
**********************************************
Rx DNS 1 query, 4 resp: pool.ntp.org type A
pool.ntp.org type A 144.202.0.197
pool.ntp.org type A 23.157.160.168
pool.ntp.org type A 23.186.168.128
pool.ntp.org type A 66.42.71.197
**********************************************
Press anykey to continue...
and:
Code:
**********************************************
Tx DNS 1 query: www.raspberrypi.org type A 
**********************************************
Rx DNS 1 query, 2 resp: www.raspberrypi.org type A 
www.raspberrypi.org type A 172.66.149.158
www.raspberrypi.org type A 104.20.23.243
**********************************************
Press anykey to continue...

Results from "web_server_T4.ino":
Code:
CPU speed: 600 MHz
===========================
CYW4343W Card::begin: SDIO2
===========================
Attaching OOB interrupt to pin 34
Enabled CYW4343W bus high speed interface
BUS_IORDY_REG (Ready indication) returned OK
SDHC bus set to 4-bit, speed set to 33MHz
*************
CardID: 43430
*************
Set SRAM_IOCTRL_REG validated
Set SRAM_IOCTRL_REG second validation
Set SRAM_RESETCTRL_REG validated
Uploading firmware data
Uploaded firmware, 419798 of 419798 bytes
Uploading NVRAM data
Uploaded NVRAM, 680 of 680 bytes
Set BAK_CHIP_CLOCK_CSR_REG validated
Set BUS_IORDY_REG validated
Configuring WL_IRQ OOB
==============================
End W4343WCard::begin: SDIO2
==============================
Uploading CLM, size: 7222
CLM uploaded 7222/7222 result: 1
CLM version API: 12.2
Data: 9.10.39
Compiler: 1.29.4
ClmImport: 1.36.3
Creation: 2020-02-16 22:32:13

initialization done
MAC address - 70:87:A7:10:64:B5
Firmware wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

T4 DHCP client
In joinNetworks
WiFi CPU running
Set country succesfully
Join events enabled
Joining network wswn

Web server on port 80

Rx DHCP OFFER 192.168.0.103
Rx DHCP ACK 192.168.0.103 mask 255.255.255.0 router 192.168.0.1 DNS 192.168.0.1

TCP socket 0 Rx GET / HTTP/1.1  <------ From browser
Host: 192.168.0.103
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Priority: u=0, i


TCP socket 0 Rx GET / HTTP/1.1  <------ From browser
Host: 192.168.0.103
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Priority: u=0, i

Using a web browser we send:
Code:
https://192.168.0.103 <----- address assigned by DHCP server on my router.
Change to match your IP address assigned to your T4.1.

Sending:
Code:
https://192.168.0.103
https://192.168.0.103
should return to the browser from the Teensy 4.1:
Code:
Test 1
and then
Test 2
You can also send "http://192.168.0.103/status.txt/" and the browser will display:
Code:
{"state":0,"nsamp":0,"xsamp":10000,"xrate":100000}

There are other things you can send to the browser from the sketch, but those are not working. Probably will not pursue that any further.
Have to decide what the next steps are going to be as far as adapting the main driver to other network libraries.
That's enough for now. Sorry for the long post:)
 
Last edited:
Nice work @wwatson. I saw your LONG post - but wanted to add clarity to prior posts in case they showed anything.

I used my GUEST WiFi as the PWD is easier - but ORBI router doesn't seem to show GUEST device in attached list.
Have a Guest computer and the Server connect /status.txt didn't get a response. : refused to connect

Though code builds and runs for SURE with bare T_4.1 and 4" jumper wires to the @Dogbone06 device with pins as noted above.
 
Have to decide what the next steps are going to be as far as adapting the main driver to other network libraries.
implement this into a proper networking library like QNEthernet.
Maybe @shawn is watching? Or @Paul has made some headway with his devices?
1773951019982.png

And wiring used from post above: Viewed chipside connector left
Code:
INT (34)    WL_ON (33)
CMD (22)    CLK (23)
D0 (40)     D2 (17)
D1 (41)     D3 (16)
GND         3.3v
 
Last edited:
Hello. I haven't looked at this thread in a while. I just read the last few days' posts. At some point soon, I'll go through what hardware I have and wire it up. If I discover I need something, I'll reach out. (No promises on a timeline.)
 
One note is that I'm in the process of poking around to C++-ize the QNEthernet driver so that it's easier to change driver hardware on the fly without having to change #defined options. Having said that, the core functions a driver needs to implement are still the ones in lwip_driver.h.

See if you (anyone) can make headway on some of those, as a start.
 
Back
Top