Author Topic: Basic Hotplug Questions  (Read 1516 times)

jbruno

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
    • http://
Basic Hotplug Questions
« on: January 10, 2006, 10:05:31 am »
I've noticed that when I plug my SL6000 into the USB cradle while the Zaurus is powered on, my usbd0 interface comes up properly (SL6000 as dhcpcd client talking to Windows XP which is using Internet Connection Sharing).

This works ok.

However, when I remove the zaurus from the cradle (while powered on) - then the usbd0 interface remains up (it never runs the /etc/hotplug/usbd.func script file in this case).  How can I fix this?

Also, I tried making the screen rotate when I insert the 6000 into the cradle, but it doesn't work (xrandr says: "Can't open display").  I added the xrandr call to the /etc/hotplug/usbd.func script.

I also tried starting the VNC server from that script, but that also fails.  

How can I rotate the screen and start the VNC server (if X is up) when the 6000 is inserted into the cradle?

Thanks for any help!
-----
SL6000L
ATP 512MB SD

jbruno

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
    • http://
Basic Hotplug Questions
« Reply #1 on: January 11, 2006, 03:59:30 pm »
Ok, I have this working now so that two things happen when I insert the SL6000 into the USB cradle (talking to Windows XP)

1) The screen rotates with xrandr

To get this to work from /etc/hotplub/usbd.func, I had to setup the environment a bit, like so:

Code: [Select]
       # Screen rotate
        if [ "$ROTATE" = "yes" ]; then
            export HOME="/home/root"
            export PATH="$PATH:/usr/X11R6/bin"
            DISPLAY=:0 /usr/X11R6/bin/xrandr -o normal >> /etc/hotplug/usbd.log 2>&1
        fi

2) VNC Server launched

Same fix as above:
Code: [Select]
       # VNC Server
        if [ "$VNCSERVER" = "yes" ]; then
            DISPLAY=:0 /usr/local/bin/x11vnc_control stop >> /etc/hotplug/usbd.log 2>&1
        fi

The problem I'm still having is that when I remove the Zaurus from the cradle, the hotplug events don't seem to work.
-----
SL6000L
ATP 512MB SD