Assign specific device name and group to Arduino

I built a PWM fan controller using Arduino. It’s for my file server’s external fans. I wrote a small python script for setting PWM values to it.

I also wanted to control it from a web page, so I wrote a CGI script. The CGI script did not work because the Apache server is running with Apache’s user/group ID which is www-data/www-data while the Arduino’s serial port is root/dialout.

Since the Arduino is a “finished product” and I want a stable name, I can use the Arduino product name and serial number to assign a specific name. For this, you use a udev rule. Here is the one I created for it.

SUBSYSTEM=="tty", ACTION=="add", ATTRS{manufacturer}=="Arduino*", ATTRS{serial}=="64131383331351F09291", GROUP:="www-data", SYMLINK+="serverfan"

and I named it /etc/udev/rules.d/75-arduino.rules.
After that, you unplug and plug back in the Arduino.
Now the CGI script can talk to the Arduino.

How to get to the Arduino serial number

It’s a good thing that Arduino has a serial number so that you can spot a specific one. Here is how you get the serial number.

$ sudo udevadm info  --attribute-walk  --name=/dev/ttyACM0 | grep serial

So I copy & paste the ATTRS{serial}==”64131383331351F09291″ part in the udev rule.

Dymo LabelManager PnP on Linux CUPS

I’m into organization these days, and one thing I really wanted was to print a nice labels on folders and boxes. So, I bought myself a Dymo LabelManager PnP.
I printed a couple of labels on Mac, and out of curiosity, I wanted to use it on Mint box. (I don’t know I should call Mint box Ubuntu box or Linux box. I am so not religious purist.)

Here is the step you need to use the Dymo on it.

Step 1: Download Dymo Linux SDK.

You’d get something like “dymo-cups-drivers-1.4.0.tar.gz“.

Step 2: Install libcups2-dev libcupsimage2-dev

sudo apt-get install libcups2-dev libcupsimage2-dev gcc g++

Step 3: Install the SDK

mkdir dymo
cd dymo
tar xzf dymo-cups-drivers-1.4.0.tar.gz
cd ./dymo-cups-drivers-
sudo make install

Now the driver is installed.

Step 4: Set up the CUPS
Now, go to the CUPS admin page. Don’t forget to connect the Dymo to your machine.

Here are the screen shots of how I set it up.


Step 5: Install gLabels

gLabels is a GNOME application for printing labels. Thanks for whoever developed this. It is well designed and made. I tried LibreOffice writer and was totally lost at beginning. It was just a matter of “aptitude search label” and gLabels showed up.

Step 6: Set up the template

I had to try a few times to get the template working. Ones showing here is not 100%, but it is working OK.

010-tempate 1011-template 2012-template 3013-template 4

After that, you hit a couple of “Continue” buttons. If you see the template carefully, the layout is not horizontal. I tried the horizontal layout and could not make it work. You’ll see the “bad template” result in later.

Step 7: Create a label.

020-new label or card021-choose normal

Now, in gLabels, you create a label. New document and pick the template you created. So, this results in somewhat awkward label design screen.

040-design screen

This is the only way I can make it work for now. I printed a label. This is for a AC adapter for my rechargeable LED flash light. There are so many adapters that only way to keep track of them is to label them all.


Ones on the left is the failed attempts. One on right is the result of this post. Apparently, the margin is not right, and the end is too close to the cutting blade. The adjustments are probably increase the margin all around and for the label’s template, “waste” needs to be set up some. But, at least it’s printed and the letters are right.
I think this is an OK start.