2011-11-29

Cant get a connection with an R8169 NIC and Linux/Windows

And so, earlier today, I had a problem with my MSI Wind U230. Normally, I can connect via ethernet (A realtek 8111/8168B chip that used the r8169 driver)  without any problems, but today... it decided to not connect to anything. dmesg showed that the link was down and I only kept getting a "Cable unplugged" message from my DE (KDE 4.X in this incarnation of my linux installation).

Fortunately, wifi was available, and I checked a few forums and bugs that recommended installing the r8168 driver instead of using the stock r8169 that's shipped with Kubuntu. Then there was this other link (sorry, but I can't recall them anymore, since I hopped between dozens of pages looking for a solution) that mentioned that if you dual-boot (which I do), to check in the windows device manager and set a few wake-on-* settings to either enabled or disabled, depending on the driver version. Neither solution appealed to me for some reason. I've kept to using stock ubuntu kernels (they work just fine for my case, and am currently on 3.0.0-13-generic) and have no problems. As for the windows solution, I couldn't see where or how windows would put my NIC to sleep (more like a coma, was the way it was descrobed), since I jump between Linux and Windows 7, and my NIC never went into a coma before.

What worried me most was that I was playing with some grub options (specifically pcie_aspm=force and acpi_osi=Linux). Although I wasn't scared that those would be permanent errors (well, I was hoping they wouldn't), I wen't back and forth with different combinations in using them (side note: they didn't work for me in regard to power-saving).

