Thanks, so far I am not seeing it...@KurtE - This one:
Good luck. You probably have tons of boxes, drawers and closet to look through like I doThanks, so far I am not seeing it...
Will look again later
yep,Good luck. You probably have tons of boxes, drawers and closet to look through like I doTook me a half hour to locate Paul's T4.0 breakout board yesterday...
Starting...
Starting Ethernet with DHCP...
===========================
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 issue, response: 0x50
driver_get_system_mac
// SPDX-FileCopyrightText: (c) 2021-2026 Shawn Silverman <shawn@pobox.com>
// SPDX-License-Identifier: AGPL-3.0-or-later
// SNTPClient demonstrates a simple SNTP client.
// See: https://tools.ietf.org/html/rfc4330
//
// This file is part of the QNEthernet library.
// C includes
#include <sys/time.h>
// Assume settimeofday() exists
// C++ includes
#include <cerrno>
#include <cstring>
#include <ctime>
#include <QNEthernet.h>
using namespace qindesign::network;
// --------------------------------------------------------------------------
// Configuration
// --------------------------------------------------------------------------
constexpr uint32_t kDHCPTimeout = 15000; // 15 seconds
constexpr uint16_t kNTPPort = 3333;
// --------------------------------------------------------------------------
// Program State
// --------------------------------------------------------------------------
namespace { // Internal linkage section
// UDP port.
EthernetUDP udp;
// Buffer.
uint8_t buf[254];
} // namespace
// --------------------------------------------------------------------------
// Main Program
// --------------------------------------------------------------------------
// Program setup.
void setup() {
Serial.begin(115200);
while (!Serial && (millis() < 4000)) {
// Wait for Serial
}
printf("Starting...\r\n");
printf("Starting Ethernet with DHCP...\r\n");
if (!Ethernet.begin()) {
printf("Failed to start Ethernet\r\n");
return;
}
uint8_t mac[6];
Ethernet.macAddress(mac); // This is informative; it retrieves, not sets
printf("MAC = %02x:%02x:%02x:%02x:%02x:%02x\r\n",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
printf("Waiting for local IP...\r\n");
if (!Ethernet.waitForLocalIP(kDHCPTimeout)) {
printf("Failed to get IP address from DHCP\r\n");
return;
}
IPAddress ip = Ethernet.localIP();
printf(" Local IP = %u.%u.%u.%u\r\n", ip[0], ip[1], ip[2], ip[3]);
ip = Ethernet.subnetMask();
printf(" Subnet mask = %u.%u.%u.%u\r\n", ip[0], ip[1], ip[2], ip[3]);
ip = Ethernet.gatewayIP();
printf(" Gateway = %u.%u.%u.%u\r\n", ip[0], ip[1], ip[2], ip[3]);
ip = Ethernet.dnsServerIP();
printf(" DNS = %u.%u.%u.%u\r\n", ip[0], ip[1], ip[2], ip[3]);
// Start UDP listening on the NTP port
udp.begin(kNTPPort);
// Send an SNTP request
std::memset(buf, 0, 254);
// Send the packet
printf("Sending SNTP request to the gateway...");
udp.beginPacket(Ethernet.gatewayIP(), kNTPPort);
udp.write(buf, 48);
udp.endPacket();
printf("\r\n");
printf("Started listening\r\n");
}
// Main program loop.
void loop() {
// 1. RECEIVE DATA
// Check if a packet has arrived
int packetSize = udp.parsePacket();
if (packetSize) {
Serial.printf("Received %d bytes: %d\n", packetSize);
}
}
Check loop() code - two %d and one param? and changed to >0 test as it was blasting SerMon:Also I playing around and it keeps hanging at
// Main program loop.
void loop() {
// 1. RECEIVE DATA
// Check if a packet has arrived
int packetSize = udp.parsePacket();
if (packetSize > 0) {
Serial.printf("Received bytes: %d\n", packetSize);
}
}
Starting...
Starting Ethernet with DHCP...
===========================
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
==============================
driver_get_system_mac
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
In joinNetworks
WiFi CPU running
Set country succesfully
Join events enabled
Joining network FiberEagle
********************* LINK Established *********************
********************* Joined Network ***********************
Initialization Done
MAC = 70:87:a7:11:98:a5
Waiting for local IP...
Setting link up
Local IP = 10.168.168.215
Subnet mask = 255.255.255.0
Gateway = 10.168.168.1
DNS = 10.168.168.1
Sending SNTP request to the gateway...
Started listening
Thanks @defragster. But to clear up the problem I rewired it again and got this far - now to go hook up ESP32 or maybe a giga R1 to see if I can get them talking. But after the rewire:Check loop() code - two %d and one param? and changed to >0 test as it was blasting SerMon:
Had the example working yesterday but the today had an issue - so just had to rewire and it worked with your changes.Modify this to work?:
T:\T_Drive\tCode\libraries\QNEthernet_WIFI\src\qnethernet\drivers\cyw4343w\src\secrets.h
Look for connect at: Joining network FiberEagle
Looks like port # is 3333? Not getting a result from send
Started listening
Received bytes: 7
Received bytes: 7
Received bytes: 7
// Main program loop.
void loop() {
// 1. RECEIVE DATA
// Check if a packet has arrived
int packetSize = udp.parsePacket();
if (packetSize > 0) {
Serial.printf("Received bytes: %d:: ", packetSize);
char *pd = udp.data();
for (int ii=0; ii< packetSize; ii++) {
Serial.print( pd[ii]);
}
Serial.println();
}
}
Waiting for local IP...
Setting link up
Local IP = 10.168.168.215
Subnet mask = 255.255.255.0
Gateway = 10.168.168.1
DNS = 10.168.168.1
Sending SNTP request to the gateway...
Started listening
Received bytes: 7:: 1234abc
Received bytes: 239:: Memory Usage on Teensy 4.1:
FLASH: code:128488, data:449100, headers:9160 free for files:7539716
RAM1: variables:36576, code:124816, padding:6256 free for local variables:356640
RAM2: variables:40352 free for malloc/new:483936
// SPDX-FileCopyrightText: (c) 2021-2026 Shawn Silverman <shawn@pobox.com>
// SPDX-License-Identifier: AGPL-3.0-or-later
// SNTPClient demonstrates a simple SNTP client.
// See: https://tools.ietf.org/html/rfc4330
//
// This file is part of the QNEthernet library.
// C includes
#include <sys/time.h>
// Assume settimeofday() exists
// C++ includes
#include <cerrno>
#include <cstring>
#include <ctime>
#include <QNEthernet.h>
using namespace qindesign::network;
// --------------------------------------------------------------------------
// Configuration
// --------------------------------------------------------------------------
constexpr uint32_t kDHCPTimeout = 15000; // 15 seconds
constexpr uint16_t kNTPPort = 3333;
// --------------------------------------------------------------------------
// Program State
// --------------------------------------------------------------------------
namespace { // Internal linkage section
// UDP port.
EthernetUDP udp;
// Buffer.
uint8_t packetBuffer[254];
} // namespace
// --------------------------------------------------------------------------
// Main Program
// --------------------------------------------------------------------------
const char* udpAddress = "192.168.1.221";
// Program setup.
void setup() {
Serial.begin(115200);
while (!Serial && (millis() < 4000)) {
// Wait for Serial
}
printf("Starting...\r\n");
printf("Starting Ethernet with DHCP...\r\n");
if (!Ethernet.begin()) {
printf("Failed to start Ethernet\r\n");
return;
}
uint8_t mac[6];
Ethernet.macAddress(mac); // This is informative; it retrieves, not sets
printf("MAC = %02x:%02x:%02x:%02x:%02x:%02x\r\n",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
printf("Waiting for local IP...\r\n");
if (!Ethernet.waitForLocalIP(kDHCPTimeout)) {
printf("Failed to get IP address from DHCP\r\n");
return;
}
IPAddress ip = Ethernet.localIP();
printf(" Local IP = %u.%u.%u.%u\r\n", ip[0], ip[1], ip[2], ip[3]);
ip = Ethernet.subnetMask();
printf(" Subnet mask = %u.%u.%u.%u\r\n", ip[0], ip[1], ip[2], ip[3]);
ip = Ethernet.gatewayIP();
printf(" Gateway = %u.%u.%u.%u\r\n", ip[0], ip[1], ip[2], ip[3]);
ip = Ethernet.dnsServerIP();
printf(" DNS = %u.%u.%u.%u\r\n", ip[0], ip[1], ip[2], ip[3]);
// Start UDP listening on the NTP port
udp.begin(kNTPPort);
// Send an SNTP request
std::memset(packetBuffer, 0, 254);
// Send the packet
printf("Sending SNTP request to the gateway...");
udp.beginPacket(udpAddress, kNTPPort);
udp.write(packetBuffer, 48);
udp.endPacket();
printf("\r\n");
printf("Started listening\r\n");
}
// Main program loop.
void loop() {
// 1. RECEIVE DATA
// Check if a packet has arrived
int packetSize = udp.parsePacket();
if (packetSize > 0) {
Serial.printf("Received %d bytes: \n", packetSize);
// Read the packet into packetBuffer
int len = udp.read(packetBuffer, 255);
if (len > 0) {
packetBuffer[len] = 0; // Null-terminate the string
}
Serial.printf("Packet contents: %s\n", packetBuffer);
}
// 2. SEND DATA (Every 5 seconds)
static unsigned long lastSendTime = 0;
if (millis() - lastSendTime > 5000) {
lastSendTime = millis();
Serial.println("Sending periodic UDP packet...");
// Initialize packet transmission to target IP and port
udp.beginPacket(udpAddress, kNTPPort);
// Print formatted data directly into the packet
udp.printf("Hello from Teensy 4.1! Uptime: %lu seconds", millis() / 1000);
// Finalize and transmit the packet
udp.endPacket();
}
}
#include <WiFi.h>
#include <WiFiUdp.h>
// Network credentials
const char* ssid = "";
const char* password = "";
// UDP settings
const unsigned int localPort = 3333; // Port the ESP32 listens on
const char* udpAddress = "192.168.1.222"; // Target IP address to send data to
const int remotePort = 3333; // Target port to send data to
// UDP instance
WiFiUDP udp;
// Packet buffers
char packetBuffer[255];
char replyBuffer[] = "Message received!";
void setup() {
// Initialize serial communication
Serial.begin(115200);
// Connect to Wi-Fi network
WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected!");
Serial.print("ESP32 IP Address: ");
Serial.println(WiFi.localIP());
// Start listening on the specified UDP port
udp.begin(localPort);
Serial.print("Listening on UDP port ");
Serial.println(localPort);
}
void loop() {
// 1. RECEIVE DATA
// Check if a packet has arrived
int packetSize = udp.parsePacket();
if (packetSize) {
Serial.printf("Received %d bytes from %s, port %d\n",
packetSize,
udp.remoteIP().toString().c_str(),
udp.remotePort());
// Read the packet into packetBuffer
int len = udp.read(packetBuffer, 255);
if (len > 0) {
packetBuffer[len] = 0; // Null-terminate the string
}
Serial.printf("Packet contents: %s\n", packetBuffer);
// Optional: Send an automatic reply back to the sender
udp.beginPacket(udp.remoteIP(), udp.remotePort());
udp.write((uint8_t*)replyBuffer, strlen(replyBuffer));
udp.endPacket();
}
// 2. SEND DATA (Every 5 seconds)
static unsigned long lastSendTime = 0;
if (millis() - lastSendTime > 5000) {
lastSendTime = millis();
Serial.println("Sending periodic UDP packet...");
// Initialize packet transmission to target IP and port
udp.beginPacket(udpAddress, remotePort);
// Print formatted data directly into the packet
udp.printf("Hello from ESP32! Uptime: %lu seconds", millis() / 1000);
// Finalize and transmit the packet
udp.endPacket();
}
}
Ok, I found our schematic:
View attachment 39480
Also, here is a link to my GitHub repo containing most of the information we all collected. It may be of use to you...
EDIT: It looks like we are using the HOST_WAKE pin for int. 1DX pin #27.
To continue this line of questioning, @sparkfro, I'd likely be attaching an OctoWS2811 board too. How would this fit in there?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
believe the 1dx does support bluetooth. Its the same chip as on on the giga if I remember right>Sorry, wondering if this chip also does Bluetooth? Again it looks similar to the one in the Nicla Vision and probably others:
Murata® 1DX Wi-Fi®/Bluetooth® Module
Wi-Fi® 802.11b/g/n 65 Mbps
Bluetooth® Low Energy (version 5.X via Cordio stack, version 4.2 via Arduino Stack)
Micro UFL connector for external antenna
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
To continue this line of questioning, @sparkfro, I'd likely be attaching an OctoWS2811 board too. How would this fit in there?
Sorry, wondering if this chip also does Bluetooth? Again it looks similar to the one in the Nicla Vision and probably others:
From the earlier schematic:
View attachment 39492
From the Nicla Vision schematic: https://docs.arduino.cc/resources/schematics/ABX00051-schematics.pdf
View attachment 39493
And I see signals setup for example to turn blue tooth on. Question is, if the chosen chip supports it, is there a reason you would not
want to make it somehow useable?
EDIT: I see @mjs513 already mentioned that the GIGA uses it as well, so does the Arduino Portenta H7. Good news with all of this is that
there should be libraries to support these chips, both WIFI and BT. For both Arduino IDE and Zephyr.
believe the 1dx does support bluetooth. Its the same chip as on on the giga if I remember right>
Rich (BB code):Murata® 1DX Wi-Fi®/Bluetooth® Module Wi-Fi® 802.11b/g/n 65 Mbps Bluetooth® Low Energy (version 5.X via Cordio stack, version 4.2 via Arduino Stack) Micro UFL connector for external antenna
Giga R1 schematic
View attachment 39494
And it looks like you just need to bring out 2 more pins BT_WAKE_H and BT_WAKE_L
For me, I would probably use it in one of the simple boards @Paul has made in the past, like:Great questions, thank you! I'll admit that I've really not used Teensy much myself, so this is great to understand some use cases and interactions with other hardware. Please feel free to bring up other use cases and potential hardware combinations!
Was going to post the same - but mine might be no more photogenicone of the simple boards
Would be great if Sparkfun sold some like these.