Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: teensy 4.1 tcp socket issue

  1. #1
    Junior Member
    Join Date
    Aug 2020
    Location
    UK
    Posts
    3

    teensy 4.1 tcp socket issue

    Hi,

    Loving the 4.1's capabilities, using platformio as an environment with Arduino libraries is great.

    I have been building a simple serial to tcp converter and used the availableForWrite() to restrict the number of bytes we would send on a socket with the following used to get value

    unsigned int NetCanTake = Client.availableForWrite();

    This always returns 0, had a similar issue in some code in a simple HTTP server, we have to send and use the return value to let us know what was sent rather than restrict sne request to what is possible. Is this a known issue?

    A second issue is that my teensy 4.1 does not run the code when its connected to a power source, seems to need code downloading each time, and I had expected it to auto run, not done so much on this yet but its a concern and maybe I'm missing something I need to do?

    Final query, is connected a SWD debugger by segger jlink or similar easy? any guidance on this?

    Thanks,

    David

  2. #2
    Quote Originally Posted by datkins47 View Post
    Hi,

    A second issue is that my teensy 4.1 does not run the code when its connected to a power source, seems to need code downloading each time, and I had expected it to auto run, not done so much on this yet but its a concern and maybe I'm missing something I need to do?


    David
    Many of the example code snippets have this at the top :

    Serial.begin(9600);
    while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
    }


    This is useful when developing as it waits for you serial-over-usb connection to appear before continuing, so you don't miss early debug output. It's less useful when you want the teensy to run standalone as it will wait forever for the USB connection.

    Is that, or any other USB dependency, present in your test code ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •