Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > Networking & Wireless
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Networking & Wireless
Having problems getting connected to the internet or getting your wireless card to work? Ask here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old September 18th, 2008   #1
Kiefer Rodriguez
Just Give Me the Beans!
 
Kiefer Rodriguez's Avatar
 
Join Date: Jan 2008
Location: Adelaide, Australia
My beans are hidden!
Xubuntu 8.04 Hardy Heron
Arrow GUI Installer for RT73 (RaLink) Devices [Beta]

RT73 Driver GUI Installer
Okay so it's taken me just over, erm, six months to update what started out as a simple install script to install wireless devices from the RT73 RaLink chipset, but it's finally been updated. I actually re-wrote this entire thing over a few days off, hence why it's in Beta stage- I am expecting bugs and errors, so bare with me on this one guys. Details are as follows.

Language: Python (GTK 2.X GUI)
Version: 0.5.2 Beta
Author: Kiefer Rodriguez

It's pretty simple, download the attached zipfile's (the script, and the SerialMonkey driver, both attached), and follow the instructions provided (check out the README), if you're not sure what you're supposed to enter in to a certain field, click the '?' button next to said field and that should get you back on track. Time for some screenshots..




And heres the source for your viewing pleasure (to actually use the installer, you need to download the attached ZIP file, not just grab the source)

Code:
########################
# name:    RT73 GUI Based Installer     #
# ver:            0.5 Beta                                 #
# author:    Kiefer Rodriguez                     #
# license:    GPL                                             #
# description: A GUI based Installer #
#                            for the RT73 RaLink    #
#                            chipset. GTK based.  #
########################

#!/usr/bin/env python

import pygtk
pygtk.require('2.0')
import os
import gtk        

