[PD] [comport]: 'info' not too helpful
martin.peach at sympatico.ca
Mon Nov 12 19:36:50 CET 2007
Roman Haefeli wrote:
>when sending 'info' to comport, it outputs a bunch of messages to its
>right outlet to give you some information about the properties of the
>connection. however, if you use 'devicename <something>' to open a
>connection, 'info' tells you 'port 9999', which is of course wrong. when
>you do 'open 9999', not the same device gets opened, or more likely: no
>device gets openend at all.
9999 is just a placeholder to indicate that the device was opened by name.
On Windows the correct index is given because all the ports are named COM.
On linux and OSX they have more complex names and glob is used to generate a
list of all ports and the index is just the order in the list. I can add
that feature soon...
Until then, in recent [comport]s you can send the [ports( message and get a
list on the status outlet.
[unpack 0 s]
gives you pairs of index and name, which you could compare with the name you
opened the port with to find the index.
>i am working on a bunch of arduino abstractions that do find
>automagically the correct port of the arduino board. i decided to use
>different approaches on different os to probe the port of arduino. i
>experienced, that on linux the arduino sometimes appears on port 8,
>sometimes on port 48, probably it is different again on other linux
>flavors. in order to avoid 40 or more error messages before the correct
>port is found, i probe not with 'port [1-99]', but with
>'devicename /dev/ttyUSB[0-20]' on linux, since the devicename seems to
>be consistent throughout all linux flavors. however, i would like to
>avoid, that several abstractions use all their own [comport] on the same
>port, since i encountered, that when several [comport]s are listening on
>the same port, not all [comport]s will always receive all messages. for
>all above reason i would need to know, what the actual port number is of
>a connection, even if the connection was opened using
It might be better to use only one [comport] and send the data to the
abstractions with [send] and [receive] since normally opening a comport will
fail to open a port if the same port is already in use.
More information about the Pd-list