Friday, July 27, 2007

RTC on the PXA270

In order to get DTN working properly in the future we need to have RTC setup and working on the gumstix. Jeremy and I at first thought that we could simply attach a backup battery to the V_BACKUP pin on the power control chip. We tried that and had 3V coming out on the V_RTC pin, but still the RTC would reset on every power down/restart. Then we thought it may be in software, so I looked through the driver code and commented out the line that resets the clock if the status register is misbehaving. The resets still persisted. Finally, I found out that on the PXA270 the RTC is on the chip and in order to keep the oscillator running we'd need to power the whole chip (at least keep it in deep sleep mode) and keep RAM alive. We decided to order an external RTC board, which is a DS1307 board which has I2C interface. Gumstix already has the patches for these boards and it should be pretty easy to get them setup once they come in and just set the PXA RTC to the external RTC.

Also, I've started to look at the CLA code for DTN2 and I'm still trying to figure out whether DTN sends out the bundles or if the CL has to do that. I should be able to understand that pretty soon. Ideally, I'll be able to simply notify DTN2 of link changes and have it handle message delivery. All the discovery can already be done by OLSR anyway.

Wednesday, July 25, 2007

more dtn on gumstix

I found that for some reason berkeleydb refuses to use pthreads installed on the gumstix. I've tried building the db with test and set by supplying "ARM/gcc-assembly". Also, I had to add -fPIC to CFLAGS to get it dtnd to load it on the verdex board. Lastly, it appears that the dtn build compiles in absolute paths, which has its issues since now it looks for the tcl in /home/timur/.... I ended up adding a symlink to the build. I will add more here once I make more progress.

Ok, Berkeley DB seems to be running with test-and-set, but now dtn crashes at the assertion: ASSERTION FAILED ((u_int)now.tv_sec >= TIMEVAL_CONVERSION) at bundling/BundleTimestamp.cc:39. I tried adding printf in there to see the value of now.tv_sec and I tried printing it to a file, but neither way produced any output (I did replace the dtnd file after recompiling). I'm not sure what the issue is and how to go about resolving it. I will look into this more tomorrow. I'm hoping Brian will know something about this, but not keeping my hopes up. If I can figure out why nothing is printed it'd be a big step in troubleshooting.

EDIT: Ok, the problem is not with the code or the assertion. DTN checks if the time is past midnight UTC December 31st, 1999 is (probably to make sure packet dates can be used correctly). The gumstix were set to midnight December 31st, 1969, thus the assertion was failing. I have DTN now running on the gumstix.

Monday, July 23, 2007

dtn and hostap

I built DTN for verdex with reasonable success and no big issues. For connex, using revision 1360 proved to be difficult so I tried a different one. Right now I'm trying to build revision 1340 with the packages required by dtn. One thing I have to fix is the path for berkeley db (which was also an issue with verdex). I think this will be done by tomorrow and then I can test it out.

On another note, with hostap it appears that ap_scan is very useful, as we can check ssids without invoking scan directly but instead examine the file in proc. This can be great in the future when we want passive scans to happen and simply check whether a new access point is available. I don't know if the linux-wlan driver supports this, but would be neat.

Justin has the communication setup and we looked into powering devices up/down. Looks like we can do it with wireless pretty easily by pccardctl and eject/insert commands. We're going to do more power measurements to verify that the card does indeed consume less power in that mode. I could not find a gpio pin to toggle to turn it off. Hopefully this will be sufficient.

Friday, July 20, 2007

building dtn

Dave's guide for DTN has been quite useful. A lot of the patches actually already appear in the later revision of the gumstix though. I had to add -ltcl8.4 to the LIBS in Rules.make in oasys to get liboasys to compile, thus getting dtn to compile. Everything else seems to compile fine.

DTN2

Since AP and OLSR appear to be running as expected, I was looking into how to setup store and forward. It appears that the route to take is to try to setup DTN2. After reading RFC4838, I realized that DTN runs on top of the transport layer, which means that OLSR can still do the routing and a DTN daemon on top can handle broken/disconnected links and store the data if a link is not available. I found a few explanations as to how to set it up and I will try to have DTN setup today.

Wednesday, July 18, 2007

dhcpd and dyn_gw

I have setup DHCPd on the verdex board and it appears I can communicate with the board fine. I have one more test to see if I can setup a simple two hop network and check if I can see the dhcp clients on a different subnet, which are not running OLSR. Hopefully, it will work fine. For dynamic gateway operation I used the dyn_gw_plain plugin, which seems to work fine. We have to toggle the interface manually, i.e. bring it up and down, but it detects such changes. The script to scan for access points and verify connectivity seems to be working fine now as well.

Tuesday, July 17, 2007

Ad-Hoc

Ok, Ming pointed out that running nodes in Ad-Hoc mode will make a lot more sense, since OLSR will take care of loops and can use signal strength to find the best route to a node. The script to scan for access points and associate with them was almost finished, but then I found linux-wlan-ng support wireless extensions if "options p80211 wlan_wext_write=1" is added to modprobe.conf. I will modify the script today and see if it works correctly. The next step is to get the dynamic gateway plugin to work. Last time I tried to use it, it segfaulted, but I have not looked into why too much. Worst case scenario I think I can put together a hack to do the same thing.