class MainInstallerWindow:
    VERSION = "v0.5 Beta"
    def display_help_dialog(self, widget, event="clicked", data=None):
        if widget == self.button_ifaceq:
            self.label_help.set_text("This field requires the interface name of the wireless device you wish to install\n" \
                                                            "the RT73 drivers under, by default it should be 'wlan0' or 'ath0', if you have a pre-existing\n" \
                                                            "wireless device installed, it may by default be 'wlan1' or 'ath1'.")
            self.help_title = "Interface Help"
        elif widget == self.button_package_managerq:
            self.label_help.set_text("This field requires the name of your default package manager, if your using a Debian based system\n" \
                                                        "e.g. Ubuntu, Kubuntu, Edubuntu, or Xubuntu then your package manager, by default is 'apt-get'.\n" \
                                                        "If the install fails due to the package manager, you may use an alternative package manager, check\n" \
                                                        "your distrobution documentation to find out which one.")
            self.help_title = "Package manager Help"
        elif widget == self.button_essidq:
            self.label_help.set_text("This field requires the name of your access point you plan to connect to by default, e.g. 'our_internet'.")
            self.help_title = "Access Point ESSID Help"
        elif widget == self.button_wepkeyq:
            self.label_help.set_text("This field requires your WEP key used to authenticate with your access point, it can be of any length and\n" \
                                                                    "either HEX or ASCII, remember that ASCII keys must be prefixed with 's:' (without the quotes).")
            self.help_title = "WEP Key Help"
        elif widget == self.button_tarballq:
            self.label_help.set_text("This field requires the FULL path to the tarball ('filename.tar[.gz]') containing the SerialMonkey drivers, most likely\n" \
                                                            "named 'rt73-cvs-daily.tar.gz'.")
            self.help_title = "Driver Tarball Help"
        self.help_dialog.show()
    def toggle_wep(self, widget, event="toggled", data=None):
        if self.checkbox_usewep.get_active():
            self.entry_wepkey.set_text(self.wephistory)
            self.entry_wepkey.set_editable(True)
        else:
            self.wephistory = self.entry_wepkey.get_text()
            self.entry_wepkey.set_text("-WEP Disabled-")
            self.entry_wepkey.set_editable(False)
    def main(self):
        gtk.main()
    def delete_event(self, widget, event, data=None):
        return False
    def destroy_event(self, widget, data=None):
        gtk.main_quit()
    def show_about(self, widget, event="clicked", data=None):
        self.output.set_justification(gtk.JUSTIFY_CENTER)
        self.output_buffer.set_text("\n\n\n\nRT73 Chipset GUI Installer "+self.VERSION+"\n\n" \
                                                            "Lead Programmer (GUI & Core)\t\tKiefer Rodriguez\n" \
                                                            "Based on the RT73 driver manual install guide by Diepruis" \
                                                            "\n\nhttp://thelinuxnewb.blogspot.com\n")
    def start_install(self, widget, event="clcked", data=None):
        self.button_okay.set_sensitive(False)
        self.button_cancel.set_sensitive(False)
        self.button_loadtb.set_sensitive(False)
        self.output.set_justification(gtk.JUSTIFY_LEFT)
        self.output_buffer.set_text("Commencing install..")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Copying driver tarball to /usr/src..")
        os.system("sudo cp"+self.entry_tbpath.get_text()+" /usr/src")
        self.pb_install.set_fraction(0.02)
        self.pb_install.set_text("Installing | 2%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Unpacking driver tarball contents to /usr/src..")
        os.system("sudo tar -xvzf /usr/src/*.tar.gz")
        self.pb_install.set_text("Installing | 5%")
        self.pb_install.set_fraction(0.05)
        if self.checkbox_internet.get_active()==False:        
            self.output_buffer.insert(self.output_buffer.get_end_iter(), "\n*    Please confirm your distrobution's LiveCD is inserted")
            self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Gathering required header files from CD, this may take a while..")
            os.system("sudo apt-cdrom add")
            self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Added CD-Rom to sources list, now updating list..")
            os.system("sudo aptitude update")
            self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Installing headers..")
            os.system("sudo aptitude install build-essential linux-headers-`uname -r`")
        else:
            self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Installing headers..")
            os.system("sudo" + self.entry_package_manager.get_text() +" install build-essential linux-headers-`uname -r`")
        self.pb_install.set_fraction(0.15)
        self.pb_install.set_text("Installing | 15%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Compiling RT73 module..")
        os.system("cd /usr/src/rt73-*/Module && sudo make")
        self.pb_install.set_fraction(0.20)
        self.pb_install.set_text("Installing | 20%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Correcting file size issue..")
        os.system("sudo strip -S rt73.ko")
        self.pb_install.set_fraction(0.22)
        self.pb_install.set_text("Installing | 22%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Installing module..")
        os.system("sudo make install")
        self.pb_install.set_text("Installing | 35%")
        self.pb_install.set_fraction(0.35)
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Bringing down wireless device..")
        os.system("sudo ifconfig" + self.entry_iface.get_text() + "  down")
        self.pb_install.set_fraction(0.42)
        self.pb_install.set_text("Installing | 42%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Removing obsolete RaLink modules..")
        os.system("sudo modprobe -r rt73usb")
        self.pb_install.set_fraction(0.45)
        self.pb_install.set_text("Installing | 45%")
        os.system("sudo modprobe -r rt2570")
        self.pb_install.set_fraction(0.50)
        self.pb_install.set_text("Installing | 50%")
        os.system("sudo modprobe -r rt2500usb")
        self.pb_install.set_fraction(0.52)
        self.pb_install.set_text("Installing | 52%")
        os.system("sudo modprobe -r rt2x00lib")
        self.pb_install.set_fraction(0.60)
        self.pb_install.set_text("Installing | 60%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Making a backup of /etc/modprobe.d/blacklist to your /home directory..")
        os.system("sudo cp /etc/modprobe.d/blacklist ~/blacklist.backup")
        self.pb_install.set_fraction(0.65)
        self.pb_install.set_text("Installing | 65%")
        os.system("sudo cp /etc/modprobe.d/blacklist ./rt73-blacklist.temp")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Opening /etc/modprobe.d/blacklist..")
        m    odprobe = file("rt73-blacklist.temp", 'a')
        self.pb_install.set_fraction(0.67)
        self.pb_install.set_text("Installing | 67%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Writing to /etc/modprobe.d/blacklist..")
        modprobe.write("# Added by RT73 Installer\nblacklist rt2570\nblacklist rt73usb\nblacklist rt2500usb\nblacklist rt2x00lib\n#END.")
        self.pb_install.set_fraction(0.70)
        self.pb_install.set_text("Installing | 70%")
        os.system("sudo cp rt73-blacklist.temp /etc/modprobe.d/blacklist && rm -rf rt73-blacklist.temp")
        self.pb_install.set_fraction(0.75)
        self.pb_install.set_text("Installing | 75%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Closing blacklist..")
        modprobe.close()
        self.pb_install.set_fraction(0.77)
        self.pb_install.set_text("Installing | 77%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Deleting temp files..")
        os.system("sudo rm -rf rt73-blacklist.temp")
        self.pb_install.set_fraction(0.80)
        self.pb_install.set_text("Installing | 80%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Making sure the driver was installed correctly..")
        os.system("sudo modprobe -v rt73")
        self.pb_install.set_fraction(0.85)
        self.pb_install.set_text("Installing | 85%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Bringing up device..")
        os.system("sudo ifconfig" + self.entry_iface.get_text() +" up")
        self.pb_install.set_fraction(0.87)
        self.pb_install.set_text("Installing | 87%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Configuring new device..")
        os.system("sudo iwconfig" + self.entry_iface.get_text() +" essid" + self.entry_essid.get_text())
        self.pb_install.set_fraction(0.90)
        self.pb_install.set_text("Installing | 90%")
        if self.checkbox_usewep.is_active():
            os.system("sudo iwconfig" + self.entry_iface.get_text() +" key" + self.entry_wepkey.get_text())
            os.system("sudo iwconfig" + self.entry_iface.get_text() +" key on")
        self.pb_install.set_fraction(0.95)
        self.pb_install.set_text("Installing | 95%")
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\n*    Running dhclient..")
        os.system("sudo dhclient" + self.entry_iface.get_text())
        self.output_buffer.insert(self.output_buffer.get_end_iter(),"\nInstall complete, you should now be able to access the internet.\nIf not consult the " \
                                                                                                                        "README included with this program.")
        self.pb_install.set_fraction(1)
        self.pb_install.set_text("Installation Complete | 100%")
        self.button_okay.set_sensitive(True)
        self.button_cancel.set_sensitive(True)
        self.button_loadtb.set_sensitive(True)
    def file_ok_sel(self, w):
        self.path_tarball =  self.filew.get_filename()
        self.entry_tbpath.set_text(self.path_tarball)
        self.filew.hide()
    def pick_tarball(self, widget, event="clcked", data=None):
        self.filew.show()
    def __init__(self):
        # Set up window
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_title("RT73 Driver Install")
        # Set up basic signal handlers
        self.window.connect("delete_event", self.delete_event)
        self.window.connect("destroy", self.destroy_event)
        # Set up layout
        self.mainvbox = gtk.VBox(False, 8)
        self.window.add(self.mainvbox)
        self.window.set_border_width(10)
        self.box_iface = gtk.HBox(False, 3)
        self.box_package_manager = gtk.HBox(False, 3)
        self.box_essid = gtk.HBox(False, 3)
        self.box_wepkey = gtk.HBox(False, 3)
        self.box_buttons = gtk.HBox(False, 95)
        self.box_internet = gtk.HBox(False, 3)
        self.box_tb = gtk.HBox(False,3)
        self.box_write_interface = gtk.HBox(False, 1)
        self.box_output = gtk.HBox(False,1)
        self.box_getdata = gtk.HBox(False, 2)
        self.box_ventry = gtk.VBox(True,2)
        self.box_vlabel = gtk.VBox(True,2)
        self.box_tbentry = gtk.HBox(True, 2)
        self.box_progress = gtk.HBox(False,1)
        self.mainvbox.pack_start(self.box_getdata)
        self.box_getdata.pack_start(self.box_vlabel)
        self.box_getdata.pack_start(self.box_ventry)
        self.box_vlabel.pack_start(self.box_iface)
        self.box_vlabel.pack_start(self.box_package_manager)
        self.box_vlabel.pack_start(self.box_essid)
        self.box_vlabel.pack_start(self.box_wepkey)
        self.box_vlabel.pack_start(self.box_tb)
        self.mainvbox.pack_start(self.box_internet)
        self.mainvbox.pack_start(self.box_write_interface)
        self.mainvbox.pack_start(self.box_output)
        self.mainvbox.pack_start(self.box_progress)
        self.mainvbox.pack_start(self.box_buttons)
        # Input boxes
        self.entry_iface = gtk.Entry(max=5)
        self.entry_package_manager = gtk.Entry()
        self.entry_essid = gtk.Entry()
        self.entry_wepkey = gtk.Entry()
        self.entry_tbpath = gtk.Entry()
        self.entry_iface.set_text("wlan0")
        self.entry_package_manager.set_text("apt-get")
        self.entry_essid.set_text("my_wireless")
        self.entry_wepkey.set_text("0123456789")
        self.entry_tbpath.set_text("/home/you/rt73-cvs-daily.tar.gz")
        # Text labels
        self.label_iface = gtk.Label("Interface name")
        self.label_package_manager = gtk.Label("Package manager")
        self.label_essid = gtk.Label("ESSID")
        self.label_wepkey = gtk.Label("WEP key")
        self.label_tarball = gtk.Label("Path to SerialMonkey tarball  ")
        self.label_help = gtk.Label("Error Occured, Could not locate Help strings.")
        self.help_title = "Help"
        # Buttons
        self.button_cancel = gtk.Button("", gtk.STOCK_CANCEL)
        self.button_okay = gtk.Button("Start Install")
        self.button_loadtb = gtk.Button("",gtk.STOCK_OPEN)
        self.button_ifaceq = gtk.Button("  ?  ")
        self.button_package_managerq = gtk.Button("  ?  ")
        self.button_essidq = gtk.Button("  ?  ")
        self.button_wepkeyq = gtk.Button("  ?  ")
        self.button_tarballq = gtk.Button("  ?  ")
        self.button_dialog_okay = gtk.Button("", gtk.STOCK_OK)
        self.button_about = gtk.Button("About")
        # Other widgets
        self.checkbox_write_interface = gtk.CheckButton("Set up /etc/network/Interfaces file")
        self.checkbox_usewep = gtk.CheckButton("Use WEP")
        self.checkbox_internet = gtk.CheckButton("Other active internet connection")
        self.filew = gtk.FileSelection("Choose Drivar tarball")
        self.filew.connect("destroy", self.destroy_event)
        self.filew.ok_button.connect("clicked", self.file_ok_sel)
        self.filew.cancel_button.connect("clicked", lambda w: self.filew.hide())
        self.filew.set_filename("rt73-cvs-2008XXXXXX")
        self.checkbox_usewep.set_active(True)
        self.checkbox_write_interface.set_active(True)
        self.output = gtk.TextView()
        self.output.set_editable(False)
        self.output.set_cursor_visible(False)
        self.output.set_wrap_mode(gtk.WRAP_WORD)
        self.output_buffer = self.output.get_buffer()
        self.output.set_justification(gtk.JUSTIFY_CENTER)
        self.output_buffer.set_text("\n\n\n\nRT73 Chipset GUI Installer "+self.VERSION+"\nBy Kiefer Rodriguez\n\n-Important-\nIf you do not have a pre-existing" \
                                                            " internet connection (ethernet etc).\nPlease ensure your LiveCD is in the drive and spinning BEFORE you start the install.\n\n-Disclaimer-" \
                                                            "\n"  \
                                                            "This program wil modify system files, and while the author has made every\neffort to ensure a safe install, such can not "  \
                                                            "be guaranteed. By activating\nthe install process you agree that the author is in no way liable or responsible\nfor any damage " \
                                                            "or harm caused as a result of running this program.")
        self.output.set_size_request(300, 380)
        self.output.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("black"))
        self.output.modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
        self.output_iter = self.output_buffer.get_end_iter()
        self.help_dialog = gtk.Dialog(title=self.help_title ,parent=self.window, )
        self.pb_install = gtk.ProgressBar()
        self.pb_install.set_text("Waiting to start install | 0%")
        self.pb_install.set_fraction(0)
        # Pack containers
        self.box_iface.pack_start(self.button_ifaceq, False, False, 0)
        self.box_iface.pack_start(self.label_iface, False, False, 0)
        self.box_package_manager.pack_start(self.button_package_managerq, False, False, 0)
        self.box_package_manager.pack_start(self.label_package_manager, False, False, 0)
        self.box_essid.pack_start(self.button_essidq, False, False, 0)
        self.box_essid.pack_start(self.label_essid, False, False, 0)
        self.box_wepkey.pack_start(self.button_wepkeyq, False, False, 0)    
        self.box_wepkey.pack_start(self.label_wepkey, False, False, 0)
        self.box_ventry.pack_start(self.entry_iface)
        self.box_ventry.pack_start(self.entry_package_manager)
        self.box_ventry.pack_start(self.entry_essid)
        self.box_ventry.pack_start(self.entry_wepkey)
        self.box_buttons.pack_start(self.button_cancel)
        self.box_buttons.pack_start(self.button_about)
        self.box_buttons.pack_start(self.button_okay)
        self.box_internet.pack_start(self.checkbox_internet)
        self.box_internet.pack_start(self.checkbox_usewep)
        self.box_write_interface.pack_start(self.checkbox_write_interface)
        self.box_tb.pack_start(self.button_tarballq, False, False, 0)
        self.box_tb.pack_start(self.label_tarball, False, False, 0)
        self.box_ventry.pack_start(self.box_tbentry)
        self.box_tbentry.pack_start(self.entry_tbpath)
        self.box_tbentry.pack_start(self.button_loadtb)
        self.box_output.pack_start(self.output)
        self.formbox = gtk.VBox(False, 0)
        self.help_dialog.action_area.pack_start(self.formbox)
        self.formbox.pack_start(self.label_help)
        self.formbox.pack_start(self.button_dialog_okay, False, False, 0)
        self.box_progress.pack_start(self.pb_install)
        # Signal connections
        self.button_loadtb.connect("clicked",self.pick_tarball)
        self.button_cancel.connect("clicked",lambda w: self.filew.destroy())
        self.button_dialog_okay.connect("clicked", lambda w: self.help_dialog.hide())
        self.button_ifaceq.connect("clicked", self.display_help_dialog)
        self.button_wepkeyq.connect("clicked", self.display_help_dialog)
        self.button_essidq.connect("clicked", self.display_help_dialog)
        self.button_package_managerq.connect("clicked", self.display_help_dialog)
        self.button_tarballq.connect("clicked", self.display_help_dialog)
        self.checkbox_usewep.connect("toggled", self.toggle_wep)
        self.button_okay.connect("clicked", self.start_install)
        self.button_about.connect("clicked", self.show_about)
        # Draw everything
        self.button_about.show()
        self.box_progress.show()
        self.pb_install.show()
        self.formbox.show()
        self.label_help.show()
        self.button_dialog_okay.show()
        self.box_tbentry.show()
        self.box_getdata.show()
        self.box_ventry.show()
        self.box_vlabel.show()
        self.button_ifaceq.show()
        self.button_package_managerq.show()
        self.button_essidq.show()
        self.button_wepkeyq.show()
        self.button_tarballq.show()
        self.output.show()
        self.box_output.show()
        self.entry_tbpath.show()
        self.label_tarball.show()
        self.button_loadtb.show()
        self.box_tb.show()
        self.box_write_interface.show()
        self.checkbox_write_interface.show()
        self.checkbox_usewep.show()
        self.checkbox_internet.show()
        self.box_internet.show()
        self.button_okay.show()
        self.button_cancel.show()
        self.box_buttons.show()
        self.label_iface.show()
        self.label_package_manager.show()
        self.label_essid.show()
        self.label_wepkey.show()
        self.entry_iface.show()
        self.entry_package_manager.show()
        self.entry_essid.show()
        self.entry_wepkey.show()
        self.mainvbox.show()
        self.box_iface.show()
        self.box_package_manager.show()
        self.box_essid.show()
        self.box_wepkey.show(
        self.window.show()
        # Misc variables
        self.wephistory = "0123456789"
if __name__ == "__main__":
    x = MainInstallerWindow()
    x.main()
I am aware that the 'Configure /etc/network/Interfaces' option is not working, it will be patched in the coming days. Feedback/problems can either be posted here (suggested) or emailed to me, at kiefer [dot] rodriguez [at] gmail [dot] com

Changelog

0.5.2 Fixed *.is_active() bug.
0.5.1 Fixed syntax error relating to Modprobe
0.5 Fixed WEP History bug (resetting to default on install)
0.4 Added help functions and basic support for file location dialog
0.3.1 Rewrote GUI
0.3 Wrote all callback functions and skel. GUI
0.2 Mapped out basic GTK 2.0 GUI, fixed known bugs.
0.1Rewrote entire script, basic command set.
-Kiefer
Attached Files
File Type: gz rt73-cvs-daily.tar.gz (302.3 KB, 1054 views)
File Type: zip RT73_GUI_Installer_0.5.2.zip (6.1 KB, 1020 views)
__________________
Need to install your RT73 based wireless device? use my RT73 Driver GUI Installer!
Linux is simple, you just have to be a genius to understand it's simplicity.

Last edited by Kiefer Rodriguez; October 10th, 2008 at 05:59 AM..
Kiefer Rodriguez is offline   Reply With Quote
 

Bookmarks

Tags
dlink, driver, install, ralink, rt73

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:13 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry