Skip to content

Serial Communication via USB only #4216

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

Closed
arm358 opened this issue Feb 18, 2021 · 4 comments · Fixed by #4215
Closed

Serial Communication via USB only #4216

arm358 opened this issue Feb 18, 2021 · 4 comments · Fixed by #4215
Labels
Milestone

Comments

@arm358
Copy link

arm358 commented Feb 18, 2021

I'm trying to connect the raspberry pi PICO to the Raspberry Pi 4 and send data via Serial from the PICO to the Pi4.

Every example I see for Circuitpython uses either I2C or UART (i.e. using the pins on the board for Serial communication).

Is serial communication solely via USB possible? I want to only connect the Pico to the Pi4 with the USB cable and no other wires.

@microdev1
Copy link
Collaborator

Yup! it is possible... take a look at #4215.

@arm358
Copy link
Author

arm358 commented Feb 18, 2021

Yup! it is possible... take a look at #4215.

Awesome, good to hear. Unfortunately looks like it's pretty new? I'm a pretty basic user so much easier for me to follow a guide and adapt it to what I want to do...

Maybe there will eventually be some guides I can utilize! Thanks for the info.

@microdev1
Copy link
Collaborator

When the PR is merged the documentation will be available here.

If you want to get a head start at this... you can grab a uf2 from the artifacts page.
The functionality is similar to busio.UART so most of the existing examples will work with some modification like :-

import time
import usb_cdc
# import busio

uart = usb_cdc.serials[1]
# uart = busio.UART(board.GP0, board.GP1, baudrate=115200)

s = bytearray("hello\n\r".encode())

while True:
    uart.write(s)
    time.sleep(1)

@dhalbert
Copy link
Collaborator

Yup! it is possible... take a look at #4215.

Awesome, good to hear. Unfortunately looks like it's pretty new? I'm a pretty basic user so much easier for me to follow a guide and adapt it to what I want to do...

Maybe there will eventually be some guides I can utilize! Thanks for the info.

Yes, it is pretty new (last night 🙂 ). I will be writing a guide soon.

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

Successfully merging a pull request may close this issue.

3 participants