Thursday, January 30, 2014

Sunday, January 26, 2014

USB-to-Serial on Fedora 20

Oh boy, was I lucky my USB-to-serial works like a charm on my brand new Fedora 20 install. Plugged it in and it works, and I'll be damned.

And here's how my dmesg output looks:

[11619.109776] usb 3-4: new full-speed USB device number 3 using xhci_hcd
[11619.121660] usb 3-4: New USB device found, idVendor=0557, idProduct=2008
[11619.121666] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[11619.121669] usb 3-4: Product: USB-Serial Controller D
[11619.121672] usb 3-4: Manufacturer: Prolific Technology Inc.
[11619.513465] usbcore: registered new interface driver pl2303
[11619.513486] usbserial: USB Serial support registered for pl2303
[11619.513510] pl2303 3-4:1.0: pl2303 converter detected
[11619.514756] usb 3-4: pl2303 converter now attached to ttyUSB0

And voila! I have /dev/ttyUSB0 ready for outgoing serial connections.

And due to the nature of my work I need to keep a log of what I do. Here's a script which I have loaded onto by bash profile (~/.bash_profile). I know it looks crude, basically all I need to know prior to connecting to the target serial connection is to know what hostname it has as reference. And call the log of the connection as hostname-date_X, where is the number of console log I may already have in existence, and if it already exists, creates a new one by adding a +1 to X.

I actually though of adding traps after read hostname, just to make sure the hostname I enter are appropriately hostnames, but doing it on bash is just cumbersome. Since it's my laptop and my subroutine, heck this should work.

initserial() {
serdev=/dev/ttyUSB0
if [ ! -c ${serdev} ]; then 
echo "Usage: initserial"
echo " ttyUSB0 is not connected"
return 1 
fi
echo -n "Please enter the target server hostname: "
read hostname
i=1
found_console_log_file=0
while [ $found_console_log_file -eq 0 ]; do
console_log=${hostname}-`date +%Y%m%d`
echo ${console_log}_$i | egrep "^(.*)_+[[:digit:]]$" 2>&1 >/dev/null
found_console_log=$?
if [ ! -f ${console_log}_$i ]; then
console_log_file=${console_log}_$i
found_console_log_file=0
break
fi
i=`expr $i + 1`
done
echo "Appending output to $console_log_file"
/usr/bin/script $console_log_file
/usr/bin/screen $serdev 
}

Bye bye Windows 7 or at least I think I did

I finally took the plunge, reformatted my laptop and had it installed with Fedora 20.

So, yeah, I now have problems with Visio, because yeah I need to edit and create diagrams and stuffs for the systems I scribbled on paper and have it well properly drawn? Is that an actual proper description of what I do for a living. Haha. Oh well.

As of the moment, I only have 3 problems with this Fedora 20 installation

1. My touchpad is super-sensitive, I thought by enabling the option of disabling the touch pad when keyboard is active (somewhere along that description) should fix it but no. On windows 7 (unfortunately) there is sort of a led plus active area on the top left which you can tap two times, just in case if you want to disable the touchpad, and this doesn't work on Fedora 20, and as far as I can recall, it never worked on Fedora.

2. Printing on HP printers, haven't got the chance to get this fix yet. I am scared I might send garbage printouts to the office HP Laserjet printers

3. Visio, period.