On Wed, Feb 19, 2014 at 8:17 AM, ss sefat <[email protected]> wrote:

> i connected the arduino usb with bbb. bbb recognize arduino as
> /dev/ttyACM0 . now i want to communicate with arduino using serial
> communication in c++ . i tried several times using fopen() .bt bt bbb
> cannot open "/dev/ttyACM0" for writing. can any one give me a simple demo
> code which completely works without any error .plz help me. thanks in
> advance .
>
>
You should check the permissions on /dev/ttyACM0.

On normal desktop ubuntu, you need to belong to the dialout group, be root,
or setup some udev rules to give world write permissions to you
/dev/ttyACM0 node.

I expect it will be similar on the BBB.

I also don't recommend using fopen with the serial port. You should
probably use regular open/close. I have some sample code here:
https://github.com/dhylands/projects/tree/master/host/sertest (uses
multiple threads)
https://github.com/dhylands/projects/tree/master/host/sertest-select (uses
a single thread)

It's also very worthwhile to read-thru and understand the Serial
Programming HOWTO that somebody else linked to.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to