`EthernetFrame` is for raw Ethernet frames (probably not what you want here), `EthernetUDP` is for IP-based UDP, and `EthernetClient` is for IP-based TCP.
I'm curious, why are you using `new` to create `EthernetClient`s instead of, say, having a list of them already created? For example:
std::array<EthernetClient, EthernetClient::maxSockets()> connList;
// Or...
The behaviour of those functions is documented here: https://www.arduino.cc/reference/en/libraries/ethernet/
This disambiguation might also help (QNEthernet README):...
I went ahead and filed the issue: https://github.com/ssilverman/QNEthernet/issues/40
I also fixed the problem. Thanks for reporting it.
(For future reporters: Please file an issue in the repo; I may or may not see...
QNEthernet is explicitly not designed for asynchronous use.
See here: https://github.com/ssilverman/QNEthernet/issues/39#issuecomment-1550481187
And here:...
Note that AsyncWebServer (and its AsyncTCP dependency) doesn’t really use QNEthernet; it uses the library’s included lwIP stack (it’s what QNEthernet uses under the covers). My opinion is that those “Async” libraries...
In theory, QNEthernet can run from a single thread, but it's not designed for being used from multiple threads or contexts (one example is some access from an ISR and some from somewhere else). I also find that...
Pro tip: when pasting code, use the "" tags (or the "#" button), and that will keep the spacing and formatting. It's hard to follow when all the leading spacing is missing. (Yes, cut and paste into an IDE that reformats...
Which Ethernet library are you using? Are you able to post your whole program? What error message are you seeing? Is that “no data available” message being printed on the Teensy side or on your PC?
I suspect that...
Here's my general project structure:
1. Main loop() loops through a list of mini "programs" that execute their own loop(). I don't use threading because it can kill performance. For example, I have an LED refresh...
Are you looking to write one yourself or find an already-made one? If the second, contact me privately; I've made several that are used in commercial projects. If the first, can you describe the difficulties you're...
Sorry, I meant in QNEthernet. I don’t see how that would increase complexity, unless you’re using the randomly-generated local port as some sort of ID or something? (Or something else I’m not thinking of.) I was...
You might be able to get away with a single UDP socket instead of two. You can use a single UDP socket for listening on one specific port, and that same socket for sending to arbitrary locations.
I know it's last minute, but I'm hosting one again now. We'll be talking "better Ethernet throughput," per a request.
Update: I had to step away for a little bit; I'm back now.
@beermat - Thank you for the question. I'll begin by summarizing my mental model of the library:
1. It's an Arduino API-style layer on top of lwIP, with the assumption that all network functions are performed from the...
I just released v0.21.0. The changes:
### Added
* Added `EthernetClass::linkIsCrossover()` for checking if a crossover cable
is detected.
* Added entropy-based random number functions, `entropy_random()` and
...
Can you be more specific? I don't understand the question. Do you mean just how you enable VLAN things in general?
Update: Did you mean "setting up VLAN"?
The function signature of `LWIP_HOOK_VLAN_SET` can be found here:
https://github.com/ssilverman/QNEthernet/blob/24c1177975b0ce27604d5b5f209366f17247c8ac/src/lwip/opt.h#L3024
See also `LWIP_HOOK_VLAN_SET`...
Making a structure’s or class’s members volatile disables the ability to use the members as non-volatile; this is not desired. The correct approach is to add volatile-labelled functions, which tells the compiler to...
I don’t agree that elapsedMillis is volatile-safe unless its internal `unsigned long ms` variable is also volatile. It’s true that `millis()` is volatile-safe, but elapsedMillis is not.
Both its assignment operators...
I'm not seeing `volatile` in teensy4/elapsedMillis.h (or in teensy3's version). Am I missing something?
I was going to suggest these other alternatives:
1. C++'s const_cast<>() can remove volatility, but knowing...
Those two Ethernet libraries you mention don’t work with the W5500 hardware. They work with the built-in PHY and the Ethernet Kit. Having said that, maybe you were planning on using the Ethernet Kit?
I can tell you...
You can also see the failure sometimes in the unit tests. Sometimes one of the tests fails to acquire a DHCP address and sometimes the UDP test fails because it doesn't receive an SNTP response within 20 seconds. To run...
Hello, all. I'm seeking some assistance, from anyone that might be so inclined, with an issue I just can't seem to solve when resetting QNEthernet.
I've noticed it myself before. A bunch of discussion about it can be...
I made a branch of QNEthernet that does TDR: https://github.com/ssilverman/QNEthernet/tree/tdr
The DP83825I PHY chip on the Teensy 4.1 has some extra features, such as the ability to do TDR tests. (Side note: it can...
Have you considered using the Ethernet Kit to use Teensy 4.1’s built-in Ethernet PHY? The QNEthernet library, for example, lets you change a number of settings and sizes. I’ve personally successfully used dozens of...
I understand. In any case, I wrote a write-up of how to do this if anyone needs: https://github.com/ssilverman/QNEthernet/blob/d46986e6fef40e9be2e88db56d50239bb0d1b80c/README.md#configuring-macros-using-the-arduino-ide...
Yeah, I decided to do two things: rely on the now-supported printf, and split stdPrint into stdoutPrint and stderrPrint, along with a new QNETHERNET_ENABLE_CUSTOM_WRITE macro.
In PlatformIO, in order to get `IntervalTimer` to compile, this might be needed in your platformio.ini file:
build_unflags = -std=gnu++14
PlatformIO's platform/teensy/builder/frameworks/arduino.py file sets...
I just released 0.20.0. The changes:
### Added
* Added `EthernetFrameClass::size()`, for parity with `EthernetUDP`.
* Added internal entropy functions to remove the _Entropy_ library dependency.
* New...
The problem
I need to add compiler options to a project to enable some features. For example, QNEthernet needs the `QNETHERNET_ENABLE_RAW_FRAME_SUPPORT` macro defined in order to enable the raw frame feature. To try...
Yeah, I hear you. I like to thread the messages properly too. :)
I'm not sure about <random> because I haven't played with it much. Are you saying the exact same code compiled on earlier versions of Teensyduino?
...
Can we see your source code? The errors look like they originate from src/main.cpp and not from ConnectionManager.cpp. Also, can we see your platformio.ini file?
Since `inplace_function` is more likely to be in the standard, its syntax, including sizing for captures, will be well documented. I think the minimum size should be chosen to accommodate the most common use case, and...
Yes, that's the one. And I'm using this define:
#define SG14_INPLACE_FUNCTION_THROW(x) std::__throw_bad_function_call()
In summary: that's equivalent to the call-an-empty-std::function behaviour. It calls...
@jal142 Side fact: If you're just using QNEthernet for its `printf` implementation, Teensyduino 1.58 has new `printf` support, so you don't need to do the `stdPrint = &Serial` thing anymore. (For simple cases, that is.)...
Here's what `terminate()` (approximately) looks like:
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/libsupc%2B%2B/vterminate.cc;hb=cd5dea63a67ccca09f086df98d11d141d0f86f01
It prints some stuff to...
You'll get no argument from me! :) I especially agree that unknown things printed to the serial port isn't the best idea.
I just verified that `std::terminate()` prints to `stderr` by modifying Print.cpp's `_write()`...
I don't see any non-intended output to the serial port (in my programs, but I don't use all the features mentioned in the list below), so I think it's fine. I don't see a lot of `printf` calls in the core libraries....
I think that's just how `std::terminate()` works. Here's the output if I call `std::terminate()` (from <exception>) myself:
terminate called without an active exception
I'm not certain, but I have a feeling...
Maybe it's the new toolchain. I had forgotten about that post... :) Maybe that's why it works now, because I didn't know (or, didn't remember) that it didn't work. :p
I get a compile error if the parameters are...
There might be a better way to work with exceptions and the CrashReport. I was experimenting with calling an uninitialized `std::function<void()>`, and the terminal printed this:
terminate called after throwing an...
Here's what I'm doing in my programs (and in QNEthernet) to play around with different function types. Of course, I built this on top of @luni's very hard work. I simplified it just a little bit and did what I felt was...