[release] sockfile python

Discussion in '3DS - Homebrew Development and Emulators' started by moghedien, Apr 24, 2016.

  1. moghedien
    OP

    moghedien GBAtemp Fan

    Member
    411
    247
    Mar 9, 2015
    United States
    I made a new Python version of sockfile that works with the new FBI 2 protocol (so it wont work with FBI 1)
    It should work with both Python 2 and Python 3 and it uses the same command line arguments as the official sockfile.
    https://github.com/svanheulen/sockfile_python

    Edit: I added a new script to the repository!

    The "net_installer.pyw" script runs a HTTP server and displays a QR code that can be scanned by FBI to install the specified CIA/TIK file.

    You do need to install the "pyqrcode" Python module, which can easily be done by just opening your console/terminal and typing:
    Code:
    pip install --user pyqrcode
    Once that's all set, you can just drag-and-drop a CIA/TIK file (or a folder containing CIA/TIK files) onto the script, then scan the QR code with FBI. (Note: you need to keep the window open until the install on your 3DS finishes)

    On Linux and Mac you can also use the "-t" argument to have the QR code display in the terminal if you want :)
    Code:
    ./net_installer.pyw -t /path/to/cia/file.cia
    Edit: I renamed the "qr_installer.pyw" script to "net_installer.pyw" and added support for the new network install protocol added in FBI 2.4.5

    You can use the new protocol like this:
    Code:
    ./net_installer.pyw --send x.x.x.x /path/to/file.cia
    Where "x.x.x.x" if the IP address of your 3DS (displayed by FBI).
    If you don't use the "--send" argument (or if you drag-and-drop files onto the script) it will display the QR code.

    I also added a script for the old FBI 1.x protocol, just because.


    GUI display:
    [​IMG]
    Terminal display:
    [​IMG]
     
    Last edited by moghedien, Dec 25, 2016
    gothic4, TheCruel, satanduck and 4 others like this.
  2. NicEXE

    NicEXE GBAtemp Fan

    Member
    397
    124
    Dec 6, 2009
    Cyprus
    Excellent job! However I found a minor issue. You can't specify the port.
     
  3. moghedien
    OP

    moghedien GBAtemp Fan

    Member
    411
    247
    Mar 9, 2015
    United States
    Yeah, the port is hard-coded to 5000 in FBI so I did the same. If there is an actual use case for needing to specify the port I can certainly add that option.
     
  4. satanduck

    satanduck Newbie

    Newcomer
    1
    0
    Dec 1, 2013
    Malaysia
    Awesome job! Just when the NAS I'm having feels underpowered to run the Java version. You're a saviour!
     
  5. TheCruel

    TheCruel Developer

    Banned
    1,351
    2,884
    Dec 6, 2013
    United States
  6. moghedien
    OP

    moghedien GBAtemp Fan

    Member
    411
    247
    Mar 9, 2015
    United States
    I added a script for installing via the QR code scanner in FBI, see the topic post for details :)
     
    Vague Rant likes this.
  7. jimmyleen

    jimmyleen GBAtemp Maniac

    Member
    1,162
    198
    Feb 28, 2016
    Unless you are running your own server the numbers don't need to change.
     
  8. retroguy

    retroguy GBAtemp Regular

    Member
    109
    14
    Nov 28, 2006
    Netherlands
    Nice. Can I install a few CIA's at once with the python script? If so, wha'ts the command line? Just a space between the CIA names?

    And what is the commandline for showing the transfer speed in the window (I'm using this script with a .bat so I only need to type in the CIA name, and I would like to add the 'show transfer speed' command).
     
    Last edited by retroguy, May 2, 2016
  9. moghedien
    OP

    moghedien GBAtemp Fan

    Member
    411
    247
    Mar 9, 2015
    United States
    For the sockfile.py script, yes, exactly. For the qr_installer.pyw script it only serves one CIA file.

    — Posts automatically merged - Please don't double post! —

    There is no way to show the transfer speed
     
  10. retroguy

    retroguy GBAtemp Regular

    Member
    109
    14
    Nov 28, 2006
    Netherlands
    OK, thanks for the info. :)
     
  11. moghedien
    OP

    moghedien GBAtemp Fan

    Member
    411
    247
    Mar 9, 2015
    United States
    I updated the QR code installer to allow installing multiple files with a single QR code. Just give it a path to a folder containing some CIA/TIK files. Keep in mind that if there are too many files FBI might have a hard time reading the QR code.
     
  12. moghedien
    OP

    moghedien GBAtemp Fan

    Member
    411
    247
    Mar 9, 2015
    United States
    I renamed the "qr_installer.pyw" script to "net_installer.pyw" and added support for the new network install protocol added in FBI 2.4.5

    You can use the new protocol like this:
    Code:
    ./net_installer.pyw --send x.x.x.x /path/to/file.cia
    Where "x.x.x.x" if the IP address of your 3DS (displayed by FBI).
    If you don't use the "--send" argument (or if you drag-and-drop files onto the script) it will display the QR code.

    I also added a script for the old FBI 1.x protocol, just because.