Qt SDK 1.2

Connecting MeeGo Harmattan Devices

MeeGo Harmattan is a Linux-based software platform developed by Nokia for mobile devices. It allows developers to create applications using the Qt framework. You can install and configure the whole tool chain that you need to create, build, debug, run, and deploy Harmattan applications as part of the Qt SDK.

Note: Qt SDK does not contain the tool chains for building applications for other MeeGo devices than MeeGo Harmattan. You can try to run applications from Qt Creator on other MeeGo devices, but it has not been extensively tested, and the instructions might not always apply.

Note: The only supported build system for Harmattan in Qt Creator is qmake.

Setting Up Connectivity in Harmattan Devices

To build and run Qt applications for Harmattan, you need a Harmattan device: Nokia N950 or Nokia N9.

You can connect your device to your development PC using either a USB or WLAN connection.

For the device, you need to use the SDK Connectivity tool that is preinstalled on the device to create the device-side end point for USB and WLAN connections. It provides no diagnostics functions but is essential for creating connections between the device and your development PC.

To use a WLAN connection, you must activate WLAN on the device and connect it to the same WLAN as the development PC. The network address is displayed in the connectivity tool.

To use a USB connection, you might need to set up the device as a network device on the development PC. However, on Linux, Mac OS X, and Windows 7, the USB interface is usually automatically configured.

Note: If you plan to connect your development PC to the device only over WLAN, you can ignore the USB-specific parts in the following sections.

Starting SDK Connectivity

SDK Connectivity application is preinstalled in Harmattan devices and available in developer mode.

To start SDK Connectivity:

  • On the device, select Settings > Security > Developer mode to turn on developer mode.
  • Select Applications > SDK Connectivity to start the SDK Connectivity application.
  • Select Select Connection and then select the type of the connection to create: WLAN or USB.
  • For a USB connection, select the operating system of the development PC in Select Module.

Connectivity Details displays the IP address and developer password. The address 192.168.2.15 is used by default. You must enter the password in Qt Creator. For more information, see Configuring Connections to Harmattan Devices.

Setting Up Network Connectivity on Development PC

Use the network configuration tools on your platform to specify the connection to the device on the development PC. You need to do this only if you use a USB connection.

The device uses the IP address 192.168.2.15 with the subnet 255.255.255.0 for its USB connection by default, so you can create the network interface with a different address inside the same subnet too.

Note: If you have changed the IP address of the device in the connectivity tool, you need to reflect those changes in your development PC USB network settings.

Linux

The USB interface is automatically configured. If, for some reason, that is not the case, run the following command in a shell as root user to create a new network interface:

ifconfig usb0 192.168.2.14 up

Mac OS X

The USB interface is automatically configured. If, for some reason, that is not the case, create a new network interface manually:

  • Open the network settings.
  • Click the + button on the network settings panel.
  • When the interface is available, select Configure IPv4 > Using DHCP with manual address.
  • Enter the address 192.168.2.14 into the IP address field.
  • Click Apply.

    The network connection between your device and workstation is now configured.

Windows 7

When you connect your device to your Windows 7 computer, Windows installs a driver for the Linux USB Ethernet connection automatically. If the installation does not start, unplug the USB cable and try another USB port on your computer.

Note: Driver installation takes some time.

The USB interface is automatically configured. If, for some reason, that is not the case, create a new network interface manually:

  1. Open the Network and Sharing Center and select Change adapter settings.

    The Linux USB Ethernet connection you just installed is displayed as a new Local Area Connection Linux USB Ethernet/RNDIS gadget.

    Note: If you cannot see Linux USB Ethernet/RNDIS gadget, try to unplug and replug the USB cable.

  2. Right-click Linux USB Ethernet/RNDIS gadget and select Properties.
  3. Edit the Internet Protocol Version 4 (TCP/IPv4) properties to specify the IP address for the connection. In the Use the following IP address field, enter the following values:
    • IP Address: 192.168.2.14
    • SubnetMask: 255.255.255.0
    • Default gateway: leave this field empty

