Pi Looper/Teensy/Puredata Write Errors

Status
Not open for further replies.

mstr

Member
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-Looper-synth-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?
 
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
 
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...
 
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.
 
Understood. Thanks Paul! I will take a look and respond back with any issues. Thanks for all the help!
 
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
 
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
 
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?
 
Sorry to bump this. I'm still stuck on this issue. Any other ideas? I appreciate all the troubleshooting we've done so far!
 
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.
 
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!
 
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.
 
I got around to everything again yesterday and puredata pointed me in the direction of the error. "comport 0 9600"

This is the same write error "[comport]: Write failed for -1 bytes, error is 11", but puredata said to use find to dig further. This pulled up one of the PD patches and highlighted the aforementioned "comport 0 9600"

I found this in the puredata main code, and tried changing the comport to a few other numbers and received various issues, then I set it back to 0. Then I took a look at the arduino code and found the only reference to the baud rate here:

//LCD Stuff
tft.begin();
tft.setRotation(3);
Serial.begin(9600);
tft.fillScreen(ILI9341_BLACK);
tft.setFont(Arial_14);


I know the TFT libraries are used in this project, and I was theorizing it could be trying to write to the TFT screen. The TFT isn't currently hooked up, so I will try adding that in via breadboard and seeing how it plays out. Is this logical? Sorry, I'm new to pretty much everything with this project.
 
Status
Not open for further replies.
Back
Top