UCSCBaskin School of Engineering  
General Information Events, News & Organizations Degrees & Departments Research Classes Admissions & Advising People & Jobs Administration
CMPE 117 - Spring 2003

Instructions for using lnpd

First, you need to untar the package, with tar xfvz lnpd.tgz. Follow the instructions in the README file for compiling. Then, I had to add the following line to my .cshrc file:
setenv LD_LIBRARY_PATH /home/studentxx/lnpd/lnpd+liblnp/liblnp:$LD_LIBRARY_PATH
or to the .bashrc file:
export LD_LIBRARY_PATH=/home/studentxx/lnpd/lnpd+liblnp/liblnp:$LD_LIBRARY_PATH
where I assume that /home/studentxx is the path to the directory where you have expanded lnpd.tgz.

To run it, get two windows. On one, do, from the lnpd/lnpd+liblnp/lnpd directory:
./lnpd --nolock --debug --log=/dev/stdout --verbosity=i
From the other one, go to the lnpd/lnpd+liblnp/applications directory, and do:
./lucatest
This will list on the screen the packets it is receiving. Each packet is listed in two lines: the first line contains the hex dump, and the second line is the packet content.

I tested this code, and I believe it is free of bugs.

Suggestions

You have to shut off both lnpd and lucatest before loading new programs onto the Lego brick, otherwise strange things may happen (the Lego goes into a funny state and stops working).

Also, you need to start a fresh instance of lnpd and lucatest from time to time.

Finally, as you can see from the documentation for lnpd, there may be a way to write all of your code for the PC, and debug it there first, and only later port it to the Lego brick. Once you get lnpd running, the Lego side and the PC side look the same to a running application.

A final note

Depending on the system, it might be the case that you can run lnpd (the first of the two windows above) only as root. Otherwise, the PC was not receiving any packets, essentially. I don't have this problem on my PCs, but if you have it in the lab, let me know.

Let me know if there are any problems.


General info · News · Events · Degree Programs · Research · Classes · Admissions · Advising · People · Jobs · Administration
SOE Webmail · SOE SSH · SOE Wiki · Search · Sitemap · Contact us · Driving directions · Privacy · UCSC
© Baskin School of Engineering, University of California, Santa Cruz
1156 High St., Santa Cruz, CA 95064 · (831) 459-2158 · webmaster@soe.ucsc.edu