Thanks. After some discussion (https://github.com/ssilverman/QNEthernet/issues/15), it turns out that this is expected TCP behaviour. The solution to reduce the waiting time is to either use...
Type: Posts; User: shawn
Thanks. After some discussion (https://github.com/ssilverman/QNEthernet/issues/15), it turns out that this is expected TCP behaviour. The solution to reduce the waiting time is to either use...
It is not strictly necessary; it’s there, however, for completeness. Setting the DNS with the QNEthernet-style API matches the Arduino-style API that you were using before with NativeEthernet. With...
Here's some illustrative code that should work with QNEthernet. (Caveat: I'm not near a Teensy so haven't tested it.)
#include <QNEthernet.h>
using namespace qindesign::network;
...
Thanks for the report. Could you file an issue in the GitHub repository? See here: https://github.com/ssilverman/QNEthernet/issues
(If you don't have an account there, let me know and I'll file it...
QNEthernet is mostly a drop-in replacement, but there are additional features that I think make the library easier to use, more robust, and more functional, once you learn how to use it. But at the...
Have you tried using the regular Arduino IDE and not Teensyduino for the non-Teensy devices?
Another method is to convert them to C-style arrays in an include file and then ensure they stay in flash via the PROGMEM attribute.
Here's a modified version to work with QNEthernet. I'm curious how it works for you. I took the liberty of modifying the structure to be closer to how I would do it.
#include <QNEthernet.h>
...
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,...
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...
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...
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...
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...
Do you feel like trying QNEthernet instead of NativeEthernet to see if the issue still exists?
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...
What does the return value of waitForLocalIP() give? You need to check that to see if an IP address was actually acquired.
There’s also wolfSSL.
I believe TLS sits on top of TCP/IP. I have no current plans to add it to the library. (Let me see what lwIP has…)
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:...
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...
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...
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...
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...
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...
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 just released v0.14.0 of the library. The changes:
## [0.14.0]
### Added
* Added a `util::StdioPrint` class, a `Print` decorator for stdio output files.
It routes `Print` functions to...
It looks like there are conflicting defines.
Here's my quickie test programs. I've never seen it fail on the receiving Teensy. I always see "size=1" printed.
Question: Once you see the packet size change to zero, does it ever go back to being...
One major thing I noticed about the code is that you're printing strings without a guaranteed NUL terminator. `Udp.write("1")` only sends one byte. Then, when it's received into `data2` on the other...
You’re saying that parsePacket() never returns non-zero when you send packets? Could you provide a simple example program that you know exhibits the problem?
When using QNEthernet: What are you seeing for the return value of endPacket()? Also beginPacket() and write()? For write(), does the return value match the number of bytes sent?
This might help: https://github.com/ssilverman/QNEthernet/blob/master/examples/SNTPClient/SNTPClient.ino
Note that the EthernetFrame API won’t receive any known frame types. These include IP (including UDP and TCP) and ARP.
What do you think of this instead:
// Give Ethernet some time to initialize
#if USING_DHCP
if (!Ethernet.waitForLocalIP(10000)) {
// do stuff
} else {
// do other stuff
}
Gotcha. Sounds like the FTP server code could be more clever. Thanks for that update.
Here's what I believe happened: The fault is in the FTP server library that likely opens sockets until they're all used up (because of the all the PASV requests), and then the client hung on to them,...
A few points:
1. Change defines in lwipopts.h instead of via build options in platformio.ini because lwIP may overwrite defines you put in the build command with the ones in the source code.
2....
I think I figured it out; there appear to be two factors:
1. The "route error" (ERR_RTE=-4) is because the link isn't yet detected to be up when a connection is attempted. To solve this, after...
What are you setting the netmask and gateway to? Also, what are these values when using DHCP?
@khoih-prog What do you see when you change to a static IP? Also, do you have a suggestion for the quickest way to create a WebSockets server (preferably on a Mac)? (I haven't looked much yet...)
I loaded the `Teensy41_Client` example and changed:
1. The IP, subnet mask, gateway, and DNS to something suitable,
2. Changed USING_DHCP to false,
3. Commented out the <TeensyID.h> and <SPI.h>...
@danielkr I was able to move lwiIP's heap to RAM2, so this should clear up some space. See the latest on GitHub.
If you're using PlatformIO, delete `.pio/libdeps/teensy41/QNEthernet`, make sure...
@DaniO: this might be relevant: https://forum.pjrc.com/threads/69613-NativeEthernet-socket-size-bug?p=301188&viewfull=1#post301188
It talks about larger UDP packets and IP fragmentation. There's...
In the QNEthernet library, should someone find this thread:
1. There's full multicast support. See: https://github.com/ssilverman/QNEthernet#how-to-use-multicast
2. In addition, you can find the...
@hijomojo: This might be relevant: https://forum.pjrc.com/threads/69613-NativeEthernet-socket-size-bug?p=301188&viewfull=1#post301188
It talks about larger UDP packets and IP fragmentation....
Thanks! It’s also accessible from the Arduino library manager, plus via PlatformIO using the GitHub URL. I do think it’s Teensyduino installer-worthy, but that’s up to Paul, I suppose (I haven’t...
@MartyBrown yes, this is my library :) I wrote it because I needed something that didn’t use a timer. Also, I figured that providing a library that used a different underlying stack (I also thought...
Do you experience the same problem using the QNEthernet library? Note: the initialization is simpler than what you have in your demo code. See the examples for a few ways to initialize.