Fipy serial communication PC to Fipy USB/UART
-
Hi,
I want to transmit serial data from a PC through USB to Fipy.
I tried to send data in both direction.
On the PC side I am using Python with the Serial library.
On the Fipy I tried to use the Machine.UART class and the print() function.What did work?
- Connecting to the serial port in my case on Ubuntu /dev/ttyACM0
- Sending serial data from Fipy with the print() function and receiving it on the PC side
What did not work?
- Sending data to Fipy
Why does the serial communication only work in one direction?
I know that Fipy uses 2 UART interfaces where UART1 is used exclusive for REPL and UART2 for the LTE module.
Is there a way to send a byte stream from the PC to Fipy through USB?
-
@steph You can use sys.stdin.read() for receiving and sys.stdout.write() for sending. However, sys.stdin.read() is blocking and there is not way to tell that characters are waiting to be read. You can as well use UART 0 at a speed of 115200, which is the USB/UART interface.
-
Thanks a lot. It works with sys.stdin.read() and sys.stdout.write().
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login