Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Talker #1

Open
alport opened this issue May 6, 2021 · 0 comments
Open

Problem with Talker #1

alport opened this issue May 6, 2021 · 0 comments

Comments

@alport
Copy link

alport commented May 6, 2021

Hi Romilly,
Thanks for your Sender - and Talker code.
It is a very elegant and versatile technique for communicating between python3 and the Pico.

However, something is not quite right, and I can't seem to figure it:
Using your original Sender code, I was getting a False after the second send:
`>>> s.send('on()')
True'

'>>> s.send('off()')
False`

When I received the False, I could fix it by issuing a s.receive() which (after a little delay - timeout?) printed out :'>>>'.
It seems that the prompt '>>>' is sitting in the buffer and needs to be cleared.

Then I looked at your more recent Talker code and you seem to have replaced Timeout=1 with Timeout=-1.
If I do a t=Talker(), I get an error with Timeout=-1:

t=Talker()
Traceback (most recent call last):
File "", line 1, in
File "/Volumes/GoogleDrive/My Drive/Python3/Pico/talker.py", line 17, in init
self.serial = serial.Serial(serialPort, 115200, timeout=timeout)
File "/Users/mike/miniforge3/lib/python3.9/site-packages/serial/serialutil.py", line 227, in init
self.timeout = timeout
File "/Users/mike/miniforge3/lib/python3.9/site-packages/serial/serialutil.py", line 369, in timeout
raise ValueError("Not a valid timeout: {!r}".format(timeout))
ValueError: Not a valid timeout: -1

Any suggestions?
Maybe the OSX 11.2.2 python serial module is behaving differently from your linux(?) version?
Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant