Shop OBEX P1 Docs P2 Docs Learn Events
Wi-Fi program loader? — Parallax Forums

Wi-Fi program loader?

I'll be receiving a couple Activity Board WXs tomorrow, along with the Wi-Fi modules. I've read a lot of blurbs about loading programs via Wi-Fi, but I haven't seen any PC software that can do that. Is this a feature of the most current Propeller Tool, or is there a separate loader that I need to download? Or ... is there a TCP driver that emulates a serial port?

Enquiring minds want to know. TM

Thanks,
-Phil

Comments

  • It's all in the secret sauce of the WiFi modules firmware.

    The WiFi module is listening for a UDP packet to be broadcasted and then responses with it's information that can then be used to create a TCP connection to the board.

    SimpleIDE can load program that way and I have a program that can load programs over WiFi to the P2 that way.

    Works great for application that you don't want tethered.

    Mike

  • BlocklyProp Solo is another option that natively supports WiFi loading.

    When detected in the local subnet, WiFi modules get added to the com-port dropdown in both BlocklyProp and SimpleIDE.

    I think with the command line loaders (prop-loader / etc..), you can either autodetect or specify the IP address too; handy should the module be on another subnet.

  • Neither SimpleIDE nor Blockly help me since I'm programming in Spin for the P1. Nor does PropLoader unless I can find a pre-compiled .exe.

    Thanks anyway,
    -Phil

  • dgatelydgately Posts: 1,631
    edited 2022-10-06 14:48

    @"Phil Pilgrim (PhiPi)" said:
    ... Nor does PropLoader unless I can find a pre-compiled .exe.

    You can get a pre-compiled version of proploader.exe by downloading Flexprop from: https://github.com/totalspectrum/flexprop/releases
    You'll find proploader.exe in flexprop's bin directory. And, yes works with P1 or P2!

    proploader.exe usage:

    ./proploader 
    PropLoader (totalspectrum branch) v1.9-14 (2022-10-05 11:39:35 g64d6321)
    
    usage: ./proploader [options] [<file>]
    
    options:
        -b <type>       select target board and subtype (default is 'default:default')
        -c              display numeric message codes
        -D var=value    define a board configuration variable
        -e              program eeprom (and halt, unless combined with -r)
        -f <file>       write a file to the SD card
        -i <ip-addr>    IP address of the Parallax Wi-Fi module
        -I <path>       add a directory to the include path
        -k              prompt before exiting due to an error
        -p <port>       serial port
        -P              show all serial ports
        -q              during terminal display check for exit status from Propeller
        -Q              quiet mode, fewer messages
        -r              run program after downloading (useful with -e)
        -R              reset the Propeller
        -s              do a serial download
        -t              enter terminal mode after the load is complete
        -T              enter pst-compatible terminal mode after the load is complete
        -v              enable verbose debugging output
        -W              show all discovered wifi modules
        -xDEBUG         enter DEBUG monitor (P2 only)
        -xTAQOZ         enter TAQOZ (P2 only)
        -2              assume Prop2 (same as chipver=P2)
        -9 <dir>        start plan 9 file system with root at <dir>
        -?              display a usage message and exit
    
    file:               binary file to load (.elf or .binary)
    
    Target board type can be either a single identifier like 'propboe' in which case the subtype
    defaults to 'default' or it can be of the form <type>:<subtype> like 'c3:ram'.
    
    Variables that can be set with -D are:
    
    Used by the loader:
      loader reset clkfreq clkmode fast-loader-clkfreq fast-loader-clkmode
      baud-rate loader-baud-rate fast-loader-baud-rate chipver
    
    Used by the SD file writer:
      sdspi-do sdspi-clk sdspi-di sdspi-cs
      sdspi-clr sdspi-inc sdspi-start sdspi-width spdspi-addr
      sdspi-config1 sdspi-config2
    
    Value expressions for -D can include:
      rcfast rcslow xinput xtal1 xtal2 xtal3 pll1x pll2x pll4x pll8x pll16x k m mhz true false
      an integer or two operands with a binary operator + - * / % & | or unary + or -
      or a parenthesized expression.
    
    Examples:
      loader=rom  to use the ROM loader instead of the fast loader
    
  • @"Phil Pilgrim (PhiPi)" said:
    Neither SimpleIDE nor Blockly help me since I'm programming in Spin for the P1. Nor does PropLoader unless I can find a pre-compiled .exe.

    As Dennis mentioned, a pre-complied proploader comes with FlexProp. For that matter you can use the FlexProp GUI to download binaries via WiFi, and the flexspin compiler can compile binaries for P1 -- either as P1 LMM (fast but big) or P1 bytecode (slower but small). The bytecode support is marked experimental because there are still some missing features that C or BASIC might need, but for Spin programs it should work fine. Ada did a very nice job of creating the P1 bytecode backend.

    (Or, you can compile with openspin, bstc, or some other compiler, and just use the GUI for downloading the final binaries).

Sign In or Register to comment.