Ethernet to wifi esp8266

Решено wifi мост из двух esp8266

Подскажите, пожалуйста, можно ли сделать wifi мост из двух esp8266?
Т.е., грубо говоря, замену витой паре между свичем и компом?
Может быть есть готовые прошивки или модули?

Andy Korg

Moderator

Не совсем понятна задача. Устройство должно иметь со одной стороны WiFi, а с другой стороны что? Ethernet? USB? COM? Если Ethernet то это WiFi роутер, если usb то это WiFi свисток, а вот если COM или там I2C то да, есть такие прошивки. Например Прошивка TCP2UART переходника с настройкой по Web

hzuszun30

New member

Не совсем понятна задача. Устройство должно иметь со одной стороны WiFi, а с другой стороны что? Ethernet? USB? COM? Если Ethernet то это WiFi роутер, если usb то это WiFi свисток, а вот если COM или там I2C то да, есть такие прошивки. Например Прошивка TCP2UART переходника с настройкой по Web

Ethernet, конечно. В вопросе — «замену витой паре между свичем и компом». Что это может быть еще?
Чтобы не тащить витуху через помещение.

Andy Korg

Moderator

Мне о таком не известно, увы Да и врядли на esp стоит городить такую штуку. Это же надо интерфейс PHY прикручивать, а это точно еще один чип. Легче свиток WiFi и роутер (или еще свисток) поставить.

hzuszun30

New member

Мне о таком не известно, увы Да и врядли на esp стоит городить такую штуку. Это же надо интерфейс PHY прикручивать, а это точно еще один чип. Легче свиток WiFi и роутер (или еще свисток) поставить.

Там же есть всякие rx-tx — думал что использовать их для Ethernet самое то — без какой-либо дополнительной обвязки и решить все чисто программным способом.
Ну, нет, так нет, жаль. Было бы дешево и удобно.

Andy Korg

Moderator

pvvx

Активный участник сообщества

hzuszun30

New member

hzuszun30

New member

pvvx

Активный участник сообщества

На ESP практически ни как это не сделать. Итог будет плачевный — пару килобайт в секунду, хуже древнего телефонного модема. И цена выйдет больше.

Читайте также:  Keenetic распечатать qr код wifi

hzuszun30

New member

На ESP практически ни как это не сделать. Итог будет плачевный — пару килобайт в секунду, хуже древнего телефонного модема. И цена выйдет больше.

rst

Member

Сделать можно. На связке ESP8266+какой-нить_МК_с_Ethernet-интерфейсом.
Открываете сокетное соединение и через него пробрасываете Ethernet-over-IP-туннель. Скорость будет небольшая — десятки кБ/сек можно получить, может даже сотни, выше — сомнительно.
Но делать это только Вам. А Вы как видно это сделать не сможете. Да и овчинка выделки не стоит.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Example of using SPI Ethernet module with esp8266

nopnop2002/esp8266_ethernet

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Example of using SPI Ethernet module with esp8266.
Arduino core for ESP8266 uses lwip for TCP/IP protocol stack.
The hierarchy of programs that use WiFi is as follows:

+----------------+ | Application | +----------------+ | Network Object | +----------------+ | lwip | +----------------+ | WiFi Driver | +----------------+ 

Arduino Core for ESP8266 Ver3.0.2 officially supports SPI External Ethernet.
You don’t need any libraries.
The hierarchy of programs that use Ethernet is as follows:

+----------------+ | Application | +----------------+ | Network Object | +----------------+ | lwip | +----------------+ | Ethernet Driver| +----------------+ 

SPI Ethernet module using this chip.

  • Arduino core for ESP8266 V3.0.2 or later

    You can check the Core version using ESP.getFullVersion() or ESP.getCoreVersion().
    This is mine:

ESP.getFullVersion=SDK:2.2.2-dev(38a443e)/Core:3.0.2=30002000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258/BearSSL:6105635 ESP.getCoreVersion=3.0.2 

Selecting the Ethernet module

#include Wiznet5500lwIP eth(CSPIN); 

W5500

#include Wiznet5100lwIP eth(CSPIN); 

W5100

#include ENC28J60lwIP eth(CSPIN); 

ENC28J60

NTP Client is currently not working.
This is probably not a driver issue, but a core library issue.

$ git clone https://github.com/nopnop2002/esp8266_ethernet $ cd esp8266_ethernet/connectEthernet/ $ pio init -b d1_mini $ cp connectEthernet.ino src/ $ pio run -t upload && pio device monitor -b 115200 ==================================== [SUCCESS] Took 25.50 seconds ==================================== --- Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time --- More details at https://bit.ly/pio-monitor-filters --- Miniterm on /dev/ttyUSB0 115200,8,N,1 --- --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- SDK:2.2.2-dev(38a443e)/Core:3.0.2=30002000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258/BearSSL:6105635 connecting ethernet.. ethernet ip address: 192.168.10.128 ethernet subnetMask: 255.255.255.0 ethernet gateway: 192.168.10.1 

