Getting started with ethernet

I want to experiment with ethernet using a Teensy 4.1 .
AIUI the standard arduino library will work, is this correct?
I've never done anything ethernet before, but I got the Webserver example working on an arduino with an ethernet shield, so can I just use the same code on the teensy without modification?
Also, for testing for now, can I just wire an ethernet cable to the ethernet RX/TX pins directly, or is the magnetic transformer mandatory?

Thanks
 
THIS :: magnetic transformer mandatory

There is a library included in TeensyDuino that has been crafted and tested to work with T_4.1 ethernet.
From : <your install>\hardware\teensy\avr\libraries\NativeEthernet\library.properties
Code:
name=NativeEthernet
version=1.0.5
author=Various (see AUTHORS file for details)
maintainer=Tino Hernandez <vjmuzik1@gmail.com>
sentence=Enables network connection (local and Internet) using the Native Ethernet on Teensy 4.1.
paragraph=With this library you can use the Native Ethernet (builtin) to connect to the Internet. The library provides both Client and server functionalities. The library permits you to connect to a local network also with DHCP and to resolve DNS.
category=Communication
url=http://www.arduino.cc/en/Reference/Ethernet
architectures=*
includes=NativeEthernet.h

There is a thread for this library on the forum : pjrc.com/threads/60857-T4-1-Ethernet-Library
 
I want to experiment with ethernet using a Teensy 4.1 .

Also, for testing for now, can I just wire an ethernet cable to the ethernet RX/TX pins directly, or is the magnetic transformer mandatory?

Thanks

Yes, as defragster said, you need a magjack. PJRC offers a simple kit. You can use that or roll your own.
 
Almost any 10/100 magjack or transformer should work.
However, you need to connect the correct pins. There is no standardization of magjack output pins and plugging the wrong one in can have dire consequences. Don't ask me how I know this...
 
Resurrecting an old thread.

I too am getting started with Ethernet on the teensy 4.1 but have ZERO experience working with internet protocols. I do have a lot of experience working with microcontrollers of all types with UARTS, SPI, I2C, .etc but this HDCP, API Ethernet black magic has me confused. This is after countless youtube and forum hours searching how to start.

I have a teensy 4.1 with the JPRC supplied Ethernet adapter. I've tried various example codes in the "NativeEthernet" but none of them seem to work. How does one even debug an Ethernet connection? I've gotten Telnet Client working per some of the examples but I have no idea what I'm doing.

Why isn't there a simple "getting started with Ethernet" tutorial like there is for SPI, I2C, UARTs and every other method of communicating with a microcontroller? How are others getting started?
 
Dimitri, I've commented on your post. I bet between the two of us we can make great strides in the dark art of Ethernet communication.
 
So I'm dumb and don't know what I don't know. Apparently you need a cross-over cable to connect a T4.1 directly into your computer. I'm going to switch cables later tonight and see if that works.

Here is a good link for a "How to start with Ethernet" that took me days to find online.
https://www.allaboutcircuits.com/projects/using-an-arduino-as-a-web-server/

Yes, it's also a pain to have to modify your laptop network settings. Here's a wifi extender that I use to avoid that trouble and connect the T4.1 on my desk to my network without running a long cable.

https://www.setup-wifi.com/
 
Back
Top