1. PowderJockey's Avatar
    I'm trying to set up my Playbook to connect via the USB port for faster file coping. I have the following file in /etc/network/if-up.d/99-playbook script which I found on the net.

    Code:
    #!/bin/bash
    MOUNTPOINT='/media/playbook'
    USERGROUP='local_user_group_name'
    AUTHENTICATION="credentials=/home/user/.smbcredentials-playbook"
    PERMISSIONS="dir_mode=0775,file_mode=0775,gid=$USERGROUP"
    if [ "$IFACE" = 'usb0' ]; then
        case "$MODE" in
            start)
                case "$PHASE" in
                    post-up)
                        if ! mount | grep -q "on $MOUNTPOINT type"; then
                            PLAYBOOK_IP="$DHCP4_DHCP_SERVER_IDENTIFIER"
                            mkdir -p "$MOUNTPOINT"
                            mount -t cifs \
                                -o "$AUTHENTICATION,$PERMISSIONS,users" \
                                "//$PLAYBOOK_IP/media" \
                                "$MOUNTPOINT"
                            echo -e "# Automounted PlayBook mount. This should be automatically deleted after the mount is removed \n" >> /etc/fstab
                            echo -e "//$PLAYBOOK_IP/media  $MOUNTPOINT cifs    iocharset=utf8,$AUTHENTICATION,users,gid=1000   0   0" >> /etc/fstab
                        fi
                        ;;
                esac
                ;;
            stop)
                case "$PHASE" in
                    pre-down)
                        # This doesn't actually accomplish anything that I've found
                        # I've left it here anyway, simply moving it to a phase that
                        # might have a hope of working.
                        umount -f -l -d "$MOUNTPOINT"
                        ;;
                    post-down)
                        # clean up the stuff we stuck in fstab
                        /bin/sed '/.*[Pp]lay[Bb]ook.*/d' /etc/fstab > /tmp/fstab
                        /bin/cp /tmp/fstab /etc/fstab >> /tmp/playbook-mount
                        /bin/rm /tmp/fstab >> /tmp/playbook-mount
                        ;;
                esac
                ;;
        esac
    fi
    I want to try and mount the Playbook from Dolphin which will require some changes to /etc/fstab. With the above script, the Playbook is recognized and is mountable with a mount command. The problem is the IP address is different everytime the Playbook is attached to the computer. I've found a post on the Blackberry forums, which suggest to change the IP address to the "Tablet Network Name". I've changed a few things around, but can't get the Playbook to be recognized the same way as the IP address way.

    Once mounted, files transfer quickly. The nice thing with Dolphin, it unmounts with a right click on the Playbook icon in "Places". Very nice. Would be nice to be able to get it mount with a simple click and a static IP/tablet network name.
    09-09-12 02:27 PM
  2. DrBoomBotz's Avatar
    since this script is being passed the $PLAYBOOK_IP
    you could use sed to make a mapping in /etc/hosts
    so if your PlayBook's ip address is 169.254.104.221

    add a line like this to /etc/hosts

    169.254.104.221 staticNameForPlaybook

    Hope that helps
    Last edited by DrBoomBotz; 09-15-12 at 02:02 PM. Reason: make it clear that the ip address belongs to the playbook
    09-09-12 06:27 PM
  3. kill_9's Avatar
    An easier solution is to assign a static IP address to the PlayBook in the WiFi router/access point, or where ever your DHCP service is running, using the tablet's MAC address to associate the IP address with the device. Then you can add the static IP address to the boot script. Alternatively, assign a static IP address to the tablet via the Settings Menu -> WiFi -> Select Saved Networks and edit the IP address settings accordingly. The first option is better because even if the tablet is powered-off for a period of time the lease on the IP address will not expire and you avoid the risk of another device being assigned the same IP address.
    09-09-12 06:45 PM
  4. Branta's Avatar
    An easier solution is to assign a static IP address to the PlayBook in the WiFi router/access point, or where ever your DHCP service is running, using the tablet's MAC address to associate the IP address with the device. Then you can add the static IP address to the boot script. Alternatively, assign a static IP address to the tablet via the Settings Menu -> WiFi -> Select Saved Networks and edit the IP address settings accordingly. The first option is better because even if the tablet is powered-off for a period of time the lease on the IP address will not expire and you avoid the risk of another device being assigned the same IP address.
    I like the DHCP approach better simply because it is the "correct" way.
    09-14-12 09:07 PM
  5. DrBoomBotz's Avatar
    The OP wanted to mount the PlayBook over usb

    I just tried in my Xubuntu 12.04 box
    The relevant part /var/log/syslog is below
    In this scenario the playbook is the dhcp server

    Sep 15 10:08:19 ~ NetworkManager[1178]: <info> (usb1): device state change: config -> ip-config (reason 'none') [50 70 0]
    Sep 15 10:08:19 ~ NetworkManager[1178]: <info> Activation (usb1) Beginning DHCPv4 transaction (timeout in 45 seconds)
    Sep 15 10:08:19 ~ NetworkManager[1178]: <info> dhclient started with pid 2240
    Sep 15 10:08:19 ~ NetworkManager[1178]: <info> Activation (usb1) Stage 3 of 5 (IP Configure Start) complete.
    Sep 15 10:08:19 ~ dhclient: Internet Systems Consortium DHCP Client 4.1-ESV-R4
    Sep 15 10:08:19 ~ dhclient: Copyright 2004-2011 Internet Systems Consortium.
    Sep 15 10:08:19 ~ dhclient: All rights reserved.
    Sep 15 10:08:19 ~ dhclient: For info, please visit https://www.isc.org/software/dhcp/
    Sep 15 10:08:19 ~ dhclient:
    Sep 15 10:08:19 ~ NetworkManager[1178]: <info> (usb1): DHCPv4 state changed nbi -> preinit
    Sep 15 10:08:19 ~ dhclient: Listening on LPF/usb1/16:74:11:59:90:af
    Sep 15 10:08:19 ~ dhclient: Sending on LPF/usb1/16:74:11:59:90:af
    Sep 15 10:08:19 ~ dhclient: Sending on Socket/fallback
    Sep 15 10:08:19 ~ dhclient: DHCPDISCOVER on usb1 to 255.255.255.255 port 67 interval 3
    Sep 15 10:08:20 ~ dhclient: DHCPREQUEST of 169.254.56.118 on usb1 to 255.255.255.255 port 67
    Sep 15 10:08:20 ~ dhclient: DHCPOFFER of 169.254.56.118 from 169.254.56.117
    Sep 15 10:08:20 ~ avahi-daemon[1131]: Joining mDNS multicast group on interface usb1.IPv6 with address fe80::1474:11ff:fe59:90af.
    Sep 15 10:08:20 ~ avahi-daemon[1131]: New relevant interface usb1.IPv6 for mDNS.
    Sep 15 10:08:20 ~ avahi-daemon[1131]: Registering new address record for fe80::1474:11ff:fe59:90af on usb1.*.
    Sep 15 10:08:20 ~ dhclient: DHCPACK of 169.254.56.118 from 169.254.56.117
    Sep 15 10:08:20 ~ dhclient: bound to 169.254.56.118 -- renewal in 18280 seconds.
    09-15-12 09:31 AM
  6. rash.m2k's Avatar
    I can't find the thread anywhere but I'm sure you can just use the name of your blackberry device rather than the IP address and it should be resolved correctly. Goto Storage and Sharing -> Properties
    09-15-12 01:23 PM
  7. DrBoomBotz's Avatar
    The PlayBook hostname resolves to the wifi adapter's ethernet address.

    I captured on the usb interface and I don't see any netbios traffic.

    Update
    I did not wait long enough.
    The playbook actually became the master browser on the usb network.
    Last edited by DrBoomBotz; 09-15-12 at 02:47 PM.
    09-15-12 01:53 PM
  8. princimart's Avatar
    lsusb is a utility for displaying information about USB buses in the system and the devices connected to them .


    Mobilt Bredbnd
    09-21-12 01:28 AM
LINK TO POST COPIED TO CLIPBOARD