How to convert from WiFi to Ethernet

#include const char* SSID = "ssid_of_your_router"; const char* PASSWORD = "password_of_your_router"; void setup() < delay(1000); Serial.begin(115200); Serial.println(); Serial.print(ESP.getFullVersion()); Serial.println(); Serial.print("connecting wifi"); WiFi.mode(WIFI_STA); WiFi.begin(SSID, PASSWORD); while (1) < status = WiFi.status(); Serial.print("status="); Serial.println(status); if (status == WL_CONNECTED) break; Serial.print("."); delay(500); >Serial.println(); Serial.print("WiFi ip address: "); Serial.println(WiFi.localIP()); Serial.print("Wifi subnetMask: "); Serial.println(WiFi.subnetMask()); Serial.print("WiFi.gatewayIP: "); Serial.println(WiFi.gatewayIP()); Serial.print("WiFi.dnsIP: "); Serial.println(WiFi.dnsIP()); > void loop()
#include #include #include //#include //#include #define CSPIN 16 Wiznet5500lwIP eth(CSPIN); //Wiznet5100lwIP eth(CSPIN); //ENC28J60lwIP eth(CSPIN); byte mac[] = ; void setup() < delay(1000); Serial.begin(115200); Serial.println(); Serial.print(ESP.getFullVersion()); Serial.println(); SPI.begin(); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE0); SPI.setFrequency(4000000); eth.setDefault(); // use ethernet for default route int present = eth.begin(mac); if (!present) < Serial.println("no ethernet hardware present"); while(1); >Serial.print("connecting ethernet"); while (!eth.connected()) < Serial.print("."); delay(1000); >Serial.println(); Serial.print("ethernet ip address: "); Serial.println(eth.localIP()); Serial.print("ethernet subnetMask: "); Serial.println(eth.subnetMask()); Serial.print("ethernet gateway: "); Serial.println(eth.gatewayIP()); > void loop()

About

Example of using SPI Ethernet module with esp8266

Источник

ESP8266 with ethernet connection

I was wondering if someone knows a way to convert a ESP8266 to non-WiFi. I.e. have it connected through Ethernet, preferably with PoE possibility. Reason for asking: My plan is to have sensors in a locker which is not a wifi-friendly environment. I want to monitor humidity and temperature in particular. I have a lot of ESP8266 units and like the firmware ESPeasy, thus wanting to stick to that platform.

Can you explain why you are asking? To make your question easier to answer well, you need to explain your constraints. What makes this hardware preferable to a MCU board which already supports ethernet? How is your question different to ‘how can I convert a MCU which supports ethernet to operate with PoE’.

You may spend more time struggling to get Ethernet working that you would switching to a different MCU.

An alternative, would be to use ethernet cable for power and serial TX/RX. instead of using it for actual TCP or UDP traffic. You could have all your ESP’s wired up to a «hub» of your making which reads/sends over the ethernet using serial, and power can be provided over another wire pair in the same ethernet cord. You may need some protection on the ESP side depending on the length of your cable run and how many volts you need to send down it. I believe PoE uses 48v.

2 Answers 2

The simplest solution is to add an external ethernet interface driven over SPI, as used in this example.

It’s also possible to bit-bang the ethernet interface directly, as decsribed in this article, Ethernet Controller Discovered in the ESP8266. Performance might not be as good as with a dedicated interface though.

Neither of these include Power over Ethernet, and the latter will probably not leave you with very much spare compute resource (although your application many not care).

If you’re interested specifically in PoE, this Teensy forum thread discusses building a shield for a board. Although the base board is in production, it doesn’t look like the ethernet shield is yet.

The ESP8266 was not designed with an Ethernet MAC, but this should not stop you. However, as Sean has said, it imposes a set of pretty severe restrictions on you.

You say that you wish to stay with the ESP8266 platform, but if your project cannot deal with the measly data rates provided by using an ENC28J60-style chip, or bit-banging Ethernet, then there is an alternative. The ESP32 has a 10/100 Mb/s Ethernet MAC that only requires a PHY, magnetics, and an RJ45 connector, and the ESP32 modules are just as cheap (if not cheaper) than the ESP8266 ones.

The unfortunate downside to this approach is that it does not appear that many ESP32 shields have made it to market yet.

Источник

Оцените статью
Adblock
detector