S
Reaction score
34

Latest activity Postings About

    • S
      Filing an issue with the FastLED project might also be helpful.
    • S
      I have a hunch it was because it wasn’t just included, but some functions were used.
    • S
      Pro tip: you can format your code by wrapping your code in “CODE” tags or by pressing the “</>” button in the editor. That will make the code in your questions easier to read.
    • S
      It’s timing out (-1). See: https://www.arduino.cc/reference/en/libraries/ethernet/client.connect/ Are you sure the IP, netmask, and gateway are correct for your network? The values I put in the example may not be the values you need. But maybe...
    • S
      shawn replied to the thread USBTMC Callback functions.
      The technique will be the same whether you use std::function or the new lightweight function type. It’s because there’s a need to “impedance match” C functions to C++ function objects. See what @luni does here...
    • S
      I've made a simpler example for you: #include <QNEthernet.h> using namespace qindesign::network; // Note: This example uses stdout for serial output, but you can use // Serial if you like instead. // Change these to what you need: const...
    • S
      It looks like it’s not getting an IP address; that 169.* address is self-assigned. Do you need to use a static IP? The delays you’re seeing are from the pause before it realizes it hasn’t gotten an address from DHCP. The way that example is...
    • S
      I just released v0.27.0. Here's the Changelog: ## [0.27.0] ### Added * New `QNETHERNET_FLUSH_AFTER_WRITE` configuration macro for flushing after every call to `EthernetClient::write()`. This may reduce TCP efficiency. * Added a W5500 driver...
    • S
      Here's a basic HTTP client example that works: #include <QNEthernet.h> using namespace qindesign::network; // Tracks if the network is up. bool networkReady = false; // Note: This example uses stdout for serial output, but you can use //...
    • S
      I can help you out with some things in C++. If, however, you need something in Python, I won’t be much help, currently.
    • S
      My understanding is this: when you press a button attached to a Teeny, the Teensy makes an HTTP request to a server running elsewhere. In other words, the Teensy is an HTTP client. Is my understanding correct? How does the Teensy know when to...
    • S
      Can you show the compiler output? That will point to the specific error.
    • S
      shawn reacted to SteveSFX's post in the thread Teensy 4.1 DIN rail system with Like Like.
      Hello all I have been tinkering around with a DIN rail mounted 4.1 system and it is actually coming out quite well! The main CPU module has the 4.1 in it with a 36 way bus that runs the length of all the slave modules. It incorporates a...
    • S
      First check out the ServerWithListeners example in the library. That’s the beginnings of one way to write a server that can track multiple clients. (There are other ways too.) I’m happy to chat with you off-list, too, if you send me a message.
    • S
      It’s compatible with the Arduino-style Ethernet API with a bunch of extra stuff. See the included README (in the library directory or here: https://github.com/ssilverman/QNEthernet)
    • S
      Unfortunately, there’s no great non-commercial web server library that I could find. I use the basic Arduino-style API provided by QNEthernet for my servers.
    • S
      shawn replied to the thread c++17 std::optional.
      Good news is that with the latest Teensyduino 1.59 release on PlatformIO, the default is now C++17. No need to add or remove flags. Note that you might need to run pio pkg update from the command line to get the latest. (I’m not actually sure if...
    • S
      Note that this web server library doesn’t really use QNEthernet for its operation. It only uses the initialization and the included lwIP stack code.
    • S
      shawn replied to the thread Another newbee.
      This is correct C++: Pot *POTS[]{&PO1}; It’s the direct list initializer form and is my personal preference.
    • S
      Here’s a thread which contains some relevant info (even though you figured it out): https://forum.pjrc.com/index.php?threads/inherent-latency-in-ethernet-modbus-over-serial-with-teensy-4-1.74454/ I posted some links and also a new QNEthernet...
    • S
      shawn replied to the thread relay module with Teensy 4.1.
      You’ll need a level shifter because the Teensy 4 uses 3.3V.
    • S
      I’ll also point out a potential gotcha with optionals. If using them to hold booleans, it’s easy to confuse using the implicit presence-testing for accessing the value, if you’re not careful to use the accessor operators or functions. Instead...
    • S
      Indeed. See also C++23’s std::expected and C++11’s std::exception_ptr for some additional fun. Next, look up “monad”… I struggle with having/wanting to support these very old APIs. I have some thoughts on API layering so I don’t have to be...
    • S
      A few comments: 1. No need to use dynamic memory to create EthernetServer and EthernetUDP. Simply declare them like EthernetServer server{3260}; and EthernetUDP handle;. 2. For EthernetServer specifically, QNEthernet improves the Arduino-style...
    • S
      It’s possible to hook up a filesystem to your own definitions of _open(), _unlink(), etc. You’ll need your own filesystem, however. I use the “FS” filesystem interface that’s included with the Teensyduino core. You could plug in whatever...
    • S
      I’m curious, does initialization order matter? For example, if you initialize CAN first instead of Ethernet. Also, you need to account for millis() wraparound. Either compare with subtraction to a timeout value or use elapsedMillis instead...
    • S
      shawn replied to the thread Onboard LED.
      Also note that this pin is the same as the default SPI clock pin, so if one runs SPI, the LED will flicker, indicating clock activity.
    • S
      shawn replied to the thread Onboard LED.
      Also the LED_BUILTIN constant.
    • S
      You’re welcome. I cannot claim much PlatformIO work, however, other than some how-to posts about it and an EHEX PR in their repo. :) I did write the QNEthernet library, however.
    • S
      Here's how that server library is using the QNEthenet library: It uses the initialization code and the Ethernet ISR, but nothing else. It uses the lwIP API, otherwise, for its entire function (a slightly-modified copy is included with...
    • S
      I just added an option to flush after all write calls. Other than the issue of write() not actually sending all the bytes (eg. because of internal buffers and such), just setting this new option in qnethernet_opts.h should duct tape the original...
    • S
      shawn replied to the thread Receiving Multiple DMX Universes?.
      I’ve got one more thing for you to try: void loop() { bool doShow = false; read = dmxRx1.readPacket(packetBuf1, 0, 513); if (read >= 13) { for (i = 0; i < ledsPerStrip; i++) {leds.setPixel(i, packetBuf1[1], packetBuf1[2]...
    • S
      shawn replied to the thread Receiving Multiple DMX Universes?.
      I’m stumped as to why the Teensy 4.1 is behaving differently than the Teensy 4.0. Are you using the exact same code on both of them?
    • S
      shawn replied to the thread Receiving Multiple DMX Universes?.
      You must use at least "13" because you can't read index 12 (packetBuf[12]) without there being at least 13 valid bytes in the array. read >= 13 is correct, but read != -1 is not, and neither is comparing to "1" or "12" or anything less than "13"...
    • S
      You’ve given me the idea to add multiple interfaces to the QNEthernet library. Right now, it supports either the native Ethernet or the W5500 (this driver is not yet committed, but it’s in a discussion comment in the repo on GitHub). No promises...
    • S
      shawn replied to the thread Receiving Multiple DMX Universes?.
      What happens if you replace both occurrences of if (read != -1) with if (read >= 13)?
    • S
      shawn replied to the thread Receiving Multiple DMX Universes?.
      I’d love to help, but there isn’t any information other than the project “occasionally glitches.” The cause could be anything, and not necessarily the DMX library.
    • S
      Yeah, I expect it to be about the same speed. It’s just the proper way because write() may not send all the bytes requested of it. Since you’re using something like Modbus, I’m guessing that reliability is important to you. Yes, it looks similar...
    • S
      shawn replied to the thread Receiving Multiple DMX Universes?.
      I’m not sure what “glitch” means here. Also, there’s no code, so I don’t know what’s happening. It could be your code and not the library. There’s a gazillion factors.
    • S
      You’re right about writeFully(). I didn’t look at that Modbus library closely. They’re using “Client” and not “EthernetClient”. Ignore the writeFully() note for now. (But write() calls should still technically be called repeatedly until they’re...
    • S
      I just realized that all the bytes still may not get out. Any write() calls (with any library, really) should have their return values checked and then any unsent bytes should be re-sent. write() doesn't always send all the bytes it's given. A...
    • S
      I’ll add: it’s not correct to always assume some write() call (on, say, the Arduino Print interface, which many types of objects implement) completes without buffering. Unfortunately, many programs and libraries assume this. See...
    • S
      A couple of things I noticed at first glance: 1. There's no need to specify a MAC address on the Teensy 4.1 because there's a built-in one. May I suggest using the begin(ip, netmask, gateway) function instead? As well, the one you're actually...
    • S
      If you can share a complete, minimal, example that shows the issue, maybe I could have a look. Also describe how to test it.
    • S
      In my experience, I haven’t needed a threading library to do cooperative threading. It’s possible to design a simple API where each “Task” returns from its own main loop when it’s done or needing to yield. Doing a yield() via a threading library...
    • S
      shawn reacted to PaulStoffregen's post in the thread Teensyduino 1.59 Beta #6 with Like Like.
      I'm packaging up a final 1.59 release now. Going to run several tests and if everything looks good it'll be released this evening.
    • S
      For convenience, here's the contents of that file: Import("env") print("Current CLI targets", COMMAND_LINE_TARGETS) print("Current Build targets", BUILD_TARGETS) def post_program_action(source, target, env): print("Program has been built!")...
    • S
      shawn reacted to Nominal Animal's post in the thread #define placement with Like Like.
      Oh, I just meant that it is nontrivial to do in any case, especially when you only have 320×240 display modules at hand; and not specific to Teensy at all. Making a library too general is feature creep, and since features you cannot test are...
    • S
      shawn replied to the thread Teensyduino 1.59 Beta #6.
      @Paul Yes, it seems to work. What was the fix?
    • S
      shawn replied to the thread Teensyduino 1.59 Beta #6.
      @Paul I’ll try this soon, when I’m next at my laptop; just want to acknowledge I see the link.
  • Loading…
  • Loading…
Back
Top