Windows XP

If you develop on Windows XP and use a USB connection to run applications on the device, you need the Nokia USB drivers that are installed as part of the Qt SDK.

When you connect the device to your Windows PC, Windows tries to install a driver for the Linux USB Ethernet connection. In the Found New Hardware Wizard, select No, not this time in the first dialog and Install the software automatically in the second dialog.

To specify a network connection:

  1. Open the Network Connections window.
  2. Select the Linux USB Ethernet connection that is displayed as a new Local Area Connection.
  3. Edit the Internet Protocol Version 4 (TCP/IPv4) properties to specify the IP address for the connection. In the Use the following IP address field, enter the following values:
    • IP Address: 192.168.2.14
    • SubnetMask: 255.255.255.0
    • Default gateway: leave this field empty

Depending on your version of Microsoft Windows you may have to unplug and re-plug the device to reload the driver with its configuration accordingly.

Configuring Connections to Harmattan Devices

To be able to run and debug applications on the emulator and devices, you must set up connections to the emulator and devices in the Qt Creator build and run settings. If you install Qt SDK, the connection to the emulator is configured automatically and you only need to configure a connection to the device.

You use a wizard to create the connections. You can edit the settings later in Tools > Options > Linux Devices > Device Configurations.

"MeeGo Device Configurations dialog"

By default, you create the connection as the developer user. This protects real user data on the device from getting corrupted during testing. If you write applications that use Qt Mobility APIs, you might want to test them with real user data. To create a connection as a user, specify the Username and Password in Qt Creator. For more information, see Testing with User Data on MeeGo Devices.

You can protect the connections between Qt Creator and a device by using either a password or an SSH key. If you use a password, you must generate it in the connectivity tool and enter it in Qt Creator every time you start the connectivity tool.

If you do not have an SSH key, you can create it in Qt Creator. Encrypted keys are not supported. For more information, see Generating SSH Keys.

You can view processes running on devices and kill them. For more information, see Managing Device Processes.

To configure connections between Qt Creator and a device:

  1. To deploy applications and run them remotely on devices, specify parameters for accessing devices:
    1. Connect your device to the development PC via a USB cable or a WLAN. For a USB connection, you are prompted to select the mode to use. Choose PC suite mode.

      Note: If you experience connection problems due to a USB port issue, switch to a different port or use WLAN to connect to the device.

    2. Select Tools > Options > Linux Devices > Device Configurations > Add.
    3. Select Device with MADDE support (Fremantle, Harmattan, MeeGo) > Start Wizard, and add a new configuration for a hardware device.

    4. In the The name to identify this configuration field, enter a name for the connection.
    5. In the The system running on the device field, select the software platform of the device.
    6. In the The kind of device field, select Hardware device.
    7. In the The device's host name or IP address field, enter the IP address from the connectivity tool on the device.
    8. In the The SSH server port field, enter the port number to use for SSH connections.
    9. Click Next.
    10. Follow the instructions of the wizard to create the connection.
  2. To specify build and run settings:
    1. Open a project for an application you want to develop for your device.
    2. Click Projects to open the projects mode.
    3. In the Build Settings section, choose the MADDE Qt version that was registered by the installation program.

    4. In the Run Settings section, Device configuration field, select the device connection or the emulator connection.

    Note: The new application wizards automatically set the folder where the file is installed on the device in the Remote Directory field. For example, /opt/usr/bin. If the text <no target path set> is displayed, click it to specify a folder.

Troubleshooting Harmattan Connections

The addresses used in this example might be reserved by some other application in your network. If you cannot establish a connection, try the following optional configurations:

IP Address and Network on DeviceUSB Network on Development PCHost Name in Qt Creator Build Settings
172.30.7.15 255.255.255.0172.30.7.14 255.255.255.0172.30.7.15
10.133.133.1510.133.133.1410.133.133.15
192.168.133.15192.168.133.14192.168.133.15

Note: You cannot use the value localhost for connections to a device.

Note: VPN connections might block the device connection.