2.1- Very Slow Serial?

edited October 2013 in Arduino

I have been using 2.0.2 for the last while to run a data visualization program. The program graphs unsigned integers that are received over serial in real time, and I usually run it at about 120Hz, with serial data coming in at about 100 Hz. This has worked very well, but when I try to run it in 2.1 it becomes very, very slow. It still reports 120Hz, but I don't believe it. It is taking about 16 seconds to collect and draw 100 samples, where in 2.0.2 it takes almost exactly one second. That puts it at actually being around 7Hz, which seems reasonable when I just look at it.

Any ideas if this is just because of the change in serial libraries? I looked over the update notes and nothing else jumped out at me as a big change.

Answers

  • I'm having the same problem with http://beatseqr.com ... my project is absolutely mission critical for timing because I play in a live band. to be honest, I can't figure out why this is causing a problem, but unless I have my exported app at the forefront, my arduino and processing apps don't seem to be able to talk to each other after a few minutes.

  • The serial library is completely 100% new for 2.1. We tested it, of course, but things are likely to appear after release. Please post to the GitHub Issues page so it can be looked at as a potential bug.

  • I am seeing the same, except that I do not call it a slowness. What appears to be happening is that the anticipated serialEvents do not occur because the new Processing serial library is not releasing the serial port after processing a serialEvent. In my application, which receives serial data from and also sends serial data to an Adruino like a special purpose serial monitor, the application can receive the serial data from the Ardunio as expected only after first sending any data to the Ardunio. So for example if 24 lines of data is currently expected from the Ardunio machine and an ST command string sent to the Ardunio is supposed to mean "What is the machine's current status?", then 23 sends of ST back to the Ardunio will result in completing the 24 lines of data. The 24th ST send will return the first line of the machine's two line status. An additional send back to the Arduino is required get the second line.

    You must revert back to 2.0.3 for proper operation. As what happened in previous serial libraries that were broken, it might be possible to transplant the 2.0.3 serial into 2.1 on a temporary basis.

  • I'm having the same problem. Very frustrating. I posted an "Issue" to github, as suggested.

  • To everyone experiencing those issues: what operating systems are you using? Is your code using available() and read() inside draw - or serialEvent? What devices (Arduino models) are you having issues with?

    @aks: I am not sure I understand - can you perhaps share your code with me? (gottfried.haider@gmail.com)

    We're looking into it, thanks for your help in fixing this.

  • I am still trying to reproduce this. Please post to this thread information about:

    • your operating system
    • your Arduino model
    • whether you're using the cu- or tty-flavor serial port on OS X
    • the baud rate
    • and whether waiting a couple of seconds before sending data (after opening the serial port) makes any difference

    Feel free to also send me a copy of your sketch as well as the Arduino code (gottfried.haider@gmail.com).

  • I followed the advice to go back to 2.0.3 and my issue with serialEvent() was immediately solved. "gohai" let me know that this known bug was addressed with the current git (https://github.com/processing/processing/commit/9541cbb85da2aa38a585c45a25214a651c724e9f). Thanks to him for the quick response! I plan to stick with 2.0.3 for now.

Sign In or Register to comment.