Here's a version that is designed for QNEthernet. I took out the #ifdefs for readability and added a few notes. (Hopefully I didn't make any mistakes.) There's a few other ways to do things here, this is just one way.
...
If you want to eliminate any transmission delays, you can call flush() after sending TCP data when using QNEthernet. It’s possible the ArduinoModbus API needs to be changed to support this. Without calling flush(), data...
Under the hood, incoming data is handled with callbacks, but with polling and not interrupts. The stack is polled for input every time Ethernet.loop() is called, which happens in a number of places internally, and also...
Yes, that’s correct. I chose “buffer if it can” over “send always” because lwIP’s API is similar, so I basically just did a direct mapping. Plus there exists that flush() call in the Arduino API (I don’t really...
Call flush() to send any buffered data immediately. For reference, see the “Write immediacy” section in the Readme.
There’s no equivalent for setSocketSize() or setStackHeap(). Those are specific to how...
I couldn’t promise a timeline, but if you send me some hardware I could poke around with modifying QNEthernet. I think only lwip_t41.c would need to be modified.
Sounds like you’re specifying a static IP and not getting one through DHCP. If waitForLocalIP() returns false then no address was assigned via DHCP. (Using the Ethernet.begin() form.) I don’t think there’s an accessible...
DMX512 uses a differential pair (RS-485) and is not compatible with the Teensy serial ports (i.e. UART-style signalling). You need a transceiver. Something like this: https://www.sparkfun.com/products/10124
Note that...
I just tested this on a Teensy 4.0 and it seems to work as expected. Is it possible something isn't connected correctly?
I tested your code and I tested with adding a `delay(10)` after the `Serial.println(1)`.
...
Well, then. I stand corrected on the DHCP server. :)
I always thought most modern Ethernet jacks don’t need crossover cables anymore. Is that not the case here?
I did not know that about soldering iron tip...
If you’re using the Ethernet.begin() form then it will try DHCP. I have a feeling that your computer isn’t running a DHCP server, so by the time the 10-second wait time is over, there’s still no IP address. In your code...
QNEthernet doesn’t block or wait on any of the begin() functions, even if there’s no cable plugged in. There are a few options for waiting for an address from DHCP. See the examples for more information. Also, you don’t...
Another fun fact: Changing the toolchain from version 1.50401.190816 (5.4.1) to version 1.90301.200702 (9.3.1) (using PlatformIO and a small test program) saves about 40k of RAM1 and about 45k of flash.
I added this...
Try setting LWIP_DNS_SUPPORT_MDNS_QUERIES to 1 in lwipopts.h (line 148). I think I'll add this to the next release.
Side point: the "(const char *)" casts aren't needed.
Some links about structs:
* https://stackoverflow.com/questions/5397447/struct-padding-in-c
* http://www.catb.org/esr/structure-packing/
The internal structure of structs is not standardized and I wouldn’t rely on...
I just released v0.14.0 of the library. The changes:
##
### Added
* Added a `util::StdioPrint` class, a `Print` decorator for stdio output files.
It routes `Print` functions to a specific `FILE*`. This...