Search results

  1. M

    Future Teensy features & pinout

    Besides WiFi, the ESP32 can use be used for bluetooth/ble. At least I have heard it can be used for either. -Mark
  2. M

    TeensyNetworkHub

    It's all good. I went to the "these are the things that have changed" part of your readme, and figured out what was different pretty quick. Your explanation and rationale was spot on. Any pointers for the 'disallow copy but allow move' part of my earlier question? And thanks for the QNEthernet...
  3. M

    TeensyNetworkHub

    Adding support for QNEthernet was super easy since it supports the basic Arduino ethernet classes/architecture. It took me like an hour to add, and another hour to work out some kinks (like UDP.parsePacket() returning -1). But it is looking great. If interested, you can download the current...
  4. M

    TeensyNetworkHub

    Good to know! This will be a test of how easy it is to add another integration...:)
  5. M

    TeensyNetworkHub

    I've been using the Adafruit WiFiNINA library for my projects that used WiFi for connecting to my network and the internet using the AirLift/ESP32. I've recently started moving those projects to the Teensy 4.1 with ethernet support added. And I really didn't want to go though my code to switch...
  6. M

    OTA through Ethernet with Teensy 4.1

    And with that comment, I did not mean to imply that the FlasherX was doing gltichy brick updates before. Just my case of doing stuff over TCP was being gltichy for the reasons we've been discussing. Which was not an original use case for the code. Just to be clear. :-) FlasherX is great work...
  7. M

    OTA through Ethernet with Teensy 4.1

    Ultimately, I don't think I have control over how or how large the packets are being sent. I could try to write code to bundle into packets, but the TCP layer will have more control than I do, I think. It may try to optimize packets and contents. The introduction of the timeout threshold doesn't...
  8. M

    OTA through Ethernet with Teensy 4.1

    Yes, you're picture is my thousand words. :D Yes. I am sending the .hex file generated by the IDE, slightly modified to have the file size and CRC32 value at the beginning of the file. I'm using linux, so I don't entirely understand why the .hex file has CRLF instead of just CR, but I can...
  9. M

    OTA through Ethernet with Teensy 4.1

    Hey Joe, The signature of the method hasn't changed except for the addition of the bool* to hold the streamHasCRLF value between calls. maxbytes is the total number of bytes available to the char* line. As far as my setup, I have two Teensy 4.0s. The first one is connected to WiFi and is...
  10. M

    OTA through Ethernet with Teensy 4.1

    I would like to submit this new version of read_ascii_line. I was looking at handling UART the same way I handled TCP, but ran into issues with data not always being available and then getting bad hex lines as a result. This version handles it by processing until the max bytes read, a CR (or...
  11. M

    OTA through Ethernet with Teensy 4.1

    Hey Joe, There are these lines of code in FXUtil.cpp : // reliability of transfer via USB is improved by this printf/flush if (in == out && out == (Stream*)&Serial) { out->printf( "%s\n", line ); out->flush(); } I understand that it is detecting a case where the USB...
  12. M

    OTA through Ethernet with Teensy 4.1

    Alright, I updated my TeensyOTAViaTCP repository to integrate CRCStream into the FlasherX code. It ALMOST worked like a charm the first time, except for the read_ascii_line method was leaving the last line feed unread. I modified that method as below, detecting when a stream has CRLF at the end...
  13. M

    OTA through Ethernet with Teensy 4.1

    OK, I think that a big part of the problem I was seeing yesterday was with the DynamicArray itself. I think it might have been growing, but the data wasn't being appended correctly. I also think there was something funky with the way I was using available and read. Regardless, I switched gears...
  14. M

    OTA through Ethernet with Teensy 4.1

    I was hoping there is some way to control/set the buffer used for the internet/wifi/tcp transactions. But I haven't found anything so far. Like I mentioned to Joe, I'm not sure how this ever worked before with my original tcp example. I feel like the example program would have been larger than...
  15. M

    OTA through Ethernet with Teensy 4.1

    I'd have to go back and check, but I think this program is around 175K bytes for the hex file. But I don't think the problem is with actual space on the Teensy 4.0. The dynamic array only grows to the 5-10K size and then the data just stops. And if I look at the data received, it ends up being...
  16. M

    OTA through Ethernet with Teensy 4.1

    I started using my OTA via TCP code for a project I am working on, and some times it would brick my Teensy (which was fixed by connecting to the USB and uploading directly). So, I started looking into adding some kind of CRC check. I have a script that will take the .hex file and prepend the...
  17. M

    OTA through Ethernet with Teensy 4.1

    And thanks to AndyA as well. I really appreciate the community here in the Teensy forum. -Mark
  18. M

    OTA through Ethernet with Teensy 4.1

    Ah. OK, I see what happened. I tried using the 2.3 release zip, was confused as to why the 4 files were not included, copied over the two that were there (one of which was a FlashTxx.cpp), and then hand copied the FXUtil files. I didn't notice that the current repo has FlashTxx.c instead. You...
  19. M

    OTA through Ethernet with Teensy 4.1

    So, I fixed my issue with AirLift getting into a bad state, and I started on the code to perform the actual update. I'm sorry if this is completely stupid, but now I am getting link errors when trying to build the sketch. I added FXUtil.cpp/.h and FlashTxx.cpp/.h to my Arduino project, and in...
  20. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    Great instructions. The only difference is that on my board reset is labeled "RST" instead of "EN". So, forsalebypwner, let me guess...you are powering your circuit with 5v and not 3.3v? How do I know? I hooked up this new board, and in the process I was trying to see if it required 5v or 3.3v...
  21. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    The pinouts on this new board aren't very breadboard friendly with the double row of pins on each side, but I'll solder in some headers and get a harness together. If I use this board I might create a simple 'companion' board to match the AirLift pin outs. Be back in a little bit with my...
  22. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    I ordered a set of boards that I hope are the right ones. It said D1 Mini ESP32, so here's hoping. Should be here some time tomorrow, so I can continue then. Did you load the Adafruit firmware onto your board as well? -Mark
  23. M

    OTA through Ethernet with Teensy 4.1

    I used the trick using the Teensy loader to find the hex file. The Arduino 1.8.XX IDE on Linux creates temp build directories in the /tmp directory. Looks like a directory is created for each sketch and the directory sticks around until the IDE is closed. Nifty.
  24. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    OK, I'm back with the same issue, but a different way to reproduce it. I still have the 1.7.4 firmware loaded into the AirLift board. I slightly modified the code from forsalebypwner to set the SPI pins and begin SPI (though I don't think it makes any difference), and to restart the teensy 4.0...
  25. M

    OTA through Ethernet with Teensy 4.1

    Thanks for the pointers to the build file. I'll see what I find. Instead of posting my source on the thread, I have it in a github: https://github.com/markwomack/TeensyOTAViaTCP You can check out the latest version. Right now I have it running a normal sketch, and when data is detected on the...
  26. M

    OTA through Ethernet with Teensy 4.1

    AndyA, Thank you for the advice and insights. I will take them to heart as I get ready to start writing my code. I'm not wedded to UDP, TCP would be just as fine as far as I am concerned. Just some pipe to send the data through. I'll update the thread as I progress. thanks again, -Mark
  27. M

    OTA through Ethernet with Teensy 4.1

    Joe, I'd love to see the code for this. It leads me to my next question...where do I get the hex/binary file that I will send over UDP? I'm using the Arduino IDE (1.8.something) on Linux and/or Windows. It must store the binary it builds someplace, but I've never had to worry about that until...
  28. M

    OTA through Ethernet with Teensy 4.1

    Thanks for the reply, Joe! Before I found this thread, the broad strokes of what I was thinking was: 1) Connect to a WiFi network 2) Receive the firmware update via a UDP port, write it someplace 3) Once the entire firmware update has been received and stored, do the update. Lots of hand...
  29. M

    Future Teensy features & pinout

    This has probably been mentioned, but it would be awesome to have a Teensy 4.1 (5?) with builtin WiFi option like the Pico W. -Mark
  30. M

    OTA through Ethernet with Teensy 4.1

    Sorry if this is a dumb question that has been answered...but where this the OTA part of this example coming from? The Teensy is running ethernet, but how is it connected to a different wifi? network? I have a Adafruit AirLift co-processor(basically an ESP32), and I would love to use it to...
  31. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    I guess an actual link to that Adafruit forum page wouldn't hurt either: https://forums.adafruit.com/viewtopic.php?p=967155#p967155
  32. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    Yeah, I upgraded to 1.7.4 and now it is working without any problems (hopfully I won't post another reply in a few hours saying I was wrong...). I don't know why they are shipping the AirLift with such and old version of the firmware. Upgrading the AirLift took a little detective work since the...
  33. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    What version of the firmware does your airlift/esp32 have? Mine has 1.2.2. I'm wondering if this makes a difference. I'm going to look into upgrading it tomorrow.
  34. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    Yes, using 3.3v for everything. The Airlift will take between 3 and 6 volts VIN. I'm even using 3.3v with the Teensy 3.5, and it works fine.
  35. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    I copied your exact code and only made minor changes for the busy and reset pins: #define SPIWIFI_SS 10 // Chip select pin #define SPIWIFI_ACK 8 // a.k.a BUSY or READY pin #define ESP32_RESETN 9 // Reset pin #define ESP32_GPIO0 7 Other than that it is the same. I uploaded it to my...
  36. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    I spoke too soon, I guess. Even though everything was working (I swear it was) after I added the SPI.begin() call as I described before...now it is not. For either the Teensy 4.0 or 4.1 I now get the constant restarting as it is trying to connect to the wifi. The code is exactly the same. And...
  37. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    Thanks for the reply, Paul. I checked the WiFiNINA library and I found a begin call in one of the utility classes. But it is unclear to me that it is called. So, I added one to my code right after setting all of the SPI pins, and now the code is well behaved on both the Teensy 4.0 and 4.1. I...
  38. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    FWIW, this is the relevant code that I use to connect to the Airlift. But I don't think it is a code problem, since it works fine on the Teensy 3.5. const uint8_t WIFI_SPI_CS0_PIN = 10; // SPI CS0 used by Wifi const uint8_t WIFI_SPI_MOSI0_PIN = 11; // SPI MOSI0 uased by Wifi const...
  39. M

    Using Adafruit Airlift breakout board with Teensy4.0/4.1?

    I have successfully used the Adafruit Airlift board with Teensy 3.5 using SCK/CS/MISO/MOSI pins. I used the Adafruit fork of the WiFiNINA library (which allows one to set the MISO/MOSI/etc pins), and I am able to connect to my WiFi and then send debug messages via UDP. It works great. So, I...
  40. M

    Three Phase Encoder?

    Yes, exactly so. Here is the implementation I came up with: https://github.com/markwomack/MotorAndEncoderManager/blob/main/src/ThreePhaseMotorEncoder.cpp My particular motor gets 120 ticks per revolution (using both rising and falling changes). Not the greatest, but I think it will be enough...
  41. M

    Three Phase Encoder?

    A follow-up question specific to this...does this 'standalone' version of attachInterruptEx work with non-Teensy microcontrollers? I'd like to have a version of a quadrature encoder that is not dependent on the teensy and can run on other boards. I looked at the code, and I am unsure of the...
  42. M

    Three Phase Encoder?

    I like that solution. But certainly not out of line with other Arduino classes (ie Serial.begin()), so perfectly acceptable. I have updated the classes on a branch for now (.h here, .cpp here), and tested them on my rig. Soooooo much cleaner now, thank you for this. I feel like the existing...
  43. M

    Three Phase Encoder?

    Great minds think alike. Lol. But it was the thread on gray codes that I was following to its logical conclusion, so thank you. I really like this. It is much simpler than the 50+ interrupt methods used in the existing (Quadrature) Encoder teensy library. But it does introduce (2)...
  44. M

    Three Phase Encoder?

    I updated my ThreePhaseMotorEncoder code to better support state and error checking. The current 'state' of the VUW inputs is recorded, and with every interrupt call it updates the state based on the value of the pin. Because just one bit has changed, there are only two valid choices for the...
  45. M

    Three Phase Encoder?

    I'm not sure I follow that. I guess I'd need to see a picture. I don't see how inverting U by itself does that, unless you mean as a pairing with the non-inverted versions. But as far as state changes, only one phase changes at any given point, rising or falling. But yes, just limiting to two...
  46. M

    Three Phase Encoder?

    Yes, there are three square waves instead of just the two used for quadrature encoders. And they trigger (edge and falling) in U V W order when going forward and W V U when going reverse. These BLDC motors are like the ones used on hoverboards and eScooters. Like I said, I have some working...
  47. M

    Three Phase Encoder?

    I am looking to write code for a generic three phase encoder that you find in bldc scooter motors. I've got a setup where I can read the signals coming from the encoders, and I have written software for some test interrupts to count the 'ticks' as the signals are fired. Which is great. But now I...
  48. M

    Teensy 4.0/4.1 Interrupts Issue

    Thank you for the replies. I will look into those options. But I wanted to also update some exploration I did with the interrupts on the 3.5 and 4.0. I created a simple circuit that has a potentiometer with output connected to both an analog pin (so I could read the level) and an interrupt pin...
  49. M

    Teensy 4.0/4.1 Interrupts Issue

    Sorry, I should have said that my current hardware is using the Teensy 4.0, though I was seeing the same thing with the Teensy 4.1 before.
  50. M

    Teensy 4.0/4.1 Interrupts Issue

    I am writing some code to count the U/V/W encoder signals from a BLDC eScooter motor. The encoder signals from my motor seem to be rather noisy, which I can see on my digital analyzer. However, my code works as expected on the Teensy 3.5 chip, seeing the encoder fire signals in the expected...
Back
Top