Menu

ff-shell.tcl will not work correctly in macos

2023-10-04
2023-10-13
  • Bernard Mentink

    Bernard Mentink - 2023-10-04

    Hi, love the FlashForth, just what I needed for the Atmega328p.

    However, struggling to get code onto this device as the python ff-shell3.py will not work and the preferred ff-shell.tcl hangs when trying to connect to the port. (If I put in a non existant port, at least I can get into the tcl application, but soon as I try to enter a valid port, it hangs and I have to kill the process ..
    I tried with sudo, but it won't run at all. Should not need it, as my user can access the port with screen fine ..

    The port for me is /dev/tty.usbmodem144301.
    I can interract with the board with the 'screen' program just fine.

    Appreciate some help

     
  • Bernard Mentink

    Bernard Mentink - 2023-10-04

    Never mind, found it worked if I connect to /dev/cu.usbmodem144301, not sure what the difference is between the two versions of the same port..

    Works really slow at loading code though even with 1ms delay.

     
  • Bernard Mentink

    Bernard Mentink - 2023-10-04

    Is there any chance of operating at higher baud rates? Or is it just not faster enough to interpret ..

     

    Last edit: Bernard Mentink 2023-10-04
  • Mikael Nordman

    Mikael Nordman - 2023-10-05

    I don't think the baudrate is the problem. The TCL shell waits for 100 ms for each line.
    You can fix it by editing the sendLine procedure.

    diff --git a/shell/ff-shell.tcl b/shell/ff-shell.tcl
    index 8937504..04ea7be 100755
    --- a/shell/ff-shell.tcl
    +++ b/shell/ff-shell.tcl
    @@ -365,11 +365,11 @@ namespace eval smartSend {
                 resetFlags
                 return -code error "sendLine failed on entry: Timeout waiting for CR."
             }
    -        set retries 20
    +        set retries 2000
             while {$waitingForCR && ($retries > 0)} {
                 # puts "sendLine waiting for CR, retries remaining: $retries"
                 update
    -            after 100
    +            after 1
                 incr retries -1
             }
             if {$waitingForCR} {
    @@ -380,7 +380,7 @@ namespace eval smartSend {
             # Send all characters with pauses between and a CR at end.
             foreach character [split $line {}] {
                 serialPort::send $character
    -            after $pauseBetweenChar; # pause after each character
    +            #after $pauseBetweenChar; # pause after each character
             }
             serialPort::send "\r"
             set waitingForCR true
    
     
    • Bernard Mentink

      Bernard Mentink - 2023-10-05

      Thanks Mikael, that was perfect, much faster ..
      Now all I need is a way to send all files in a folder/directory, and maybe
      skip comments .... :)

       

      Last edit: Bernard Mentink 2023-10-05
  • Mikael Nordman

    Mikael Nordman - 2023-10-13

    The pyserial library exists also for OSX. Why does the ff-shell3.py not work on OSX ? What are the error messages ?

     
  • Bernard Mentink

    Bernard Mentink - 2023-10-13

    I installed pyserial with pip, but still get this:

        import serial
    ModuleNotFoundError: No module named 'serial'
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.