Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Port devel/arduino serial port problems

2 views
Skip to first unread message

Arthur Chance

unread,
Mar 13, 2013, 5:56:27 PM3/13/13
to
I'm trying to get devel/arduino working. Plugging in the USB cable to
the Arduino creates /dev/cuaU0* and /dev/ttyU0* and I'm manually
changing them to mode 666 while trying to get started so should be able
to access them as my normal user. However, the Tools => Serial Port menu
item in the Arduino IDE is always greyed out, and whatever I set
serial.port to in ~/.arduino/preferences.txt when trying to upload a
sketch I always get the error message

Serial port '<whatever serial.port is set to>' not found.

Any hints and clues would be very welcome.

My system is 9.1-RELEASE-p1 and amd64

pkg info arduino shows

arduino-1.0.3_1,1 Open-source electronics prototyping platform

My /dev with the Arduino plugged in and a chmod a+rw done suitably:

fileserver# ls -l /dev/{cua,tty}U*
crw-rw-rw- 1 uucp operator 0, 242 Mar 13 21:24 /dev/cuaU0
crw-rw-rw- 1 uucp operator 0, 243 Mar 13 21:24 /dev/cuaU0.init
crw-rw-rw- 1 uucp operator 0, 244 Mar 13 21:24 /dev/cuaU0.lock
crw-rw-rw- 1 root wheel 0, 239 Mar 13 21:24 /dev/ttyU0
crw-rw-rw- 1 root wheel 0, 240 Mar 13 21:24 /dev/ttyU0.init
crw-rw-rw- 1 root wheel 0, 241 Mar 13 21:24 /dev/ttyU0.lock
_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Arthur Chance

unread,
Mar 14, 2013, 4:48:22 AM3/14/13
to
On 03/13/13 21:56, Arthur Chance wrote:
> I'm trying to get devel/arduino working.[snip]

I shouldn't work 13 hour days. Now I've had some sleep, I've spotted
what I missed last night. The underlying code from comms/rxtx is trying
to create a lock file in /var/spool/lock and that is only writeable by
user uucp and group dialer. Given that I have absolutely no serial
devices (or ports) on this box apart from the Arduino when it's plugged
in, can anyone see any problems with making the lock directory world
writeable?

Polytropon

unread,
Mar 14, 2013, 8:33:48 AM3/14/13
to
On Thu, 14 Mar 2013 08:48:22 +0000, Arthur Chance wrote:
> On 03/13/13 21:56, Arthur Chance wrote:
> > I'm trying to get devel/arduino working.[snip]
>
> I shouldn't work 13 hour days. Now I've had some sleep, I've spotted
> what I missed last night. The underlying code from comms/rxtx is trying
> to create a lock file in /var/spool/lock and that is only writeable by
> user uucp and group dialer. Given that I have absolutely no serial
> devices (or ports) on this box apart from the Arduino when it's plugged
> in, can anyone see any problems with making the lock directory world
> writeable?

Simply add your user (or the account the program is running
under) to the "dialer" group. This has been a common method
to allow users to access dialing programs (which were reserved
for root use without this group addition).



--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Warren Block

unread,
Mar 14, 2013, 9:08:23 AM3/14/13
to
On Thu, 14 Mar 2013, Polytropon wrote:

> On Thu, 14 Mar 2013 08:48:22 +0000, Arthur Chance wrote:
>> On 03/13/13 21:56, Arthur Chance wrote:
>>> I'm trying to get devel/arduino working.[snip]
>>
>> I shouldn't work 13 hour days. Now I've had some sleep, I've spotted
>> what I missed last night. The underlying code from comms/rxtx is trying
>> to create a lock file in /var/spool/lock and that is only writeable by
>> user uucp and group dialer. Given that I have absolutely no serial
>> devices (or ports) on this box apart from the Arduino when it's plugged
>> in, can anyone see any problems with making the lock directory world
>> writeable?
>
> Simply add your user (or the account the program is running
> under) to the "dialer" group. This has been a common method
> to allow users to access dialing programs (which were reserved
> for root use without this group addition).

This is also mentioned when the Arduino port is installed:

To allow serial port locking, add your user to the dialer group:
pw usermod myuser -G dialer

Arthur Chance

unread,
Mar 14, 2013, 10:59:12 AM3/14/13
to
On 03/14/13 13:08, Warren Block wrote:
> On Thu, 14 Mar 2013, Polytropon wrote:
>
>> On Thu, 14 Mar 2013 08:48:22 +0000, Arthur Chance wrote:
>>> On 03/13/13 21:56, Arthur Chance wrote:
>>>> I'm trying to get devel/arduino working.[snip]
>>>
>>> I shouldn't work 13 hour days. Now I've had some sleep, I've spotted
>>> what I missed last night. The underlying code from comms/rxtx is trying
>>> to create a lock file in /var/spool/lock and that is only writeable by
>>> user uucp and group dialer. Given that I have absolutely no serial
>>> devices (or ports) on this box apart from the Arduino when it's plugged
>>> in, can anyone see any problems with making the lock directory world
>>> writeable?
>>
>> Simply add your user (or the account the program is running
>> under) to the "dialer" group. This has been a common method
>> to allow users to access dialing programs (which were reserved
>> for root use without this group addition).
>
> This is also mentioned when the Arduino port is installed:
>
> To allow serial port locking, add your user to the dialer group:
> pw usermod myuser -G dialer

Warren and Polytropon, thanks. I realised that this morning and added
myself to dialer. I'd originally thought the requirement for dialler
group was simply to access /dev/cuaU0 and wrote a devd.conf file to set
that as mode 666. It was only after catching up with my sleep I thought
of lock files.

However, my point was a little more general than just fixing this
specific access problem - many desktop machines these days don't have
serial lines or any need for dialer programs, and adding yet another
group to an ever increasing list just so that I can talk to an Arduino
seems a little redundant. (As does using /var/spool/lock - isn't that
what /dev/cuaU0.lock is for?)


For anyone else thinking of playing with Arduinos on FreeBSD, this bug

http://www.freebsd.org/cgi/query-pr.cgi?pr=163749

in avrdude bit me (on a 9.1-RELEASE-p1 amd64 machine, talking to an
Arduino Uno R3). The second patch (patch-arduino.c) fixed the problem,
but it's a shame it's not included in the port 14 months after it was
submitted.

Polytropon

unread,
Mar 14, 2013, 6:37:28 PM3/14/13
to
On Thu, 14 Mar 2013 14:59:12 +0000, Arthur Chance wrote:
> However, my point was a little more general than just fixing this
> specific access problem - many desktop machines these days don't have
> serial lines or any need for dialer programs, and adding yet another
> group to an ever increasing list just so that I can talk to an Arduino
> seems a little redundant.

Remember that this group isn't _that_ new, it has
its own "historical value". :-)

Furthermore, if you consider PPPoE, what are you
actually doing? You're _dialing_ (not with a phone
number, not even through the serial port, but
utilizing means of PPP) with your modem connected
by an Ethernet cable. This mechanism also requires
root privileges, except you are in the "dialer"
group. :-)

http://www.freebsd.org/doc/faq/serial.html



> (As does using /var/spool/lock - isn't that
> what /dev/cuaU0.lock is for?)

No, those are actual devices, see "man 4 uart" for
details. The subtree /var/spool is primarily used
for things like mail and printer subsystems.






--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
0 new messages