I recall at the time I could not get the arduino software to work on Linux (CentOS-5) so I resorted to using a Windows VM with USB passthru.
That was not going to cut it this time. I was going to use my full stubbornness to get it working on CentOS-6.
First of all, I had to get a copy of the IDE in RPM format. There was talk on the internet about just such a thing but I could not find an EL6 version. In the end I selected the Fedora 19 version which is suitable. The files needed are:
- arduino-1.0.5-6.fc19.noarch.rpm
- arduino-doc-1.0.5-6.fc19.noarch.rpm
- arduino-core-1.0.5-6.fc19.noarch.rpm
There are also a number of other dependancies because the IDE does not actually do much. Luckily the other bits are all in CentOS-6 or EPEL so using yum you can get it installed without too much trouble.
Running the IDE however is rigged with rubbish about adding your user account to certain groups. This seems antiquated to me and I refuse to do it. There must be a better way.
An ideal solution would be that the USB devices are assigned to the console owner and it would just work like any other peripheral. The way to implement that changes with every version of RHEL/CentOS but after some sleuthing, I found the answer for version 6 and it is no too difficult.
To get this working there are four jobs:
- Make sure the USB device ID is known to the USB TTY driver
- Set the appropriate permissions with udev
- Remove the restrictions on locking the device
- Configure the IDE
echo "0x26ba 0x8002" >> /sys/bus/usb/drivers/cdc_acm/new_id
For your board, the IDs may well be different so you much check with dmesg or lsusb.
This needs to be done after every reboot so it should be added to an init script
modprobe cdc_acm
echo "0x26ba 0x8002" >> /sys/bus/usb/drivers/cdc_acm/new_id
TODO: is there is proper place for this? modprobe.conf? /etc/sysconfig/modules/arduino? For now, /etc/rc.d/rc.local will do.
In order to set the permissions, the correct devices must be identified. For me, the device name is /dev/ttyACM0 but this does not hang round for long (remember about the changing ids?). It is only present while the arduino bootloader is running. dmesg can give you a hint but the easiest way to check the device name is the plug in the stick and immediately run ls -l /dev/tty*
Once you know the device name you can interigate it with udev
udevadm info -a -n /dev/ttyACM0
Again you must run this immediatly after plugging in the USB stick.
It will output many properties of the device from which you must find something unique. At first I though that 'ATTRS{manufacturer}=="Freetronics"' was a good value to check for but it turns out that when your sketch is running, that string is not present. Better is to use the USB vendor ID 'ATTRS{idVendor}=="26ba"'. While I was at it, I also added the Arduino vendor code of 20a0. I could then make a new udev rule by creating the file:
/etc/udev/rules.d/52-arduino.rules
and adding the contents:
ATTRS{idVendor}=="26ba", ENV{ACL_MANAGE}="1"ATTRS{idVendor}=="20a0", ENV{ACL_MANAGE}="1"
Some sources also recommend preventing the Modem Manager from probing the device. You can do that by adding this line too
ATTRS{idVendor}=="26ba", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="20a0", ENV{ID_MM_DEVICE_IGNORE}="1"
Once the file is in place, you can force the rules to be applies with the command
udevadm trigger
Now check the device with ls -l again (immediately after plugging in the stick) and it should look like this (with a + sign)
crw-rw----+ 1 root dialout 166, 0 Apr 24 23:08 /dev/ttyACM0
If so, check the ACL with getfacl /dev/ttyACM0
getfacl: Removing leading '/' from absolute path names
# file: dev/ttyACM0
# owner: root
# group: dialout
user::rw-
user:jnewbigin:rw-
group::rw-
mask::rw-
other::---
Note that my username jnewbigin is granted access. You should of course see your username there. If so, job done.
The next headache is device locking. The default rxtx library wants to write to a directory it does not have permissions on. Fixing this was painful. All I wanted was a simple way to skip the locking phase in the rxtx library. I had hoped that there would be an environment variable which could tune the locking. According to the documentation, the only way to turn locking off is by recompiling. Luckily the srpm is easily modified. You can download my lock free version of rxtx from http://www.chrysocome.net/download
Almost done. I would have though that configuring the IDE should not be required but as it happens, you must edit ~/.arduino/preferences.txt and change
serial.port=/dev/ttyACM0
So now we have removed the requirements to add your user into the unnecessary groups. The script which runs the IDE (arduino) however still complains that you are not a member. The best solution would be to rebuild the rpm without that check (and add in the udev rules) but for now you can either select Ignore or edit /usr/bin/arduino and change the line
for group in dialout lock; do
to
for group in ; do
Perhaps I will repackage it with these changes.
And stay tuned for the working IR blaster code!
Nice write-up! If you want to promote your blog site for free, leave a comment at http://www.coreforceworldwide.com/why-we-write-for-you/
ReplyDeleteI regularly visit your site and find a lot of interesting information. Not only good posts but also great comments. Thank you and look forward to your page growing stronger gmail login
ReplyDeleteThank you for your post, I look for such article along time, today i find it finally. this post give me lots of advise it is very useful for me
ReplyDeleteoutlook entrar
Very helpful advice in this particular post! It’s the little changes that make the largest changes. Thanks for sharing!
ReplyDeleteFireboy And Watergirl
Wow amazing its looking great. Thanks for sharing I will try.
ReplyDeleteI really want to try this. Mcafee Activate
It's a very Informative post to us. I bookmarked this post for your future reference. I have never felt so good. McAfee.com/activate
ReplyDeleteMcafee offers an advanced security solution for users. and if you have any issues regarding the McAfee, You can visit our official website. McAfee Support
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteGood post. I learn something totally new and challenging on blogs Quickbooks online support
ReplyDelete
ReplyDeleteThanks for such a good articles it really helped me after reading your posts. McAfee setup
this is the best informative and usefull blog for me about linux.linus is the bestest networking software standard deviation formula thank you so much for sharing this with us
ReplyDeleteWhen your website or blog first appears, it's interesting. That is until you realize no one but you and you. Play room clicker clickerheroes.games game
ReplyDeleteIf you have good quality images and that you want to convert JPG to PDF it is very easy to convert. Use our online jpg to pdf converter, so you can convert any image with the help of the type of PDFs with ease.
ReplyDeletehow to convert jpg to pdf
The most exact python scientific notation has no prescience that somewhat incalculable may not balk the very next moment.
ReplyDeleteI will carefully read the issues you just shared, I find there are some places that are not very clear visit here
ReplyDeleteMr Thorneycroft, 43, doused deadly embers while 20 women and children sheltered in the Kinglake National Park Hotel coolroom with their pets.
ReplyDeletehttps://mostpopularwomen.info/
I have also now made the track available for download in either WMA or MP3 format. Mp3 Rocket Torrent
ReplyDeleteI wanted to thank you for this informative analysis of the Subway Surfers online game. I definitely savored every little bit of it and I submitted your site to some of the biggest social networks so others can find your blog.
ReplyDeleteInstall Arduino IDE 1.8.2 on Linux. By patrickthecreator in CircuitsLinux. 55,570. 14. 6. license.
ReplyDeletesource
This post is discussing in an outstanding way. I like your way yo discussed your valid points and facts about this. McAfee Activate
ReplyDeleteI really said one thing is you share your personal knowledge with us that was the great thing. I really appreciate this thing. windows audio device graph isolation
ReplyDeleteis the best digital marketing company in Delhi NCR. we are giving our services like a digital marketing agency, SEO company, and Best graphic designing services in Delhi NCR, Best SMM Serc in all over Delhi, SEO services in Delhi Faridabad Noida, and Gurgaon. Best SMM Services in delhi
ReplyDeleteI guess Arduino is your best option. https://www.shopedc.com
ReplyDeleteYou topic is very great and useful for me…thank you
ReplyDeleteclick on here
Aqui tienen si les interesa plantillas gratis para decargar
ReplyDeletecurriculum vitaes y pueden editarlos ustedes mismos , los
invito a pasar por mi web sobre plantillas y curriculums vitae
gratuitos para bajar cv
Espero haber aportado a la comunidad!
Yaaaas! this is so cool. Love it https://www.childanxietycenter.com/
ReplyDeleteWow! thanks for this good innfo
ReplyDeleteLove this information! Thanks Click here
ReplyDeleteThis day is always celebrates on the 1st date of every year and all countries are enjoy this day on same date. Day is different is each year but the date is same on each year. Use these images, that we have already share with you and your friends on coming holiday. Must download advance Happy New Year Status 2021 images with quotes for your friends and family members.
ReplyDeletehttp://gmailposteingang.livebloggs.com/
ReplyDeleteThanks. I can use this for my project. CBD cream for dry skin
ReplyDeleteThanks for sharing. This really helps. thecbdmagazine
ReplyDeleteI want to express my gratitude to you. I hope you don't just overlook it and read my article well. I solved my problem. Please visit my site and write.먹튀검증커뮤니티
ReplyDeleteGreat work man you have post a great post it will help people very much keep it do more for people like that.
ReplyDelete카지노사이트
먹튀검증
스포츠토토
토토사이트
It was really good work. I really like your thoughts. I personally appreciates for your work. your article is very impressive and helpful for us. .. Thanks
ReplyDelete사설토토
바카라사이트
파워볼
something that is remarkable and should be learned. Thank you for providing this great information
ReplyDelete토토
온라인카지노
파워볼사이트