Teensy 4.1: Ethernet stops working after 30s when plugged into switch

mdb

Member
Hello,

  • hardware: Teensy 4.1 with the ethernet kit
  • software: NativeEthernet UDPSendReceiveString example
  • software modifications: changed mac, IP, port and uncommented Ethernet.init(10);

I have my Teensy 4.1 running a slightly modified UDPSendReceiveString.ino. The Teensy is connected to a network switch, which is connected to a few other devices including a RaspberryPi. I send small (10 byte) UDP messages from the Pi to the Teensy's IP/port at 1Hz with some basic python code.

For roughly 30s after boot, the Teensy receives and responds to the Pi's messages, as confirmed by serial port. After 30s, the Teensy stops printing to serial port.

If I remove the network switch from the loop; that is to say, connect the Teensy directly to the RPi via ethernet, the Teensy receives and responds to the Pi's messages indefinitely. It appears that the network traffic on the passive switch is the source of the problem.

  • Is my initial analysis sensible?
  • What further steps can I take to identify the problem? For Linux applications I would use gdb to further poke around
  • Does this resemble a known problem with an known solution / workaround?
  • Should I be uncommenting Ethernet.init(10); for the Teensy 4.1? What about Teensy 3.6? I admit I should poke around the documentation / source code more before asking, but I guess no harm in asking while I am here

Many thanks,
 
So the switch blocks the traffic for some reason, I would check logs/settings in the switch.
Firewall settings.
Improper network class chosen.
Spanning tree decided the IP was on a different port.

It seems I have forgotten most of what I once knew about networks. Wish I could help more.
 
Not sure if the network has a router, but I was having issue with my network and found that a dumber network router seemed to work better, back when I started using NativeEthernet. I have a Unifi network at the office, but use a simple travel router for the T4.1 stuff I was doing, which helped.

Also, take a look at QNEthernet https://github.com/ssilverman/QNEthernet. I find it to be more robust than NativeEthernet.
 
Back
Top