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
Networking using Wifi
My wifi adapter is a D-link DWA-125. I have been able to get it to work with both WPA and WEP, without installing any additional drivers:
WEP:
# sudo ifdown wlan0
# sudo iwconfig wlan0 essid 2WIRE185 key 0704575771
# sudo ifup wlan0
# sudo dhclient wlan0 -v -d
WPA: 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
In both cases, find out what IP address the beagle received
# ifconfig wlan0
and then on your laptop/computer (using the correct IP address):
ssh -l ubuntu 192.168.1.140
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. An optional power transistor (logic-level MOSFET in this case) can be used to drive loads of higher current:
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 resistor, 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.