Shop OBEX P1 Docs P2 Docs Learn Events
FlexPropGui installation under Linux — Parallax Forums

FlexPropGui installation under Linux

Hi there, I want to install MicroPython on P2.

For that, I do need to install FlexProp on Linux (I'm using a Linux Mint derived from Ubuntu). Windows is banned here!

As the documentation is not ready (link missing) on https://www.parallax.com/propeller-2/get-started/micropython/ then I did try to find my way but I'm stuck with an error.


Here what I do

sudo apt update
sudo apt-get install wish
sudo apt install build-essential
sudo apt-get install g++
git clone --recursive https://github.com/totalspectrum/flexgui.git
cd flexgui 
git submodule update --recursive
make install

which creates the ~/flexprop in my user folder.

Then I do the following to start FlexProp

cd ~/flexprop
export ROOTDIR="`pwd`"
# execute the GUI
./flexprop.tcl

And it throw the following error

domeur$ ./flexprop.tcl 
Error in startup script: can't read "spin2gui_version": no such variable
   while executing
"set aboutMsg "
GUI tool for FlexProp
Version $spin2gui_version
Copyright 2018-2021 Total Spectrum Software Inc.
------
There is no warranty and no gua..."
   (file "/home/domeu/flexprop/src/gui.tcl" line 9)
   invoked from within
"source $ROOTDIR/src/gui.tcl"
   (file "./flexprop.tcl" line 25)


Some help would be welcome.

Any suggestion?

Comments

  • Everybody welcome @domeu, a Python microcontroller coder with some significant experience in authoring. If there's anything we can do to help get him going I'd be most grateful and I'll document the FlexProp/Linux combination for others as a Quick Byte, should it be manageable for me to do so. @ersmith any tips on the Linux install?


    Welcome again, @domeu!


    Ken Gracey

  • This is my recipe for FlexProp in Ubuntu.. The update part doesn't work, I delete the source folder and redo the clone.

    Don't forget permissions needed for serial access...

    Thanks to ERsmith, Dgately, Wuerful for the help!


    Original install:

    dgately wrote: »

    » show previous quotes

    All the source is available in the github flexprop repository...

    https://github.com/totalspectrum/flexprop

    As ersmith stated, you can easily build the whole project (i.e. GUI, all the binaries for compiling & loading) on WIN10, Linux, macOS...

    I suggest (on Linux or macOS) something like:

    $ mkdir source

    $ cd source

    $ git clone --recursive https://github.com/totalspectrum/flexprop.git

    $ cd flexprop

    $ make clean # only if you had previously run make

    $ make install

    Note: '--recursive' allows git to include all of the projects sub-modules (PropLoader, loadp2, & spin2cpp).

    If successful, you'll find a new flexprop directory in your home directory, where you'll find the flexprop.tcl GUI, tools & sample code:

    $ cd ~/flexprop

    $ ls

    License.txt bin doc include src

    README.md board flexprop.tcl samples

    $ ls bin

    fastspin flexcc flexspin loadp2 mac_terminal.sh proploader


    Use flexprop.tcl if you like or the tools in the bin directory from the Linux/macOS command line. It's "all there".

    Note: flexprop may have some requirements for successful building... If make install does not work, you can probably get help here in the forum...

    dgately

  • try running "wish ~/flexprop/flexprop.tcl" without the quotes


    Thats how I start it on my mac.

  • Welcome @domeu ! I don't know what could have gone wrong, your installation steps looked OK to me and I just tried the same thing on a fresh Ubuntu 18.04 installation; I had to add a "sudo apt-get install bison" after the "build-essentials" but otherwise it was identical. In my case things worked though :(.

    The spin2gui_version variable should be set in a file called ~/flexprop/src/version.tcl. Does that file exist for you?

    If things don't work (as in this case) it's always worth doing a "make clean; make install" again. It's possible that somewhere in the initial build the version.tcl file got borked (or didn't get built the first time around).

  • Great, this time, the flexprop.tcl is running :-)

    Will now tries to upload P2MP

  • @ersmith

    I did clone the wrong Git.

    When a followed the instructions AND THE RIGHT Git at https://github.com/totalspectrum/flexprop ). Everything when right

  • domeudomeu Posts: 9
    edited 2021-01-30 01:08

    MicroPython is now Flashed with instruction from n https://www.parallax.com/propeller-2/get-started/micropython/

    So the P2 module and USB-Serial modules are working properly.

    HOWEVER REPL does not respond to KeyStroke ?!?! (not echo back in the terminal).


    I can connect Putty to /dev/ttyUSB0 at 115200 baud.

    I can see the REPL prompt appearing in putty when pressing the reset button on the Edge Module Breadboard (when sending REPL prompt, the USB-Serial led is RED --> OK )


    When I do type on the keyboard, the USB-Serial bling in blue --> char are sent to the P2. But nothing appears on the terminal (No echo from REPL and USB-Serial does not blink red).

    Pressing the ENTER key doesn't do anything (eg: showing REPL error message because of invalid key stroke).


    I did also tried the Mu-Editor in "ESP mode" (this should be mentioned in the installation doc).

    The REPL doesn't respond to keyboard Stroke.


    Any suggestion or additional test ?

  • Yes Mu editor in ESP mode is fine.

    I think someone else reported this problem too, let me find what fixed it for them

  • Try this to replace "step2"... let me know if it works, thanks


  • Great, this new step2 did effectively uploaded running version of MicroPython to the P2, REPL is now running.

    I can reach REPL from Mu editor and Putty (terminal Emulator)... but an important issue still exists (I will post a new comment)


  • It is not possible to manage file on the P2 from Mu Editor (click "file" icon produce and error).


    As I'm use to terminal MicroPython tool like RShell (very popular tool) and Ampy (from Adafruit Industries), I did tried them to get more information.

    Here what I did grab with RShell

    domeu@dom$ rshell --port /dev/ttyUSB0 --buffer-size 32
    Using buffer-size of 32
    Connecting to /dev/ttyUSB0 (buffer-size 32)...
    Trying to connect to REPL connected
    Testing if ubinascii.unhexlify exists ... b'OK\r\nexit\r\n\xff\x00\x00'
    Traceback (most recent call last):
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/main.py", line 1307, in connect
       ip_address = socket.gethostbyname(port)
    socket.gaierror: [Errno -2] Name or service not known
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
     File "/home/domeu/.local/bin/rshell", line 8, in <module>
       sys.exit(main())
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/command_line.py", line 4, in main
       rshell.main.main()
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/main.py", line 2966, in main
       real_main()
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/main.py", line 2928, in real_main
       connect(args.port, baud=args.baud, wait=args.wait, user=args.user, password=args.password)
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/main.py", line 1313, in connect
       connect_serial(port, baud=baud, wait=wait)
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/main.py", line 1337, in connect_serial
       dev = DeviceSerial(port, baud, wait)
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/main.py", line 1627, in __init__
       Device.__init__(self, pyb)
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/main.py", line 1391, in __init__
       unhexlify_exists = self.remote_eval(test_unhexlify)
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/main.py", line 1515, in remote_eval
       return eval(self.remote(func, *args, **kwargs))
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/main.py", line 1493, in remote
       self.pyb.enter_raw_repl()
     File "/home/domeu/.local/lib/python3.6/site-packages/rshell/pyboard.py", line 203, in enter_raw_repl
       raise PyboardError('could not enter raw repl')
    rshell.pyboard.PyboardError: could not enter raw repl
    

    And what I get

  • The Ampy did return the following error message

    domeu@dom$ ampy --port /dev/ttyUSB0 ls
    b'OK\r\nexit\r\n\xff\x00\x00'
    Traceback (most recent call last):
     File "/home/domeu/.local/bin/ampy", line 8, in <module>
       sys.exit(cli())
     File "/home/domeu/.local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
       return self.main(*args, **kwargs)
     File "/home/domeu/.local/lib/python3.6/site-packages/click/core.py", line 782, in main
       rv = self.invoke(ctx)
     File "/home/domeu/.local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
     File "/home/domeu/.local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
       return ctx.invoke(self.callback, **ctx.params)
     File "/home/domeu/.local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
       return callback(*args, **kwargs)
     File "/home/domeu/.local/lib/python3.6/site-packages/ampy/cli.py", line 194, in ls
       for f in board_files.ls(directory, long_format=long_format, recursive=recursive):
     File "/home/domeu/.local/lib/python3.6/site-packages/ampy/files.py", line 162, in ls
       self._pyboard.enter_raw_repl()
     File "/home/domeu/.local/lib/python3.6/site-packages/ampy/pyboard.py", line 198, in enter_raw_repl
       raise PyboardError('could not enter raw repl')
    ampy.pyboard.PyboardError: could not enter raw repl
    
    

    Apparently, there is an issue with the response provided in RAW REPL mode

    b'OK\r\nexit\r\n\xff\x00\x00'

    I will do additional checks with a standard Pyboard to check what is the expected response.

    Dominique

  • Ok great that you got further along, Dominique


    We haven't tried Rshell or Ampy yet, but do have Pyboards.


    We have our own way of managing files one the P2, ozffs. To list the files type `files from serial tty or from usb keyboard or wireless keyboard. That will list the files in the extended flash memory, if there are any. The ` is the backtick character shared with the tilde ~ character at upper left of keyboard, typically

  • The difference is probably because when the P2 native micropython image exits it simple stops (and prints the exit message and from the terminal with chars 255 0 0) while the other platforms appear to now do a soft-reset and restart their REPLs. The difference comes about due to the original port the P2 native port started from (minimal vs stm32/esp32 which are more widely supported and have had far more work and changes done on them recently).

  • domeudomeu Posts: 9
    edited 2021-02-01 22:29

    OZFSS

    Understood for ozfss and tried it. I got an error on `files and on `save demo because it says

    exit
    �`save demo
    No FLASH detected!
    

    So I cannot save MicroPython files on the P2 at the moment.

    I did also notices that file extension is not used in ozffs. Is this possible to save bitmap or binary files on the file system.


    Soft Reset - Ctrl-D

    I did noticed that Ctrl-D (so named soft-reset) does completely stuck (Freeze) the REPL on the P2.

    On usual MicroPython life cycle, we are use transfert files, then to soft-reset in REPL session to start with clean session (from inside REPL). Then you can import your module from REPL with "import modulename".

    This is a very convenient way do develop large code file or tune a micropython driver for some hardware.

    So the defective support of Soft Reset is the reason why the RShell, Ampy and Mu file manager tool completely fails to work.


    MicroPython FileSystem not accessible from MicroPython

    It also appears that I can't open a file in write mode from the REPL session

    The following code

    f = open( "myfile", "w" ) 
    

    does returns an OSError: 1

  • roglohrogloh Posts: 5,837
    edited 2021-02-01 23:17

    The soft reset behavior from the other ports is something that could potentially be ported in an updated release assuming it didn't interfere with the stuff OzPropDev added to intercept serial characters and control things from another hidden level.


    For the filesystem you might need to open up a FAT volume and init the SPI interface for it. There are typically some extra steps needed there before you can start to read/write files and unfortunately a volume is not automounted by default because the SPI bus is shared with the SPI flash which is part of the ozffs thing and outside of MicroPython's reach.

  • Any advice on compiling flexprop on Arch?

    I'm getting the following errors and not sure if it is a makefile incompatibility with Arch or if it indicates missing dependencies on my system:

    After executing:

    make install INSTALL=~/flexprop

    I get:

    if test -f /home/otis/flexprop/Makefile; then echo "ERROR: Install directory contains a Makefile (possibly installing to original source)"; exit 1; fi
    make: *** No rule to make target 'spin2cpp/version.h', needed by 'src/version.tcl'. Stop.

    No "flexprop" directory exists at the target path thus no Makefile can exist there....

  • @proPonent said:
    Any advice on compiling flexprop on Arch?

    I'm getting the following errors and not sure if it is a makefile incompatibility with Arch or if it indicates missing dependencies on my system:

    After executing:

    make install INSTALL=~/flexprop

    I get:

    if test -f /home/otis/flexprop/Makefile; then echo "ERROR: Install directory contains a Makefile (possibly installing to original source)"; exit 1; fi
    make: *** No rule to make target 'spin2cpp/version.h', needed by 'src/version.tcl'. Stop.

    No "flexprop" directory exists at the target path thus no Makefile can exist there....

    The error is the line with the ***, which is that it cannot find the file spin2cpp/version.h. That most likely means that you forgot to clone the submodules of the project (one of which is spin2cpp). The detailed steps to follow are:

    cd $HOME
    mkdir -p src
    cd src
    rm -rf flexprop
    git clone --recursive https://github.com/totalspectrum/flexprop
    cd flexprop
    make install INSTALL=~/flexprop
    cd ~/flexprop
    ./flexprop
    

    It's very important to remember the --recursive flag on the git clone command.

  • I am having it seems the same problem installing. I followed the instructions on Umbuntu from this point and the terminal responses.
    git clone --recursive https://github.com/totalspectrum/flexprop
    Cloning into 'flexprop'...
    remote: Enumerating objects: 6377, done.
    remote: Counting objects: 100% (990/990), done.
    remote: Compressing objects: 100% (362/362), done.
    remote: Total 6377 (delta 660), reused 937 (delta 622), pack-reused 5387 (from 1)
    Receiving objects: 100% (6377/6377), 6.97 MiB | 1.10 MiB/s, done.
    Resolving deltas: 100% (3608/3608), done.
    Submodule 'PropLoader' (https://github.com/totalspectrum/PropLoader) registered for path 'PropLoader'
    Submodule 'loadp2' (https://github.com/totalspectrum/loadp2) registered for path 'loadp2'
    Submodule 'spin2cpp' (https://github.com/totalspectrum/spin2cpp) registered for path 'spin2cpp'
    Cloning into '/home/mcgyver/flexprop/PropLoader'...
    remote: Enumerating objects: 1671, done.
    remote: Counting objects: 100% (141/141), done.
    remote: Compressing objects: 100% (44/44), done.
    remote: Total 1671 (delta 111), reused 116 (delta 97), pack-reused 1530 (from 1)
    Receiving objects: 100% (1671/1671), 492.13 KiB | 1.12 MiB/s, done.
    Resolving deltas: 100% (1246/1246), done.
    Cloning into '/home/mcgyver/flexprop/loadp2'...
    remote: Enumerating objects: 1000, done.
    remote: Counting objects: 100% (215/215), done.
    remote: Compressing objects: 100% (111/111), done.
    remote: Total 1000 (delta 141), reused 173 (delta 104), pack-reused 785 (from 1)
    Receiving objects: 100% (1000/1000), 402.17 KiB | 1.11 MiB/s, done.
    Resolving deltas: 100% (650/650), done.
    Cloning into '/home/mcgyver/flexprop/spin2cpp'...
    remote: Enumerating objects: 46472, done.
    remote: Counting objects: 100% (419/419), done.
    remote: Compressing objects: 100% (173/173), done.
    remote: Total 46472 (delta 315), reused 303 (delta 246), pack-reused 46053 (from 3)
    Receiving objects: 100% (46472/46472), 19.37 MiB | 1.10 MiB/s, done.
    Resolving deltas: 100% (33282/33282), done.
    Submodule path 'PropLoader': checked out '44472262021f7a73691bf66566c47fe73373117f'
    Submodule path 'loadp2': checked out '46279542564f180fc131b4761bcd8bbbf967b996'
    Submodule path 'spin2cpp': checked out 'fcac18469be505cd9bcbe8215446cf908c57dcfa'
    Submodule 'Test/spinsim' (https://github.com/Wuerfel21/spinsim) registered for path 'spin2cpp/Test/spinsim'
    Cloning into '/home/mcgyver/flexprop/spin2cpp/Test/spinsim'...
    remote: Enumerating objects: 242, done.
    remote: Counting objects: 100% (42/42), done.
    remote: Compressing objects: 100% (29/29), done.
    remote: Total 242 (delta 25), reused 27 (delta 13), pack-reused 200 (from 1)
    Receiving objects: 100% (242/242), 505.01 KiB | 1.12 MiB/s, done.
    Resolving deltas: 100% (117/117), done.
    Submodule path 'spin2cpp/Test/spinsim': checked out 'abf969f43ed193792241ef8822ad0a1d60a69d0d'
    mcgyver@mcgyverspc:~$ cd flexprop
    mcgyver@mcgyverspc:~/flexprop$ make install INSTALL=~/flexprop
    ERROR: Install directory contains a Makefile (possibly installing to original source)
    make: *** [Makefile:70: check_dir] Error 1

  • pik33pik33 Posts: 2,388

    It seems you cloned the git repository to ~/flexprop. It should be cloned elsewhere. Clean the /flexprop directory, makedir something like ~/flexprop_src, cd here, then git clone and make. Then cd ~/flexprop and run flexprop from there.

  • RaymanRayman Posts: 14,755

    Looks like your FlexProp download folder and install folder have same name somehow…

    Maybe try make install into a different folder than FlexProp ?

  • ersmithersmith Posts: 6,068

    As others have said, you're trying to install into the same directory, which isn't supported. Please follow all of the instructions, including the ones that say mkdir -p src and cd src before doing the clone.

  • This is what I pasted in at first try. The second try (after deleting all src/flexprop adds) from cd $HOME line seems to do ok though there are some warnings, it seems to be loading.

    sudo apt-get update
    sudo apt-get install build-essential xxd
    sudo apt-get install bison git tk8.6-dev
    sudo apt-get install texlive-latex-recommended pandoc
    cd $HOME
    mkdir -p src
    cd src
    rm -rf flexprop
    git clone --recursive https://github.com/totalspectrum/flexprop
    cd flexprop
    make install INSTALL=~/flexprop
    cd ~/flexprop
    ./flexprop
    Anyway I hate I can't pinpoint the difference or error I evidently made.

  • RaymanRayman Posts: 14,755
    edited 2024-12-21 21:08

    Can one put all the steps into a script file to make it easier?

    Just cd to home and then run the script ?

    Flexprop has been getting lots of updates recently so have to do this a lot…

  • dgatelydgately Posts: 1,631

    @McGyver said:
    cd flexprop
    make install INSTALL=~/flexprop <========= This is probably an issue...

    Defining INSTALL creates the path to where the flexprop directory will be created. This would create "~/flexprop/flexprop" as the resultant directory path (And, only if there was already a flexprop directory at ~/). Just "make install" will do what you want.
    ...

    Anyway I hate I can't pinpoint the difference or error I evidently made.

    dgately

Sign In or Register to comment.