Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: DrM

Page 1 of 4 1 2 3 4

Search: Search took 0.00 seconds.

  1. @FrankB You can find similar reports on other...

    @FrankB You can find similar reports on other forums related to Arduino. It turns out it is a common and well known problem.

    We really need to do the experiment with c-code and a single port...
  2. @FrankB Well that remains to be proven,...

    @FrankB Well that remains to be proven, actually. I suspect you are right, except that it happens on both Windows and Linux platform and the compiled part of the code is different for those...
  3. @FrankB Am I right in assuming that you feel...

    @FrankB Am I right in assuming that you feel the wrong usage is connected to the idea that a hang is somehow cured by re-sending the remaining bytes?

    That really is mind-boggling.

    We see...
  4. @all So, can anybody tell me how to edit the...

    @all

    So, can anybody tell me how to edit the title of a thread?

    If I could, I would change the title to refer to the specific condition under which it fails, "single bidirectional port"
    ...
  5. @FrankB for the unidirectional port it seems...

    @FrankB for the unidirectional port it seems quite fast enough. I will probably measure it, but I can see that it is good. It is much much faster than the same transfers over a single port used...
  6. @luni Yes, we have something that seems to...

    @luni Yes, we have something that seems to work. But I am not sure that does not mean there is still a bug.

    i think the interesting experiment is to try bidirectional transfers over one or...
  7. @Luni, we cross-posted We need a mutex. I...

    @Luni, we cross-posted We need a mutex.


    I have to get started on my actual work now. Thank you for the multi-port example. I will probably implement it in the teensy that is sending the...
  8. @Luni Listen Luni, your multi-port code is...

    @Luni Listen Luni, your multi-port code is wondeful, and it seems to work robustly. And in fact, I added a resend counter. It has not ever gone back to pick up an unsent piece. And that...
  9. @Luni No Luni, it hangs. As shown in the...

    @Luni No Luni, it hangs. As shown in the original post. You cannot resend if it has hung. You are focusing on an unrelated issue, and one that I am well practiced in from the time...
  10. @WMXZ line 95, written +=...

    @WMXZ line 95,




    written += Serial.write(frame + written, frameSize - written);
  11. @FrankB What you are saying is not making...

    @FrankB

    What you are saying is not making sense to me. Take a look, he has three channels; recv from ctrl, send through serial, and send through dbg. And in fact, Python keeps up very...
  12. @luni @frankb @degragster (and of course, @Paul)...

    @luni @frankb @degragster (and of course, @Paul)


    I just tried Luni's code on Linux, it works great.


    So, using multiple ports works on both platforms. Using one port fails on both...
  13. @luni @frankb @degragster (and of course,...

    @luni @frankb @degragster (and of course, @Paul)

    The point of the snippet was to show that it hangs. After that, you cannot send the remaining part of the buffer.

    So why does Luni's...
  14. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @PaulStoffregen I started a thread for...

    @PaulStoffregen

    I started a thread for the Serial transfer problem and provided code and results,

    ...
  15. Test of Serial Transfer, fails for large transfers

    The following demonstrates a problem I am having with the Serial interface on the Teensy. Large transfers fail as shown below.


    Code snippet from Teensy 3.2


    case 'v':
    case...
  16. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @FrankB PyUSB seems pretty good actually. I am...

    @FrankB PyUSB seems pretty good actually. I am using it for this, and to talk to the usb adapter for an ocean optics spectrometer. It is layered on libusb.
  17. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @FrankB Just picked up on a detail in your note....

    @FrankB Just picked up on a detail in your note.

    According to Paul, flow control is built into the USB protocol that transfers the serial data. It sounds like it is supposed to be a reliable...
  18. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    Well there are plenty of posts on other forums on...

    Well there are plenty of posts on other forums on transfer problems over serial for arduinos. If there is a bug it's in pyserial or the serial driver.

    The original post was about performance for...
  19. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @frankb I am not sure that the teensy monitor...

    @frankb I am not sure that the teensy monitor will survive prolonged high speed transfers, or how you would prove it. For one thing it probably couldn't keep up in the display. So it is not really...
  20. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @FrankB, I tried slowing down the transmit. It...

    @FrankB, I tried slowing down the transmit. It does not work at any reasonable speed. I tried everything one might think of except coding a compiled task to act as a user space intermediate...
  21. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @defragster Do you have the host side of that,...

    @defragster Do you have the host side of that, for Linux? I think the operative word is that it kept up, it was running C, and nothing else was happening.

    What happens when the machine is...
  22. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    Here is a collection of only slightly cryptic...

    Here is a collection of only slightly cryptic comments on the problem with serial receive from a Teensy, in general and in pyserial. So, it's not just me.

    ...
  23. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    P/S @PaulStoffregen "In practice", in this...

    P/S @PaulStoffregen "In practice", in this instance, means with the Teensy. I see the data drops and hangs on the said Linux platform receiving large data transfers from the teensy 3.2


    I...
  24. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @PaulStoffregen When you say , write your own...

    @PaulStoffregen When you say , write your own software to receive USB serial data, and use a buffer upto 32K, what API are you using? Is that available say, in IOCTL? Or do you mean write...
  25. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @FrankB I think everyone is not...

    @FrankB I think everyone is not understanding the problem regarding transfers from the Teensy to the host using the serial interface.

    Here is an example

    ...
  26. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @defragster @luni The example you cited,...

    @defragster @luni The example you cited, seems to be about transfer from computer to Teensy. That is not what we are talking about.

    We are talking about transfer from Teensy to the host...
  27. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @defragster Serial transfer in back to back...

    @defragster Serial transfer in back to back units larger than the 4K receive buffer in the serial driver is not reliable. It will always depend on speed and load of the host. And, computer...
  28. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @luni Then it seems the answer is that we need...

    @luni Then it seems the answer is that we need a USB interface that does not involve HID.

    Some of that must be in the code base already.
  29. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    @defragster The Serial interface is unworkable...

    @defragster The Serial interface is unworkable for this because of the limited buffering in serial drivers, both linux and windows.

    My transfers are 7.4K or 15K, (remember that 4k buffer in...
  30. Thread: RAHID performance

    by DrM
    Replies
    40
    Views
    2,216

    RAHID performance

    Using RAWHID to send data, and reading with PyUSB, the data transfer rate seems to be about 15usec/byte, or 67 kB/sec.

    On the Teensy (3.2, 96MHz), it is simply looping over



    RawHID.send(...
  31. Replies
    524
    Views
    477,565

    @frankzappa Well that is interesting indeed. ...

    @frankzappa

    Well that is interesting indeed. So the ADC's are configured identically (averaging, speed, amplifier, etc)?

    The engineers at NXP are pretty knowledgeable, it would be a big...
  32. Replies
    524
    Views
    477,565

    @frankzappa As I recall, on the Teensy 3.2...

    @frankzappa

    As I recall, on the Teensy 3.2 those channel combinations use the same ADC in one case, and different ADC's in the other.

    I notice you have the ADC's set for different speeds. ...
  33. Thread: Rawhid

    by DrM
    Replies
    14
    Views
    1,047

    @luni and @PaulStoffregen, I just posted a...

    @luni and @PaulStoffregen, I just posted a minimum code using only PyUSB to talk to a RAWHID Teensy.

    See https://forum.pjrc.com/threads/67561-RAWHID-and-PyUSB
  34. Thread: RAWHID and PyUSB

    by DrM
    Replies
    0
    Views
    245

    RAWHID and PyUSB

    Here is a simple Python program using only PyUSB to talk to a Teensy running RAWHID


    #!/usr/bin/python

    import usb.core
    import usb.util

    dev = usb.core.find(idVendor=0x16C0,...
  35. Thread: Rawhid

    by DrM
    Replies
    14
    Views
    1,047

    I started a new thread with the zip, ...

    I started a new thread with the zip,

    https://forum.pjrc.com/threads/67520-RAWHID-demonstration-program


    Do you prefer it be posted here?

    (I hesitate to duplicate the posting, but either...
  36. Replies
    0
    Views
    214

    RAWHID demonstration program

    Attached is a "sketch" and python program to demonstrate use of the RAWHID.

    The sketch demonstrates data transfers in both directions and simple command processing. The python side includes an...
  37. Thread: Rawhid

    by DrM
    Replies
    14
    Views
    1,047

    @luni, @paul Okay, I have an example RAWHID...

    @luni, @paul

    Okay, I have an example RAWHID and Python class and program to demonstrate how to configure and communicate with the RAWHID.

    How or where should I upload it?
  38. Replies
    3
    Views
    349

    That's wonderful. Thank you.

    That's wonderful. Thank you.
  39. Thread: Rawhid

    by DrM
    Replies
    14
    Views
    1,047

    I rewrote the firmware a little, and wrote a...

    I rewrote the firmware a little, and wrote a Python Class to talk to it. I can send them if you like and you can see if you want to use them. I've moved on now to using it in an application so I...
  40. Replies
    3
    Views
    349

    RAWHID custom device identifier

    The goal of this question is to find the Teensy boards that are communiticating over RAWHID and programmed to run a particular application.

    For example, one Teensy might be programmed to act as a...
  41. Thread: Rawhid

    by DrM
    Replies
    14
    Views
    1,047

    I have it, the python api, it is called HIDAPI. ...

    I have it, the python api, it is called HIDAPI. I have other issues with it now. It returns ints rather than bytes despite the representations of the documentation.
  42. Thread: Rawhid

    by DrM
    Replies
    14
    Views
    1,047

    The usage_page and usage are both 0 for both...

    The usage_page and usage are both 0 for both interfaces. Here is a code snippet:



    import hid

    for h in hid.enumerate(vendor_id = 0x16c0):
    print(...
  43. Thread: Rawhid

    by DrM
    Replies
    14
    Views
    1,047

    @luni Thank you, that is very helpful,...

    @luni

    Thank you, that is very helpful, especially the link to the code.

    Instead of HID, and the HID API, can I just write and read to and from the endpoints?

    There is a usblib and PyUSB...
  44. Thread: Rawhid

    by DrM
    Replies
    14
    Views
    1,047

    Rawhid

    Hi,

    Running the USB RAWHID example in a Teensy 3.2, and python hidapi library, hid,enumerate() returns two device interfaces,

    The packets seem to appear on both, even if open at the same...
  45. Replies
    0
    Views
    217

    RAWHID example, and Python

    Is there a python program to go with the RAWHID example?

    The python program mentioned at https://www.pjrc.com/teensy/rawhid.html, is out of date and seems not compatible with python's native hid...
  46. Thread: Command Line Build

    by DrM
    Replies
    28
    Views
    5,166

    What? Read the document? Actually, i...

    What? Read the document?

    Actually, i didn't notice the link. I'll take a look at it. Thank you
  47. Thread: Command Line Build

    by DrM
    Replies
    28
    Views
    5,166

    @luni You have these lines in your make file. ...

    @luni

    You have these lines in your make file. I am wondering how they would translate to my project, or if they are needed.


    BUILD_PATH :=...
  48. Thread: Command Line Build

    by DrM
    Replies
    28
    Views
    5,166

    @KurtE that sounds like a simple approach, I was...

    @KurtE that sounds like a simple approach, I was thinking along those lines, but did not find the switch for verbose in the gui.

    @luni that seems very interesting. Are build_path and...
  49. Thread: Command Line Build

    by DrM
    Replies
    28
    Views
    5,166

    A possible solution, command line arduino

    I found a possible answer, here

    https://forum.arduino.cc/index.php?topic=713456.0

    The following command seems to work, in so far as uploading or verifying,


    # arduino --pref...
  50. Thread: Command Line Build

    by DrM
    Replies
    28
    Views
    5,166

    Has anybody tried this: ...

    Has anybody tried this:

    https://github.com/sudar/Arduino-Makefile


    It has a Teensy.mk
Results 1 to 50 of 167
Page 1 of 4 1 2 3 4