Re: [Flashforth-devel] ff-shell3.py question
Brought to you by:
oh2aun
|
From: Mikael N. <mik...@fl...> - 2024-07-06 19:13:55
|
So did you have to change some python statements to get it working on
OSX ?
Something I could incorporate in the distribution ?
Mikael
On 2024-07-06 21:28, Mark Ennamorato wrote:
> found it..fixed it thanks.
> now..on to getting the tcl script to run...
> Mark
>
> On Jul 6, 2024, at 9:10 AM, Mark Ennamorato <mar...@gm...>
> wrote:
>
> thanks Mikael,
>
> well... so after putting some debug prints in the code i found out the
> "No such file..." error message was due to the fact that its trying to
> find this file that did not exist and had nothing to do with the usb
> serial port !
>
> histfn = os.path.join(os.path.expanduser("~"), ".ff.history")
>
> so once i 'touched' ~/.ff.history it ran until I hit this snag
>
> local variable 'e' referenced before assignment
>
> which... 'e' is used for the "try...except" 's and not sure why python
> is complaining about it since its always something like
>
> except Exception as e: kind of thing
>
> weird
>
> mark
>
> On Jul 5, 2024, at 10:16 PM, Mikael Nordman
> <mik...@fl...> wrote:
>
> So I added the close() and open() to serial_open(config) and it works
> just fine on linux, maybe then also on OSX.
> Like this:
>
> try:
> config.ser = serial.Serial(config.port, config.rate, timeout=0.5,
> writeTimeout=1.0, rtscts=config.hw, xonxoff=config.sw)
> config.ser.close()
> config.ser.open()
>
> Does that help ?
>
> Mikael
>
> On 2024-07-06 02:50, Mark Ennamorato wrote:
> Hi sorry..somewhat frustrated at the moment im sure there is something
> dumb i am doing / not doing but..
> I *cannot* get the ff-shell3.py shell working at all .. M1 Mac, python
> 3.9.0
> USB serial on /dev/tty.usbmodem13201
> I changed tried running the ff-shell3.py with 'python3 ff-shell3.py
> /dev/tty.usbmodem13201' and get the dreaded "No such file or directory:
> /dev/tty.usbmodem13201' even though I can connect to it with screen no
> issues.
> So them I was looking at the code and see its got a serial port object
> "class Config(object)" and it so i changed default serial port to
> /dev/tty.usbmodem13201' in it but still same issue.
> hmm.... this should not be so difficult.
> so i played with some simple python code inside the repl. just using
> see = serial.Serial(PORT, BAUD) using same port /dev/tty.usbmodem13201
> and then ser.open() and I get "serial port is already open" .. so i do
> ser.close() first them ser.open() and it works, it sees my serial port
> just fine.
> so why isn't the ff-shell3.py seeing my serial port ??
> TIA
> Mark
> _______________________________________________
> Flashforth-devel mailing list
> Fla...@li...
> https://lists.sourceforge.net/lists/listinfo/flashforth-devel
> --
> --
> Mikael
>
> _______________________________________________
> Flashforth-devel mailing list
> Fla...@li...
> https://lists.sourceforge.net/lists/listinfo/flashforth-devel
--
--
Mikael |