S
Reaction score
35

Latest activity Postings About

    • S
      shawn replied to the thread Teensy 4.1 serial USB crash.
      In WS2811-and-Octo-land, the strip is likely to operate at 800kHz, 1.25us per bit. There are 24 bits per pixel and maybe 300us between frames. This means that for N pixels in the longest strip, each frame is about N*24*1.25 + 300 microseconds...
    • S
      shawn replied to the thread EtherCat on Teensy 4.1?.
      According to this Wikipedia page, EtherCAT has an EtherType of 0x88A4. You could at least monitor the traffic if you wanted some visibility.
    • S
      shawn replied to the thread EtherCat on Teensy 4.1?.
      I’m not sure if it helps, but the QNEthernet library can do raw Ethernet frames. I’m also making a small update so that the library can be built without any IP support (IPv4, etc., and any protocols built on top), should you not want those...
    • S
      I also wrote a W5500 driver, that works with the QNEthernet library, so you can see what I do there: https://github.com/ssilverman/QNEthernet/tree/master/src/drivers
    • S
      I see this problem too with large HEX files when I have some script or something that waits for upload-complete. I think the problem for me is that the Teensy Loader program indicates that it’s finished before it’s actually finished.
    • S
      See here for how to install Mbed TLS: https://github.com/ssilverman/QNEthernet/blob/3715188da72431325a6a61273e652520e75bd0b6/README.md#how-to-enable-mbed-tls
    • S
      I just added a step 4 to the instructions: copy the contents of the example’s sample config into the mbed library’s src/mbedtls/config.h.
    • S
      Check out the MbedTLSDemo example. I was able to connect to external HTTPS servers with it. It’s a little bit more involved to set up with certificates and specific functions and things, but I’d say the demo is workable as a starting point.
    • S
      That was a much more helpful answer than mine… thanks, @defragster!
    • S
      Next level (or lower?) tip: In IDE 1 or 2 [command may be different in other IDE] do: Ctrl + T : 'Auto Format' Copy & Pasting code after that assures some uniform formatting and indenting. This Ctrl+T is also handy when unclear/Random Build...
    • S
      I chuckled when I saw this. :) One of the things that wrapping it in the code tag helps is the formatting. Lines can have indents too. Unless… did all your code between the braces line up with the first column?
    • 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.
  • Loading…
  • Loading…
Back
Top