Code Monkey home page Code Monkey logo

khoih-prog / ethernet_generic Goto Github PK

View Code? Open in Web Editor NEW
42.0 4.0 22.0 2.03 MB

Simple Ethernet library for AVR, AVR Dx, Portenta_H7, Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52 and RASPBERRY_PI_PICO boards using Ethernet shields W5100, W5200, W5500, W5100S, W6100. With this library you can use the Arduino Ethernet (shield or board) to connect to Internet to provides both Client and server functionalities.

C 47.80% C++ 51.86% Shell 0.33%
ethernet webserver spi2 teensy samd stm32 sam-due nrf52 esp32 esp8266

ethernet_generic's People

Contributors

dependabot[bot] avatar khoih-prog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ethernet_generic's Issues

RP2040 Mbed Core SPI pins

I am using RP2040 with Arduino MBED core. I tried "UDPSendReceive" example but SPI pins is wrong. How can I set the pins as SCK: GPIO2, MOSI: GPIO3, MISO: GPIO4, SS/CS: GPIO5.

Start UDPSendReceive on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library with Large Buffer
Ethernet_Generic v2.3.1
[ETG] Default SPI pinout:
[ETG] MOSI: 19
[ETG] MISO: 16
[ETG] SCK: 18
[ETG] SS: 17
[ETG] =========================
[ETG] RPIPICO setCsPin: 17
[ETG] W5100 init, using SS_PIN_DEFAULT = 17 , new ss_pin = 10 , W5100Class::ss_ pin = 17
[ETG] W5100::init: no chip :-(
[ETG] Currently Used SPI pinout:
[ETG] MOSI: 19
[ETG] MISO: 16
[ETG] SCK: 18
[ETG] SS: 17
[ETG] =========================
Using mac index = 12
Connected! IP address: 0.0.0.0
Speed: NO LINK, Duplex: NO LINK, Link status: NO LINK

ESP32-W5500 Webclient and Webserver not working

Hi,
I am using ESP32 Dev Module with W5500.I tried Webclient and webserver example but it's not working.

Starting WebServer on ESP32 with W5x00 using Ethernet_Generic Library with Large Buffer
Ethernet_Generic v2.3.1
[ETG] Default SPI pinout:
[ETG] MOSI: 23
[ETG] MISO: 19
[ETG] SCK: 18
[ETG] SS: 5
[ETG] =========================
[ETG] ESP32 setCsPin: 5        
[ETG] W5100 init, using SS_PIN_DEFAULT = 22 , new ss_pin =  10 , W5100Class::ss_pin =  5
[ETG] Chip is W5500
[ETG] W5100::init: W5500, SSIZE = 8192
[ETG] Currently Used SPI pinout:
[ETG] MOSI: 23
[ETG] MISO: 19
[ETG] SCK: 18
[ETG] SS: 5
[ETG] ========================= 
Using mac index = 1
Connected! IP address: 0.0.0.0 
Speed: 100 MB, Duplex: FULL DUPLEX, Link status: LINK

Sometimes It is working properly but sometimes I am getting as above.
I tried with Arduino UNO with W5500.I am getting same problem.
Can you help me to resolve the issue.

Using SPI1 for LoRaWAN WISOL LOM204 Module

Dear Khoih

I am using the STM32L0 + SX1276 (LoRaWAN WISOL LOM204 MODULE).

I ported the STM32 ARDUINO to it and working nice!

image

The module uses the SPI, not the SPI1 or SPI2

Now i want to add the WIZNET W500 to SPI1 , did you port the defines to use the SPI1 to WIZNET ?

I spent some hours without success!

My idea is to use the SPI (SX1276) and SPI1 (WIZNET) togetther, btw, add ETHERNET to LOM204

Multiple Definition when linking

Describe the bug

I am have included Ethernet_Generic.h in my main file for starting a webserver. I also have Ethernet_Generic included in another header file for a Modbus TCP class.

On compiling I get many multiple definition errors such as
c:/users/??????/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio/build/stm32-5mi/src/modbus/ModbusTCPSlave.cpp.o:(.bss._ZN10W5100Class4chipE+0x0): multiple definition of `W5100Class::chip'; .pio/build/stm32-5mi/src/main.cpp.o:(.bss._ZN10W5100Class4chipE+0x0): first defined here

Any help would be appreciated.

Expected behavior

When using previous Ethernet library, everything compiled as normal. Previous Library

Information

  • Latest development STM32 core

Ethernet.begin(&MAC) hangs when DHCP is not available

I am using your library with Generic RP2040 + W5500, connected to 4G modem, using DHCP.
I am using Arduino IDE version 2.0.3 on Windows 10 Pro 22H2.

To get the connection, I used Ethernet.begin(&MAC);

Everything was going fine until I tested modem problem.
On this tests, I unplug the Ethernet cable, emulating a modem problem, and the begin() never ends.
It's looks like the library does not know what to do when it can't access the DHCP.

To confirm the error, I repeated the operation, but using fixed IP Ethernet.begin(&MAC, &IP);.
It works fine.

I would like to recommend:

  1. The begin() returns a Boolean informing it fails or not.
  2. The begin() include a timeout or add a new set timeout function for legacy compatibility.

I appreciate your help.

Best regards,

Fernando Camargo
mailto: [email protected]

'ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope

Error:

Ethernet_Generic/src/EthernetServer_Impl.h:364:81: error: 'ETHERNET_SERVER_SEND_MAX_SIZE' was not declared in this scope

If you don't enable large buffer support, then the ETHERNET_SERVER_SEND_MAX_SIZE constant is not defiend and the code doesn't compile.

EthernetServer_Impl.h:327:

// Don't use larger size or hang, max is 16K for 1 socket
#ifdef ETHERNET_LARGE_BUFFERS
  #if MAX_SOCK_NUM <= 1
    #define ETHERNET_SERVER_SEND_MAX_SIZE         16384
  #elif MAX_SOCK_NUM <= 2
    #define ETHERNET_SERVER_SEND_MAX_SIZE         8192
  #elif MAX_SOCK_NUM <= 4
    #define ETHERNET_SERVER_SEND_MAX_SIZE         4096
  #else
    #define ETHERNET_SERVER_SEND_MAX_SIZE         2048
  #endif
#endif

EthernetServer_Impl.h:364

   written =  Ethernet.socketSend(sockindex, buf, min(bytesRemaining, (size_t) ETHERNET_SERVER_SEND_MAX_SIZE) );

I didn't submit a PR because I'm not sure what the constant should be set to if large buffers is disabled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.