benkuper / Chataigne

Artist-friendly Modular Machine for Art and Technology
https://benjamin.kuperberg.fr/chataigne
GNU General Public License v3.0
1.15k stars 55 forks source link

Raspberry Pi hardware serial is not seen by the serial module #246

Open siteswapjuggler opened 3 weeks ago

siteswapjuggler commented 3 weeks ago

Environment

Describe the bug It's beetween a bug and feature request actually. I try to connect with a teensy via GPIO14/GPIO15 UART. I'm sure of the setting as it works perfectly with a python script but the serial port doesn't appear in Chataigne.

To Reproduce Steps to reproduce the behavior:

  1. setup the RPi serial port
  2. run Chataigne
  3. create a serial port object
  4. the serial port doesn't appear in the dropdown menu

Expected behavior Get the serial port in the dropdown menu either the dynamic link '/dev/serial0' or the device tree adress '/dev/ttyAMA0'

Additional context Actually I suspect that the filter, filters out those result because I can see '/dev/ttyS0' (wich is the serial path when used for the terminal) it can also see the Teensy USB (with the teensy descriptor) but it cannot the hardware port as specified above.

This will be used in an installation by october, I can work on it if and suggest a push request if you point me the file to work on with. Anyhow no urgency as I can use USB as a replacement ;)

Have a nice day

benkuper commented 3 weeks ago

Hey sylvain, long time no see ;) You will find the code in the Juce_serial repository. It's using wjwood's serial code but it's fully integrated in the repo so you can check that there. There is a Linux specific file there.

Let me know how it goes! Cheers

siteswapjuggler commented 3 weeks ago

Hi Ben, long time no see indeed :) I'll have a look as soon as possible. Thanks a lot for this quick answer :)

Cheers

siteswapjuggler commented 3 weeks ago

Evening,

so as far as I can tell the answer would be in this file : https://github.com/benkuper/juce_serial/blob/398c9b30c463c4547ca0b47bc5bc116f36fb5466/lib/serial/impl/list_ports/list_ports_linux.cc#L2

after line 302, we can add : search_globs.push_back("/dev/serial"); search_globs.push_back("/dev/ttyAMA");

By the way I think I can hack the system without even recompiling anything just by adding a dynamic link which math one of the patterns already present in the code :)

Thanks a lot for your help.

siteswapjuggler commented 3 weeks ago

Tell me if you prefer for me to transfer or complete an issue on the jusce_serial. By the way I choose not to mess with a pull request as long as I don't have the full compilation workflow to test the modification.