| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

BeagleBoard

This version was saved 12 years, 1 month ago View current version     Page history
Saved by Michael Shiloh
on March 21, 2012 at 10:55:53 am
 

Ubuntu

 

I'm currently running this version of Ubuntu on my Beagle Board xM

 

Networking over USB

 

I think (will verify today) that Ubuntu for the BBxM already set up networking over USB, so I just have to plug in a USB cable and configure the port on my laptop:

 

sudo ifconfig usb0 10.0.2.1 netmask 255.255.255.0
ssh ubuntu@10.0.2.12

Be patient, it takes a few moments the first time. The password is temppwd

 

Wifi

 

Following these instructions:

 

sudo apt-get install wpasupplicant
wpa_passphrase monkey1 l3ctric1 > wpa.conf
wpa_supplicant --help
sudo wpa_supplicant -Dnl80211  -iwlan0 -c wpa.conf -B
sudo dhclient wlan0
ifconfig wlan0

 

and then on laptop:

 

ssh -l ubuntu 192.168.1.141

 

How to use GPIO pins on the Expansion Connector for input and output

 

I found a couple of helpful sets of instructions ( this and this), but they didn't work. Thanks to a reply from Igor Yeremin on the extremely helpful BeagleBoard mailing list, I learned that the default configuration hast changed:

 

The default mux has most pins configured in mode 0 and not GPIO mode.
 

You can try using one of the pins that are GPIO by default:

 

157-159
161-162

136-139

 

136-139 can also work as inputs. The tutorial doesn't do mux because the pin 168 used to be configured
as GPIO before, but has been changed to mode 0 since then.

 

Combining the tutorials and the answer from Igor, this works wonderfully. Here is a shell script that sets up the device and then blinks an LED attached to Expansion Connector pin 22, which is GPIO 157:

 

$ cat blink.sh
#! /bin/sh

echo 157 > /sys/class/gpio/export
echo  out > /sys/class/gpio/gpio157/direction

while [ "1" = "1" ]; 
do 
echo  0 > /sys/class/gpio/gpio157/value; 
sleep 1; 
echo  1 > /sys/class/gpio/gpio157/value; 
sleep 1; 
done

 

Note that you have to run as root to do this, or make the script owned by root and set the sticky bit.

 

The LED is driven by a transistor used as a level shifter to get from 1.8V to 5V. I'll put the schematic here if anyone is interested.

 

Here is how to use GPIO 138 as an input. I've pulled Expansion Connector pin 5 (which is GPIO 138) to 1.8V (pin 1) through a 10K resistory, and also to ground through a switch. This reads HIGH when the switch is open, and LOW when the switch is closed.

 

In this example, I export the GPIO pin and set the direction manually, and have scripted only reading the input. I send the input directly to the output (GPIO 157), so that the LED goes on when the switch is closed (LED logic is reversed due to the transistor):

 

#  echo 138 > /sys/class/gpio/export
#  echo  in > direction

 

and the script is:

 

  # cat digitalIn.sh

  #! /bin/sh

  while [ "1" = "1" ];
  do
  cat  /sys/class/gpio/gpio138/value > /sys/class/gpio/gpio157/value;
  done

 

Comments (0)

You don't have permission to comment on this page.