Nokia N9 app installed from Ovi Store behaves differently than locally compiled version (Digia Remote Camera) (SOLVED)



  • I am trying to send email from my N9 without user intervention. After failing over and over I decided to try to find an open source app that did it so that I could examine the source code. The one I chose was Digia's example of a Remote Camera: "http://store.ovi.com/content/275567":http://store.ovi.com/content/275567.

    I obtained the source from "https://gitorious.org/remote-camera":https://gitorious.org/remote-camera, opened it in QtCreator (latest stable version but I can't remember the version number). After answering the questions about creating files for Harmattan, etc., I compiled it without problems.
    I was then rather disappointed to find that when I ran it on my N9 that I got exactly the same message in the console as I had with my own code. The message was from the send function and said that it could not find the default account.

    When I installed the binary from the Ovi store it worked perfectly.

    So what am I missing?



  • I could guess that it has something to do with manifest.aegis (but I doubt that in this case). Do you get error code, error message or something like that? That could be used as starting point. Output in QtCreator's console window might contain relevant information as well.

    P.S. I could try running app you have pointed to on N9 but don't have time for that now.



  • If you have a chance to try it out I'd be very grateful. I don't think I am the only one struggling to send email from the N9.
    I have deleted some lines here to get under the 6000 character limit. The full text is in "http://pastebin.com/ZNdZ57MV#":http://pastebin.com/ZNdZ57MV#

    This is what I did:

    git clone git://gitorious.org/remote-camera/remote-camera.git remote-camera

    Then I opened the .pro file in QtCreator

    Qt Creator 2.4.1
    Based on Qt 4.7.4 (32 bit)

    Built on Jan 25 2012 at 11:24:30

    I unchecked the desktop build and checked the box for Harmattan.

    Then I built (clicked the hammer icon).

    A couple of unimportant issues were raised (notification of unstable API) but no errors.

    Then I connected my N9 via USB and ran the program from QtCreator (Control-r)

    The Compile Output window looked like this:

    =======================================

    23:02:41: Running build steps for project remotecamera...
    23:02:41: Configuration unchanged, skipping qmake step.
    23:02:41: Starting: "/usr/bin/make" -w
    make: Entering directory /home/whitefoot/qt-projects/remotecamera-build-harmattan-Harmattan_Target_-_QEmu_PR1_2__Qt_SDK__Release' ... make: Nothing to be done forfirst'.
    make: Leaving directory `/home/whitefoot/qt-projects/remotecamera-build-harmattan-Harmattan_Target_-QEmu_PR1_2__Qt_SDK__Release'
    23:02:41: The process "/usr/bin/make" exited normally.
    23:02:41: Creating package file ...
    23:02:41: Package Creation: Running command '/home/whitefoot/QtSDK/Madde/bin/mad dpkg-buildpackage -nc -uc -us'.
    ...
    /usr/bin/make INSTALL_ROOT="/home/whitefoot/qt-projects/remotecamera-build-harmattan-Harmattan_Target
    -_QEmu_PR1_2__Qt_SDK__Release"/debian/remotecamera-digia install
    ....
    dh_builddeb
    aegis-manifest: Creating 'remotecamera-digia.aegis'.
    dpkg-genchanges -b -u.. >../remotecamera-digia_1.3.0_armel.changes
    ...
    Package 'remotecamera-digia' installed.

    23:02:56: Connecting to device...
    ...
    Preparing to replace remotecamera-digia 1.3.0 (using .../remotecamera-digia_1.3.0_armel.deb) ...
    Unpacking replacement remotecamera-digia ...
    aegis-installing remotecamera-digia (from '')
    Setting up remotecamera-digia (1.3.0) ...
    Processing triggers for desktop-file-utils ...
    ...
    23:03:31: Package installed.
    23:03:31: Deploy step finished.

    =======================================

    The program started, I touched the start button on the N9 screen waited for the timeout (10 seconds) and then moved it around to simulate movement so that it would take several shots. Then I closed the program with a swipe. The Application output window looked like this:

    =======================================
    Killing remote process(es)...
    Starting remote process ...
    Remote process started.
    Successfully resolved MeeGo graphics system: /usr/lib/qt4/plugins/graphicssystems/libqmeegographicssystem.so

    X Error: BadDamage (invalid Damage parameter) 153
    Extension: 146 (Uknown extension)
    Minor opcode: 2 (Unknown request)
    Resource id: 0x1e00007
    ...
    Found v1.4 driver, enabling brokenTexSubImage
    ...
    MeegoGraphics: found EGL_KHR_fence_sync
    "org.freedesktop.DBus.Error.AccessDenied" "Rejected send message, 3 matched rules; type="method_call", sender=":1.13000" (uid=29999 pid=29132 comm="/opt/remotecamera/bin/remotecamera ") interface="com.nokia.mce.request" member="req_tklock_mode_change" error name="(unset)" requested_reply=0 destination="com.nokia.mce" (uid=0 pid=563 comm="/sbin/mce --force-syslog "))"
    "" ""
    hijackWindow() context created for QmlApplicationViewer(0xaed13a68) 1
    Found SGX/MBX driver, enabling FullClearOnEveryFrame
    Found v1.4 driver, enabling brokenTexSubImage
    QGLWindowSurface: Using plain widget as window surface QGLWindowSurface(0x1f7b9d48)
    "org.freedesktop.DBus.Error.AccessDenied" "Rejected send message, 3 matched rules; type="method_call", sender=":1.13000" (uid=29999 pid=29132 comm="/opt/remotecamera/bin/remotecamera ") interface="com.nokia.mce.request" member="req_tklock_mode_change" error name="(unset)" requested_reply=0 destination="com.nokia.mce" (uid=0 pid=563 comm="/sbin/mce --force-syslog "))"
    "" ""
    libqtcontacts-tracker: initializing libqtcontacts-tracker 4.19.2-1+0m8 for /opt/remotecamera/bin/remotecamera [29132]
    ... The previous line is repeated about 120 times
    libqtcontacts-tracker: engine.cpp:1591: Not cleaning up obsolete resources for nao:hasTag property since the property's range is too generic (rdfs:Resource).
    send Cannot obtain default account
    message.type(): 4 msgType: 0
    void QtMobility::QMessageServicePrivate::stateChanged(QtMobility::QMessageService::State) emitting stateChanged( 3 )
    send Cannot obtain default account
    message.type(): 4 msgType: 0
    void QtMobility::QMessageServicePrivate::stateChanged(QtMobility::QMessageService::State) emitting stateChanged( 3 )
    "org.freedesktop.DBus.Error.AccessDenied" "Rejected send message, 3 matched rules; type="method_call", sender=":1.13000" (uid=29999 pid=29132 comm="/opt/remotecamera/bin/remotecamera ") interface="com.nokia.mce.request" member="req_tklock_mode_change" error name="(unset)" requested_reply=0 destination="com.nokia.mce" (uid=0 pid=563 comm="/sbin/mce --force-syslog "))"
    "" ""
    send Cannot obtain default account
    message.type(): 4 msgType: 0
    void QtMobility::QMessageServicePrivate::stateChanged(QtMobility::QMessageService::State) emitting stateChanged( 3 )
    Meego graphics system destroyed
    QSqlDatabasePrivate::removeDatabase: connection 'qmailstore_sql_connection' is still in use, all queries will cease to work.
    libomap3camd 1.136
    libomap3camd 1.136
    Finished running remote process. Exit code was 0.

    The message:

    send Cannot obtain default account

    is exactly the same as I get when I try to execute similar code in my own programs.

    No email is sent. But if I remove the application and install the binary from the Ovi Store it works perfectly.



  • Here is little detail for you:

    When you launch app from QtCreator you run your app as "developer" user on N9. If you run your app from start screen by clicking icon you run app as normal user. Thus error "Cannot obtain default account" simply means than user "developer" does not have e-mail account set-up (I am not even sure if that's possible). Could you check if app is working if started by clicking icon? If not I will try compiling it myself later.



  • I feel like kicking myself (and Nokia and Digia).

    It never occurred to me to try that. It works, thank you.

    So, of course, I now have another question: how should one go about debugging programs that include email sending? Is there any better way than simply creating an on device log file? Is there a simple way to redirect the debug output to a file?

    Anyway, I can start to make a bit more progress.

    Thanks again.



  • Redirecting output to file might be possible. You should run app from terminal. Something like: /opt/app/bin/app > output.txt . I have never tried that myself so I'm not sure if that will work properly - e.g. startup line in desktop file is slightly different but I believe that line only makes your app singleton (no other instance of your app will run if icon is clicked again). I guess that should work. You might need to google how to redirect stderr to file but I guess that will not be necessary.

    Overall regarding "developer" and "user" MeeGo is quite restrictive and it is good thing. That makes N9 more secure. Using "developer" user you can ssh to your N9 but I believe it is impossible to "su" to user. It was possible some time ago but they fixed this security hole.

    I think that's all I can advice.



  • [quote author="daliusd" date="1358083481"]
    ...
    I think that's all I can advice.[/quote]

    Sounds like good advice to me,

    Thanks again.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.