What fixed the whole thing eventually was unplugging this laptop from power, and pulling out the battery. With all power sources disconnected, I held down the power button for a good 15-30 seconds (sorry, I wasn't counting, but it was a significant number of seconds though), and plugged in again. After booting, all was fine.

The only thing I could think of that might have triggered this was either the pcie_aspm=force or the acpi_osi=Linux or both, that put my nic to sleep. But after draining all the residual power from the board - which is what disconnecting all power sources and holding down the power button does - it seems whatever was got cached(?) in the nic got cleared and a new surge of juice set it right up again.

Ah well... something new that I never experienced before. Took me all of 30 minutes to figure out through trial and error.

2011-07-29

Log in to your remote KDE desktop through SSH.

My usual work machine is a laptop, but I also have a desktop where I run a few things as well. I control both using synergy, so that I share my laptops keyboard and mouse between both machines. but since I rarely work on the desktop directly, I took out the keyboard and the mouse to save desktop space. But every so often, it has to restart (like after updates), and logging into it again was a hassle having to plug the keyboard and mouse again. Synergy won't work unless you're logged in (meaning past the KDM log-in screen.). So what's a man to do when you're connected only via SSH?

Well, what you do is simply:
sudo kdmctl -g login :0 now username password
What does that do? The -g lets it connect using the global unix domain socket.
The login means exactly that, log in.
:0 - This tells kdm that you'd like it to happen on display 0.
now - well, it means now.
username and password would be the username and password you normally use to log into your kde desktop.

Sure as heck saves me a lot of backaches from crawling under the table just to reconnect the mouse and keyboard.

My work set-up.
Now, this won't show your desktop machine's screen on your laptop screen, since this isn't a VNC connection. This will only log in to that machines KDE desktop. Controlling it will happen using synergy (link above). Synergy runs on linux, windows and mac.Let's me have the pleasure of having two screens with the full power of two separate computers. The only thing that's missing from the mix is that you can't drag windows from one screeen to another, but I can live with that.

2009-01-03

Installing an HP F4280 on Slackware 12.1

Edit::: I managed to forget to renew that old domain (darksky.info), and thus, revived this one...

This post and several others have been moved to darksky.info as this blog will soon be well, left alone. Please post any comments and/or violent reactions there. Thank you.

I purchased an HP DeskJet F4280 AIO as a late Christmas present for us, and installed it on my (of course) Slackware system. But before we move forward, lets look at what happened step by step.

I got the HP Deskjet F4280 because of the HPLIP drivers, which would make things easier. On opening the box, it had of course, packaging, marketing materials, one USB cable, one power supply, and one Win/MacOSX driver CD (fairly standard, don't you think?). So there I go, plugging the whole thing into the PC, fire up cups with

sh /etc/rc.d/rc.cups start

and all goes well after powering up (oddly enough, I didn't even think about running the HPLIP tools, oh well).

Now, when I ask cups to "Find New Printers" on the Administration tab, it couldn't see anything. So, I go check dmesg, and find:


$ dmesg

[lots of stuff here]
...
usb 1-2: new full speed USB device using uhci_hcd and address 3
usb 1-2: configuration #1 chosen from 1 choice
usblp0: USB Bidirectional printer dev 6 if 1 alt 0 proto 2 vid 0x03F0 pid 0x2504
...
[more stuff]


Well, there I see that Slackware CAN see the darn thing. From this, I can see that the printer was plugged into bus 1 (if 1) with the device number 6 (dev 6).

Going into /dev, I check for permissions, thinking that the device nodes didn't have r/w permissions, and true enough, ls -al shows


crw-rw---- 1 root root 189, 5 2009-01-03 00:41 usbdev1.6
crw-rw---- 1 root root 250, 4 2009-01-03 00:41 usbdev1.6_ep00
crw-rw---- 1 root root 250, 5 2009-01-03 00:41 usbdev1.6_ep01
crw-rw---- 1 root root 250, 9 2009-01-03 00:41 usbdev1.6_ep06
crw-rw---- 1 root root 250, 7 2009-01-03 00:41 usbdev1.6_ep08
crw-rw---- 1 root root 250, 6 2009-01-03 00:41 usbdev1.6_ep82
crw-rw---- 1 root root 250, 10 2009-01-03 00:41 usbdev1.6_ep87
crw-rw---- 1 root root 250, 8 2009-01-03 00:41 usbdev1.6_ep89


Simple enough, we could chmod 0666 /dev/usbdev1.6* to get r/w permissions (0666 is equivalent to chmod ugo+rw /dev/usbdev1.6*). However, printers by their nature aren't on all the time, and on powering down and powering up, I found that the HP DeskJetF4280 was assigned a different device number. Not to mention that inserting other USB devices (like your handy-dandy flash drive) are going to change things up even more.

So, what to do, what to do...? udev rules of course! First to find some information. Doing an /sbin/lsusb gave me:


Bus 002 Device 001: ID 0000:0000
Bus 001 Device 007: ID 03f0:2504 Hewlett-Packard
Bus 001 Device 001: ID 0000:0000


Kinda thin, dontchathink? But it does give me two things, the USB Vendor ID and product ID. we confirm that with udevinfo -ap /bus/usb/devices/1-2, which gives me:


looking at device '/devices/pci0000:00/0000:00:11.2/usb1/1-2':
KERNEL=="1-2"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{dev}=="189:6"
ATTR{configuration}==""
ATTR{bNumInterfaces}==" 3"
ATTR{bConfigurationValue}=="1"
ATTR{bmAttributes}=="c0"
ATTR{bMaxPower}==" 2mA"
ATTR{urbnum}=="14"
ATTR{idVendor}=="03f0"
ATTR{idProduct}=="2504"
ATTR{bcdDevice}=="0100"
ATTR{bDeviceClass}=="00"
ATTR{bDeviceSubClass}=="00"
ATTR{bDeviceProtocol}=="00"
ATTR{bNumConfigurations}=="1"
ATTR{bMaxPacketSize0}=="64"
ATTR{speed}=="12"
ATTR{busnum}=="1"
ATTR{devnum}=="7"
ATTR{version}==" 2.00"
ATTR{maxchild}=="0"
ATTR{quirks}=="0x0"
ATTR{authorized}=="1"
ATTR{manufacturer}=="HP"
ATTR{product}=="Deskjet F4200 series"
ATTR{serial}=="CN89P3G0TC05BR"

[more irrelevant stuff follows]


Now, wait a minute, how did I know that the proper device is 1-2? And where did /bus/usb/devices come from? Well, udevinfo reads from /sys, and so, you leave that out of your command. As for 1-2, see dmesg above. It says, usb 1-2. Not exactly rocket science, but also not immediately obvious.

Well, this confirms the vendor and product id (see ATTR{idVendor} and ATTR{idProduct}). It also shows us the product serial number (ATTR{serial}=="CN89P3G0TC05BR"). Useful things for manipulating udev with.

So, here we go, heading off to /etc/udev/rules.d, and what do I find? Nothing about printers. I did find a few lines in 50-udev-default.rules something about printers, but nothing that I'd want to toy with... so looking again, I remember that this HP F4280 IS an All-In-One (or Printer-Scanner-Copier, whichever you prefer). And there is that file that's called /etc/udev/rules.d/80-libsane.rules.

HEY!! I thought this was about installing and getting the printer to work!!!

Yes, it is, just bear with me for a few more minutes.

Anyway, checking that rule-file, I find that there is no rule for the HP F4280 in there. So, fire up vim, and add this near the bottom, just before the segment about autosuspend. If you're not sure what I'm talking about, you can add this after the last line that looks most like it.


# HP Deskjet F4280
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="2504", MODE="0666", GROUP="scanner", ENV{libsane_matched}="yes"


If you're in vim, you'd hit ESC :wq at this point to save and quit.

You will notice that I have MODE="0666" and GROUP="scanner". Why? Well, libsane IS about scanners anyway. But about the MODE="0666"? Well, the HP F4280 again, is an All in One. If I don't change this to rwrwrw (0666) for everyone, then I'll be able to scan, but not print. Why? Because printing is a write function to the printer device.

So, after the rule is written, lets power down and power up the printer again. Lets check /dev as to what I have for my usbdev now.


crw-rw-rw- 1 root scanner 189, 7 2009-01-03 01:14 usbdev1.8
crw-rw---- 1 root root 250, 4 2009-01-03 01:14 usbdev1.8_ep00
crw-rw---- 1 root root 250, 5 2009-01-03 01:14 usbdev1.8_ep01
crw-rw---- 1 root root 250, 9 2009-01-03 01:14 usbdev1.8_ep06
crw-rw---- 1 root root 250, 7 2009-01-03 01:14 usbdev1.8_ep08
crw-rw---- 1 root root 250, 6 2009-01-03 01:14 usbdev1.8_ep82
crw-rw---- 1 root root 250, 10 2009-01-03 01:14 usbdev1.8_ep87
crw-rw---- 1 root root 250, 8 2009-01-03 01:14 usbdev1.8_ep89


Looks like we have read/write capability for this node now! But lets check some more.

ls /dev/bus/usb/001/008 -al

drwxr-xr-x 2 root root 80 2009-01-03 01:14 ./
drwxr-xr-x 4 root root 80 2009-01-03 08:09 ../
crw-r--r-- 1 root root 189, 0 2009-01-03 08:09 001
crw-rw-rw- 1 root scanner 189, 7 2009-01-03 01:14 008

Looking good!

Just one last thing. sane wouldn't be able to see your scanner. Why? It doesn't quite know about it yet. Go into /etc/sane.d and edit the file hp4200.conf. Change the figures after usb to read:

usb 0340:2504

Now drop out of root, and try xsane. If the gui launches, then you're good to go. Just to add the printer.

Fire up your browser, and head of to localhost:631, to access cups. Head to Administration, and click on Find New Printers. After that, just go on clicking on next etc. etc. When you get to the part where it asks for the "Model/Driver for HP_Deskjet_F4200_series_*", look for the HPDeskJetf4200 series driver. Follow till the end, and click "Print Test Page".

Note: If you have a default install of Slackware 12.1, you'll have to upgrade the HPLIP package from the 12.2 series to find the f4200series driver in cups.

There you have it, how to install an HP F4280 on Slackware Linux 12.1. Hope you had fun!

2008-11-17

Wine 1.1.7 and Adobe CS3

Now, this blog has been all but abandoned. My last post was several months ago. The reason for the abandonment? I'm currently rolling my own blog in python and sqlite3. The host is already actually paid for and ready, as well as the domain, but things being hectic as they are, well, things had to slide for a while.

Now, since I studied flash ActionScript3 for a year, I had a dedicated windows drive, and a dedicated linux drive as well. Yes, it used to be FreeBSD, but somehow, I found FreeBSD 7 not me... version 6.x was fine with me, but 7 seemed somehow off.

Anyway, developing on windows, I had dreamweaver on, like any good webdeveloper should. Honestly, Dreamweaver is still one of the best IDE's I've ever seen. When the windows drive finally said buh-buy ... (yes, as in buy another drive), well, it was buhbye DW as well.

Well, I didn't have the cash to spend on another drive yet, and my linux drive was pretty much packed already... plus, I didn't really want to put windows back on :)

Running through some IDE's, like Quanta, Bluefish and Nvu, I found that, after Dreamweaver, well, Dreamweaver spoils all other web development environments. I was itching to get back on dreamweaver.

So in comes wine to the rescue. I had a drive image of a fresh windows install with CS3 already installed there, so copied over the entire adobe directory to my ~/.wine/Program Files directory. I tried DW with wine 1.1.4 first. Yes it worked, but there were screen artifacts. Some parts didn't render, and a feeling of "clunkiness". So, I gave that up for a lost cause.

Now, with a wine upgrade (1.1.7), I tried it again, and voila! the interface all renders properly, most functions seem to be there (haven't dug into it much, since I only tried 5 minutes ago) and responds fairly well. For kicks, I tried to run flash cs3... and voila! same thing! :) how about photoshop? sadly, no go.

Anyway, I'll post more when I put it through the paces, but for now, a screenie... :)



you can view the full size here:

http://img134.imageshack.us/img134/6596/adobewineky0.jpg

2008-07-07

No one is immune...

Seems no one is immune to getting their domains taken away from them... specially considering that the domains for the Internet Corporation for Assigned Names and Numbers (ICANN) and Internet Assigned Numbers Authority (IANA) (icann.org and iana.org repectively) got their domains hijacked... they managed to get them back approximately 20 minutes later though.