Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® PlayBook™

Reply
Developer
Posts: 33
Registered: ‎02-28-2012
My Device: Passport, Z10 & Playbook 64 GB

Re: Static IP on USB?

How exactly are you placing the "tablet network name" to get the computer to recognize it?  I have the following file in /etc/network/if-up.d/99-playbook.

 

#!/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've changed a few things around, but can't get the Playbook to mount without using a mount command.

 

The Playbook shows up   in Dolphin with the proper IP address, but still needs a mount command to get it to mount. Once mounted, files transfer quickly. The nice thing with Dolphin, it unmounts with a right click on the Playbook. Very nice. Would be nice to be able to get it mount with a simple click and a static IP/tablet network name.

Passport 10.3.2.2474
Playbook 64 GB, Blackberry Z10
Forums Veteran I
Posts: 1,625
Registered: ‎02-28-2012
My Device: Two PB's

Re: Static IP on USB?

[ Edited ]

You are way too complex. Look at the link in the first post for the process which uses the connect to server dialogue panel, not a disk mount script. 

 simply replace the usb ip address with the tablet name in the connect panel  as it says further down. 

 

Edit: btw I always use tablet name when connecting wifi playbook to macbook as the wifi ip address also changes depending on the order I boot my devices.

_________________________
Developer
Posts: 33
Registered: ‎02-28-2012
My Device: Passport, Z10 & Playbook 64 GB

Re: Static IP on USB?

Not using buntu, but in Dolphin it did do the following:

 

smb://playbook-XXXX

 

Get both the /cert and /media.

 

I did test copy of a file and had 4.3 mb/s at the high end.

 

i was trying, as were saying, to get too ccomplex.

 

I think thins are a go now.

 

Thanks

 

Scott

Passport 10.3.2.2474
Playbook 64 GB, Blackberry Z10