2. Connecting via SSH and Configuring Pins - mayalassiter/bbg-grove GitHub Wiki

This page will walkthrough connecting your BeagleBoneGreen (BBG) to a network and how to use ssh to configure pins on your BBG.

#Connecting via SSH# First, connect your BBG to your network via ethernet cable. If you want the full IP address of your board, surf to your router gateway and look for the device "beaglebone". You can use this full IP address to ssh into your device, even from other networks. Otherwise, we will simply use the in-network name "beaglebone".

To ssh into your device, open a terminal window and type ssh debian@beaglebone. If you are using ssh from another network or want to use the full IP address just type ssh debain@<ip-address>.

If this is your first time connecting to your BBG you will be asked if you want to trust this new connection. Type yes and press Enter.

You will now be asked to type in a password. Because we are using the default Debian user, you can see in the prompt that the password is "temppwd".

You are now in the home directory of your BBG and controlling your BBG through ssh.

#Configuring Pins on the BBG# If you want to change pins directions from the command line and develop new stuff for the BBG, follow along here. This section goes deeper into using the command line than we need to develop with our library. It shows the framework for how our modules interact with the pins on board.

There are a few reasons you might need to configure pins from the command line, for example: to change the Grove port protocol to connect a certain sensor, and to change the behavior of a pin on board for new development. This is how, for instance, the BlockyTalky visual programming language can use both digital I/O devices and pwm sensors on the same Grove port.

We will walk through changing a pin mode from UART to GPIO. You can see the default BBG pin diagram here. You can change this behavior by editing the '/config_pin' file with your favorite text editor over ssh. The UART Grove port is given the pin macro P9_22 and the on board I2C Grove port is P9_20.

Next, you'll want to set up Git and the Dev Environment on your BBG here.

##Controlling Pins from the Command Line## You can also change pin output from the command line. This is because our Linux operating system can treat everything like text files, even pins! So you can manually control and read these values from your terminal just like normal text. To do so type sudo cd /sys/class/gpio/gpio2 to be reading pins as local files. You then can use the echo command to write to or read from pins.

⚠️ **GitHub.com Fallback** ⚠️