-
Notifications
You must be signed in to change notification settings - Fork 153
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
Achllle
wants to merge
1
commit into
nasa-jpl:master
Choose a base branch
from
Achllle:serial_reorg
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Serial done better #187
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,43 +118,16 @@ The RPi talks to the motor controllers over serial bus. | |
sudo raspi-config | ||
``` | ||
|
||
Then use the menu to enable **I2C** and **Serial** under `Interfaces`. More on raspi-config [here](https://www.raspberrypi.com/documentation/computers/configuration.html). | ||
Then use the menu to enable **I2C** and **Serial** under `Interfaces`. When you enable `Serial Port`, it will ask: | ||
|
||
**TIP**: If `raspi-config` isn't installed, run `sudo apt-get install raspi-config`. If that doesn't work, run `echo "deb http://archive.raspberrypi.org/debian/ buster main" >> /etc/apt/sources.list && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7FA3303E && sudo apt-get update` to allow `apt` to find the program, then try reinstalling with `sudo apt-get install raspi-config`. | ||
|
||
### Disable [email protected] | ||
|
||
**NOTE**: this section may no longer be necessary with newer versions of debian. We suggest skipping it and revisiting if serial does not work. | ||
* Would you like a login shell to be accessible over serial? --> Select 'No' using the arrow keys and 'tab' and 'enter' keys on your keyboard | ||
* Would you like the serial port hardware to be enabled? --> Yes | ||
|
||
Because we are using the serial port for communicating with the roboclaw motor controllers, we have to disable the [email protected] service. This service has some level of control over serial devices that we use, so if we leave it on it we'll get weird errors ([source](https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3-4/)). Note that the masking step was suggested [here](https://stackoverflow.com/a/43633467/4292910). It seems to be necessary for some setups of the rpi4 - just using `systemctl disable` won't cut it for disabling the service. | ||
If it asks you to reboot, answer 'yes'. | ||
|
||
**Note that the following will stop you from being able to communicate with the RPi over the serial, wired connection. However, it won't affect communication with the rpi with SSH over wifi.** | ||
More on raspi-config [here](https://www.raspberrypi.com/documentation/computers/configuration.html). | ||
|
||
``` | ||
sudo systemctl stop [email protected] | ||
sudo systemctl disable [email protected] | ||
sudo systemctl mask [email protected] | ||
``` | ||
|
||
### Copy udev rules | ||
|
||
Now we'll need to copy over a udev rules file, which is used to automatically configure needed linux device files in `/dev` namely, `ttyS0 and ttyAMA0`. These are used to connect to the Roboclaws using the RPi's GPIO pins. Here's a [good primer](http://reactivated.net/writing_udev_rules.html) on udev. | ||
|
||
```commandline | ||
# copy udev file from the repo to your system | ||
cd ~/osr_ws/src/osr-rover-code/config | ||
sudo cp serial_udev_ubuntu.rules /etc/udev/rules.d/10-local.rules | ||
``` | ||
|
||
and enter your password if requested. | ||
|
||
Reload the udev rules so that the rules go into effect and the devices files are set up correctly. | ||
|
||
```commandline | ||
sudo udevadm control --reload-rules && sudo udevadm trigger | ||
``` | ||
|
||
This configuration will persist across RPi reboots. | ||
**TIP**: If `raspi-config` isn't installed, run `sudo apt-get install raspi-config`. If that doesn't work, run `echo "deb http://archive.raspberrypi.org/debian/ buster main" >> /etc/apt/sources.list && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7FA3303E && sudo apt-get update` to allow `apt` to find the program, then try reinstalling with `sudo apt-get install raspi-config`. | ||
|
||
### Add user to tty and dialout groups | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats this slack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/nasa-jpl/open-source-rover/?tab=readme-ov-file#join-a-community-of-hundreds-of-builders