Forum Rule: Always post complete source code & details to reproduce any issue!
Page 6 of 6 FirstFirst ... 4 5 6
Results 126 to 136 of 136

Thread: New lwIP-based Ethernet library for Teensy 4.1

  1. #126
    Senior Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    490
    I just released 0.15.0. The changes:

    Code:
    ### Added
    * Added a way to enable promiscuous mode: define the
      `QNETHERNET_PROMISCUOUS_MODE` macro.
    * Added a way to remove all the mDNS code: set `LWIP_MDNS_RESPONDER` to `0`
      in `lwipopts.h`.
    * Added support for ".local" name lookups.
    * Added the ability, in the mDNS client, to specify a service name that's
      different from the host name.
    * Added `EthernetClient::abort()` for killing connections without going through
      the TCP close process.
    * New sections in the README:
      * "How to change the number of sockets", and
      * "On connections that hang around after cable disconnect".
    * An `EthernetServer` instance can now be created without setting the port.
      There are two new `begin()` functions for setting the port:
      * `begin(port)`
      * `begin(port, reuse)`
    
    ### Changed
    * Moved CRC-32 lookup table to PROGMEM.
    * Changed in `EthernetServer`:
      * `port()` returns an `int32_t` instead of a `uint16_t` so that -1 can
        represent an unset port; non-negative values are still 16-bit quantities
      * `begin(reuse)` now returns a `bool` instead of `void`, indicating success
      * The `EthernetServer` destructor now calls `end()`
    
    ### Removed
    * Removed some unneeded network interfaces:
      * IEEE 802.1D MAC Bridge
      * 6LowPAN
      * PPP
      * SLIP
      * ZigBee Encapsulation Protocol
    * Removed HTTPD options from `lwipopts.h`.
    Highlights:
    * Support for ".local" name lookups,
    * `EthernetClient::abort()` for not having to go through the TCP close process, if necessary,
    * The ability to create an `EthernetServer` without a port, and
    * A couple new sections in the README.

    Link: https://github.com/ssilverman/QNEthe...es/tag/v0.15.0

  2. #127
    Member
    Join Date
    Jun 2018
    Location
    Berlin
    Posts
    23
    Amazing library Shawn! Thank you for your hard work
    Last edited by Werkstatt Kreuzberg; 09-05-2022 at 01:58 PM. Reason: Smiley issues ;)

  3. #128
    Senior Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    490
    Thank you, Werkstatt!

  4. #129
    Member
    Join Date
    Jun 2018
    Location
    Berlin
    Posts
    23

    Udp packet loss during SSD1306 display refresh.

    Has anyone else detected problems with QNEthernet and a SSD1306 display?
    (I did not tried this with NativeEthernet yet)

    I am using a SSD1306 oled display with hw spi on the second spi port of a Teensy 4.1 (SPI1).
    At the same time i am receiving Art-Net data over the native ethernet port using QNEthernet.
    Checking the Art-Net sequence numbers i realized that sometimes 1 packet gets lost. This only happens during the display refresh! It doesnt matter how many universes i receive. It is the same with 1 or 64 universes.
    Receiving 1 megabyte per second is absolutely no problem until the next refresh cycle. Then sometimes a packet gets lost.
    In addition there are around 120000 spi write calls (just some bytes) per second to 3 dac-chips without any issues. So the problem can not be only spi related.

    The execution time for a refresh cycle with 24mhz spi clock is around 990us and this happens only 4 times per second.
    Yield() is original, just added the Art-Net checking via event responder. The Art-Net check runs 620000 times per second. So Ethernet.loop() respectively enet_proc_input() should run at the same rate.
    My math is not the best, but there should be a call to yield() every 1.61us.
    This should be enough to catch all the data, but not if anything blocks the execution.

    I have changed IRQ_ENET from 128 to lower values, but with no success.
    I also tried software spi for the display. But then the refresh cycle time just increases to 3800us and the issue stays the same. I also tried different libraries for the display.
    Even the simple SSD1306Ascii library leads to the described packet loss.
    Unfortunately my knowledge is not enough to understand what exactly happens in lwip_t41.c. But it looks complicated...
    I experimented also with some parameters in lwipopts.h, but with no success. So everything there is original.

    Arduino IDE is 1.8.19, Teensyduino is 1.57. QNEthernet is the latest.
    If anybody could give me a hint without posting my code i would be very grateful :-)

  5. #130
    Member
    Join Date
    Jun 2018
    Location
    Berlin
    Posts
    23
    Ok it seems that all of these SSD1306 libraries are using delayMicroseconds() to generate some display related timings. I could reproduce the packet loss with a delay of 200us.
    Darn

  6. #131
    Member
    Join Date
    Jun 2018
    Location
    Berlin
    Posts
    23
    Now i have added a digitalToggleFast(13) to delayMicroseconds() in C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\co re_pins.h to check if delayMicroseconds() is called anywhere.
    And it is not! I forgot that i already removed all unnecessary delays from the library i use for the display (u8g2). DelayMicroseconds() is only used for the display initialisation.
    I am not an Arduino pro. So is it possible that a call to another definition of delayMicroseconds() is made by a library??

  7. #132
    Senior Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    490
    I’d need to see code. Checking for Art-Net in yield() via EventResponder doesn’t seem like the right place and the code may be overcomplicated. Instead, what happens if it’s ultimately checked from loop()?

  8. #133
    Member
    Join Date
    Jun 2018
    Location
    Berlin
    Posts
    23
    Quote Originally Posted by shawn View Post
    I’d need to see code. Checking for Art-Net in yield() via EventResponder doesn’t seem like the right place and the code may be overcomplicated. Instead, what happens if it’s ultimately checked from loop()?
    Hi Shawn,

    if i check Art-Net directly from loop the issue stays the same...

  9. #134
    Senior Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    490
    I still need to see your code. Iíve written several Art-Net and sACN programs with QNEthernet and they work fine. Iím not sure what youíre doing differently.

  10. #135
    Senior Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    490
    Would you mind starting a new thread for your question?

  11. #136
    Member
    Join Date
    Jun 2018
    Location
    Berlin
    Posts
    23
    Good idea. I will make a mcve then.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •