Monday, December 21, 2009

Both INCLUDEPATH and DEPENDPATH are usually needed in qmake .pro project files.

qmake, the build tool provided with the Qt toolkit, converts project files written in its own mini-language to platform-specific Makefiles.

This process includes adding necessary dependencies to the Makefile, so that changes in source files trigger rebuilding of the outputs that depend on said sources.

If your project is spread across directories, you'll likely add an INCLUDEPATH line to your .pro file so that the #include directives look sane -- say #include "library/foo.h" instead of #include "../library/foo.h". This can be done by adding INCLUDEPATH += "../" to the .pro project file.

This, by itself, doesn't cause the files in include directories to be treated as dependencies. This is a sane default, since you likely don't want to rebuild your whole project if a system library changes -- assuming, of course, that the library is meant to stay binary compatible between releases!

Thus, if any of your source files references a file from somewhere within INCLUDEPATH, it won't cause a dependency for that file to appear in the Makefile. You have to add the path to DEPENDPATH, too.

Thursday, December 03, 2009

Zultys WIP2 WiFi Phone with Asterisk

I have recently brought up an Asterisk extension on a Zultys WIP2 WiFi phone. The process had a few minor glitches, but I was able to resolve them all.



The system consists of:

  1. Zultys WIP2 wireless phone,
  2. HP Procurve AP530 wireless access point,
  3. HP Procurve 2625PWR managed Ethernet switch,
  4. a server running CentOS 5 with asterisk-1.6.1.9-90 from atrpms.
First of all, Zultys only provides manuals/firmware to their products in their knowledgebase. You have to sign up to use that. Even so, WIP2 was missing from that list. I have ~20 ZIP 4x4 phones also running off the 2625PWR switch, and their firmware/manuals are available in the KB. I emailed their support, and they quickly responded with the manual and 1.0.12 firmware. The phone had 1.0.3 installed.

I added a separate VLAN on a separate IP network just for the WIP2 phone and configured everything accordingly. Since WIP2 only supports WEP, it's not really secure, so I treat that VLAN as untrusted and only open up the SIP port on the server, as well as allow DHCP and TFTP read-only traffic. The phone only supports 802.11b.

I've had the AP530 set up for one 802.11a radio, and one 802.11g radio, so that had to be changed to 802.11a and 802.11b. Since I don't have external antennas on the AP, 802.11b+g cannot coexist as that configuration requires hooking up external antennas. The phone-specific SSID was configured to use WEP, run on the locked-down VLAN and was enabled only on the 802.11b radio.

The phone, as received with 1.0.3 firmware, was first manually configured with the WiFi settings (SSID and WEP key). It then rebooted, and automatically detected the DHCP and TFTP servers, and loaded the new configuration. Since I've had the ZIP 4x4 phones already configured to boot via DHCP and load their firmware updates and configuration from TFTP server, it was easy to copy the ZIP4x4_common.cfg to WIP2_common.cfg and modify to per the manual.

The lcd_contrast had to be set to 10 to make the display legible, ZIP4x4s need it to be set to 8.

Alas, no matter what the phone would not load the updated firmware automatically. Zultys phones let you enter the desired firmware version in the configuration file they load via TFTP, and they are supposed to then download that firmware, also via TFTP, should the desired and running versions differ. The only way that worked was manual update via the built-in bootloader. This is described in the manual, and it worked. The original 1.0.3 firmware's most visible bug was ignoring the power-off (red handset) button. Powering off required disconnecting the battery.

After updating the firmware, the phone would start behaving weird upon booting up -- it'd constantly lose the configuration settings as soon as the TFTP download finished. Only the antenna bars and the default "Zultys WIP2" greeting appeared. The left/right button icons were missing (no menu button!). It was possible to make calls by pressing the green handset button, but receiving calls didn't work. A subsequent reboot would not be able to access the network, as at that point the WEP key was already lost from the configuration (although it still was set in the radio up to the reboot). Perhaps the internally stored configuration format was incompatible between 1.0.12 and 1.0.3 firmware?

Somehow the configuration download would just cause the current configuration to be wiped out, in spite of the Information -> Config File menu showing "Config File OK". The failure looked, though, as if it were a partial failure, say as if an exception was thrown (and later caught) while merging the existing and downloaded configurations, since some parameters did get through.

To cure the problem, I had to remove the default greeting_message from WIP2_common.cfg. It had a slash within the string, and that seemed problematic. I also had to go to User Settings and restore the phone to factory settings. The phone was then rebooted, and I re-entered the WiFi settings. After a reboot, it did correctly load the configuration. One reboot after that, and it behaves as expected. It works quite well, although admittedly it's a very simple wireless setup with a single access point. I have not checked if wireless roaming works.