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

Serial done better #187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Serial done better #187

wants to merge 1 commit into from

Conversation

Achllle
Copy link
Collaborator

@Achllle Achllle commented Mar 31, 2024

Simplified instructions for serial comms setup and switch to using primary serial device (miniUART).

Before this PR, the setup caused the serial device chain to look like this:

bluetooth                   -> /dev/serial0 -> /dev/ttyS0 -> UART 1
roboclaw connection -> /dev/serial1 -> /dev/ttyAMA0      -> UART 0

which is not the recommended approach. After, it will look like:

roboclaw connection -> /dev/serial0 -> /dev/ttyS0      -> UART 1
bluetooth                   -> /dev/serial1 -> /dev/ttyAMA0 -> UART 0

When set up correctly using raspi-config, there should be no need for udev rules or /boot/firmware/config.txt hacking.

@Achllle Achllle added enhancement New feature or request documentation labels Mar 31, 2024
@Achllle Achllle self-assigned this Mar 31, 2024
Copy link
Collaborator

@abust005 abust005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look straightforward, I'll sign off on them

@Achllle
Copy link
Collaborator Author

Achllle commented Apr 7, 2024

Sharing my learnings from diving into getting bluetooth to work on the RPi 4.
I never got both bluetooth and the miniUART for connecting to the roboclaws to work consistently.

In fact I had to disable bluetooth altogether in the /boot/firmware/config.txt dtoverlay=disable-bt to get things to work consistently again. Adding that overlay makes the RPi use the UART 1 (PL011) instead of the miniUART for connecting to the roboclaws, which is likely going to be more consistent. I think we should add such line in so that the PL011 is used by default for everyone. That would make the mapping look like:

lrwxrwxrwx 1 root root 7 Mar 31 02:22 /dev/serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Mar 31 02:22 /dev/serial1 -> ttyS0

which looks like how it was before, but this time we're doing it 'the right way'.

I'm giving up on bluetooth in the short term, might try again with the RPi5 since that doesn't have the miniUART anymore.

It would be good for someone to give this PR a test just to make sure this works fine. I need to add instructions for adding the disable bluetooth overlay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants