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

Thread: Pi Looper/Teensy/Puredata Write Errors

  1. #1
    Junior Member
    Join Date
    Aug 2019
    Posts
    8

    Pi Looper/Teensy/Puredata Write Errors

    Hello,

    I'm new to this, so I do apologize if I get anything wrong.

    Basically I began working on the following project:

    https://github.com/otem/Raspberry-Pi...nth-drum-thing

    This has a whole slew of parts and code I am not 100% familiar with, however, I was able to get almost all of what I would consider the baseline pieces together (Pi running Rasbian, Teensy 3.6 with the .ino from the github, the beringer u-control) connected and somewhat running, however, I have hit a snag that worries me.

    When I run the piLooper.pd, the teensy connects and I see the activity LED however, I then get the following message:

    [comport]: Write failed for -1 bytes, error is 11

    Puredata repeats this a couple hundred times before it stops repeating the error. Could this be due to not having everything wired up yet? I haven't connected the mux or any of the controls. I was hoping to maybe get a few things connected to test it out before proceeding to completely wire this together.

    There is a screen that I believe has libraries that has yet to be connected, could it be this https://www.pjrc.com/store/display_ili9341.html not being connected that is causing the error?

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,302
    Not clear if that error coming from Teensy code or Pi code? Search the source code for the spot where that error could be printed - that should lead to whatever is using the [comport] and finding it lacking

  3. #3
    Junior Member
    Join Date
    Aug 2019
    Posts
    8
    I took a look through the puredata patches and the .ino code but couldn't find anything that references comport in the .ino, but the piLooper main puredata patch has these 9 references:

    line 6: #X obj 645 80 s comPortMsg;
    line 2580: #X obj 14 588 s comPortMsg;
    line 3617: #X obj 42 647 s comPortMsg;
    line 3732: #X obj 14 256 s comPortMsg;
    line 3754: #X obj 24 252 s comPortMsg;
    line 4079: #X obj 28 17 r comPortMsg;
    line 4116: #X obj 223 445 s comPortMsg;
    line 4286: #X obj 28 106 comport 1 9600;
    line 4581: #X obj 135 486 s comPortMsg;

    Does this help at all? I couldn't find any write error message references. Sorry if I'm headed in the wrong direction with this...

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,446
    First, you absolutely must have the udev rules file properly installed. Raspberry Pi runs Linux. The udev rules are required for all Linux systems.

    https://www.pjrc.com/teensy/td_download.html

    After installing the udev rule file (just copy it to the correct directory), physically unplug the Teensy and reconnect the cable for the udev rule to take effect.

    Then type this in a terminal:

    Code:
    ls -l /dev/ttyACM*
    If things are working properly, you should see this:

    Code:
    crw-rw-rw- 1 root dialout 166, 0 Aug  3 01:14 /dev/ttyACM0
    If the first part is something like "crw-rw----" (the "rw" only showing 2 times), that's a sure sign the udev rule file is not working.

    If you get "No such file or directory", either Teensy isn't connected or hasn't been properly programmed.

  5. #5
    Junior Member
    Join Date
    Aug 2019
    Posts
    8
    Understood. Thanks Paul! I will take a look and respond back with any issues. Thanks for all the help!

  6. #6
    Junior Member
    Join Date
    Aug 2019
    Posts
    8
    So I had the udev rules installed in both recommended locations. And after typing in the code into a terminal, the only thing that shows up is

    Code:
    /dev/ttyACM0

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,446
    Maybe you typed "-1" (the number one) instead "-l" (the letter L)?

  8. #8
    Junior Member
    Join Date
    Aug 2019
    Posts
    8
    That's exactly what I did... Sorry about that, here is the code I receive now:

    Code:
    crw-rw-rw- 1 root dialout 166, 0 Aug 3 13:11 /dev/ttyACM0

  9. #9
    Junior Member
    Join Date
    Aug 2019
    Posts
    8
    If that code is showing up, it means it's all working, right? So the error could be in relation to the TFT screen libraries not being connected to the teensy?

  10. #10
    Junior Member
    Join Date
    Aug 2019
    Posts
    8
    Sorry to bump this. I'm still stuck on this issue. Any other ideas? I appreciate all the troubleshooting we've done so far!

  11. #11
    Are you still getting the "[comport]: Write failed for -1 bytes, error is 11" error?

    (Btw, the ComPort thing specifically looks like it is some kind of plugin, see here: https://puredata.info/community/pdwiki/ComPort)

    There's really only one thing to try:
    - If you make a loopback on the serial adapter (connect Tx to Rx), and open a serial terminal, you should see any character that you type echoed back to you.

    If that works, but the ComPort plugin thing for PD still doesn't work, it'd probably be best to contact the plugin author or try to find a forum dedicated to PD. You're not down to the Teensy layer yet and that's what most of us here are most familiar with.

    Edit, actually... look at the error message. It tried to write -1 bytes?? That makes me think something in the Puredata configuration is screwed up.

  12. #12
    Junior Member
    Join Date
    Aug 2019
    Posts
    8
    Interesting. I'm wondering if maybe Puredata is pointing to a bad directory then? Could it be a permissions issue? I'll test this out to the best of my ability. I'll post my .pd patch as well in case it helps. Thanks for the help!

  13. #13
    Regarding the permissions, this part: "crw-rw-rw-" means anyone should be able to write to the serial port.

    I suppose it's possible that PD is looking for a serial port other than /dev/ttyACM0 and that's why it's failing.

Posting Permissions

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