Syncing your N900 with ownCloud

The other day I was lucky to get my hands on and old, solid Nokia N900 device. As I'm very enthusiastic about ownCloud, and currently also coding a bit on the Contacts App, of course the first the I had to do, was to set up syncing ownCloud Calendar and Contacts. Unfortunately that involved getting my hands dirty with syncevolution. I have tried that before with different configurations and devices, but I have always caved in after battling with the huge amount of configuration options and files. It took me from 9 PM to 9 AM to get it to work, but now I do believe I've got it right. Still a little rough around the edges, but that I can always fix, ha :-) As it involved editing a lot of files and running commands in a terminal window, I started with setting up an SSH server on the device. DuckDuckGo came to the rescue, and I found instructions on getting root access and connecting to the device over WiFi with SSH. Once you're logged into the device remember to change to the normal user account with the command 'su user' and go to the users home directory with 'cd'. In this example owncloud refers to the URL to the root of your onCloud installation e.g. http://example.com/owncloud, user is your login and password is - you guessed right - your password πŸ˜‰ The default first calendar in onCloud is called default calendar. The space in the name is asking for trouble, so I created a new calendar and called it calendar. Easy to remember. First setup the sync to the ownCloud server:
syncevolution --configure \
             --template SyncEvolution \
             backend=CalDAV \
             --sync-property username=user \
             --sync-property password=password \
             --sync-property syncURL=owncloud/apps/calendar/caldav.php/calendars/user/calendar \
             --sync-property deviceId=n900 \
              consumerReady=0 \
             target-config@owncloud-calendar
Test to see if there is a connection to the server by listing the events:
syncevolution --print-items target-config@owncloud-calendar calendar
If you get any errors try to have a look at the access log for the webserver ownCloud uses and read the one syncevolution produces. It's very verbose to say the least. Next setup the connection to the calendar on the device:
syncevolution --configure \
              --template "SyncEvolution Client" \
              syncURL=local://@owncloud-calendar \
              evolutionsource=N900 \
              username= \
              password= \
              type=maemo-events \
              consumerReady=1 \
              owncloud-calendar calendar
The username and password fields are empty on purpose because the credentials for the server sync is used, but for some reason they have to be there. Now it's time to see if it works by running the first sync. It has to be run in slow mode the first time, and yes, it is really slow.
syncevolution --sync slow owncloud-calendar
Syncevolution is very picky on the validity of the data and I had a couple of disturbing error messages during the first sync, but everything seemed to work OK. For doing normal incremental sync run:
syncevolution owncloud-calendar
Of course you don't want to have to open a terminal everytime you want to sync, but I'll leave that as an excercise for the reader πŸ˜‰ (Hint: look in the Resources section) Now for the Contacts. Set up the server sync:
syncevolution --configure \
              --template SyncEvolution \
              backend=CardDAV \
              --sync-property username=user \
              --sync-property password=password \
              --sync-property syncURL=owncloud/apps/contacts/carddav.php/addressbooks/user/default \
             --sync-property deviceId=n900 \
              consumerReady=0 \
              target-config@owncloud-contacts contacts
And again a test:
syncevolution --print-items target-config@owncloud-contacts contacts
Set up sync to the local address book:
syncevolution --configure \
              --template "SyncEvolution Client" \
              syncURL=local://@owncloud-contacts \
              evolutionsource=file:///home/user/.osso-abook/db \
              username= \
              password= \
              type=evolution-contacts \
              consumerReady=1 \
              owncloud-contacts contacts
Initial slow sync:
syncevolution --sync slow owncloud-contacts
And incremental sync:
syncevolution owncloud-contacts
Syncevolution saves the configuration in ~/.config/syncevolution, so if you mess something up, just run rm -rf ~/.config/syncevolution/* (yes, I have once tried to add an extra space when running a similar command...) This setup will likely also work on the Nokia N800 and N9 and possibly on other devices too. Update: I have made a follow-up on this post with a simplified and more correct configuation. Resources: Sync Maemo 5 / Nokia N900 How to synchronize your Nokia N900's calendar with any calendar accessible to evolution (also if you usually use Thunderbird Lightning, Korganizer, ...) [SyncEvolution] CalDAV/CardDAV backends available How to connect PC to my Nokia N900 over WIFI? Root Access

Flattr this!

68 Comments

  1. 1
    MyNokiaN900 says:

    Thanks for the link to my site. So OwnCloud, does it work on the N900? I wouldn't mind giving it a try.

    • 2
      tanghus says:

      It works great. And thanks for the good instructions on setting up wifi access.
      The only current problem is that the DAV structure in ownCloud isn't quite sane, that's why I had to set up two syncs, instead of using the same for calendar and contacts.
      Version 3 is out on Monday btw, if you want to try it out :-)

  2. 5
    notyourdata says:

    Thanks for the howto; so there is no way to set this up using the SyncEvolution GUI in N900?

    • 6
      tanghus says:

      Maybe there is, but it totally messed up the configuration for me. SyncEvolution has support for standard configuration setups, like Memotoo, Yahoo and Google. Maybe if we could get them to add one for ownCloud it would be usable,

  3. 7
    bugzy says:

    I keep getting the error:

    [ERROR] default: backend 'select backend' not supported by any of the backend modules (syncecal.so, synckcalextended.so, syncsqlite.so, syncmaemocal.so, syncebook.so, syncfile.so, syncaddressbook.so, syncakonadi.so, syncxmlrpc.so, syncdav.so, syncqtcontacts.so) or not correctly configured (databaseFormat '', syncFormat '')

    on step
    syncevolution --print-items target-config@owncloud-calendar default
    Any idea what might be causing this?

    Also wht version of syncevlution are you using on your n900

    • 8
      tanghus says:

      Sorry, your comment had been marked as spam for some reason.

      I don't know about that error message, but a quick search led to this mailing list msg which seems to be like it:
      http://lists.syncevolution.org/pipermail/syncevolution/2011-August/002754.html

      According to App.Manager my syncevolutio version is 0.12.

      • 9
        devian says:

        Am I missing something? when I try to syncronize I dont get any error messages, however my calendar doesn't syncronize two-way, I'm only getting the data from ownCloud (blank calendar, I added one event to test it)

        • 10
          tanghus says:

          You may be right. I really haven't had a chance to test it properly since I wrote the post, but now you mention it I seem to remember a 'sync=two-way' (or something like that) parameter that is not in the example above.
          I don't have the time to investigate right now, but it should be possible to find it somewhere in the Resources section.

          • 11
            devian says:

            Hey thanx for the quick reply, yeah I forget to mention that I did search for that also, the only thing I found was --source-property sync=two-way but it didn't make a difference, anyway tomorrow I will give it another try since is late already.
            Regards

          • 12
            tanghus says:

            That would be great! BTW, where did you put the property? At the server or client connection?

          • 13
            devian says:

            well I put it at the client side, I'm still pretty new at this, also I was looking to configure ownCloud, but there's no configurations I can do there

          • 14
            devian says:

            Well now I found out that it was working (two-way) I just added an event on my phone and got it sync on owncloud, however those events marked as "smart" (birthdays that I have synced on let's say facebook) are not syncing somehow N900 is using a different calendar, so I'm thinking about this property type=maemo-events ,maybe there's another option? I need to duck for that πŸ˜€

          • 15
            tanghus says:

            Hey, thanks for digging into this. I'll add your findings to the post.

  4. 16
    bugzy says:

    I keep getting the error:

    [ERROR] default: backend 'select backend' not supported by any of the backend modules (syncecal.so, synckcalextended.so, syncsqlite.so, syncmaemocal.so, syncebook.so, syncfile.so, syncaddressbook.so, syncakonadi.so, syncxmlrpc.so, syncdav.so, syncqtcontacts.so) or not correctly configured (databaseFormat '', syncFormat '')

    when I insert

    syncevolution --print-items target-config@owncloud-calendar default

    Changing the calendar (server or client) does not seem to resolve the issue

  5. 17
    Vlad says:

    One more thanks for the howto. I'm wondering if it's possible to synchronize todo( Evolution tasks) with owncloud. Own cloud can store todo's, but how I can get then with syncevolution?
    With "syncevolution --print-items ..." I'm getting both calendar and events, but when I sync calendar, todo's are not processed....

    • 18
      tanghus says:

      I use Kontact with ownCloud, and when I syncronize the calendar I get both todos and events. I don't know about Evolution, but you should ask at http://forum.owncloud.org
      Do you know if there is a todo app for Maemo that can be used either with syncevolution or directly with CalDAV? I could use one for the N900. I only had it for a couple of weeks, and after getting sync to work I haven't had time to fiddle more with it.

    • 19
      tanghus says:

      Or did I misunderstand your question?

      • 20
        Vlad says:

        Indeed not completely.While evolution has native support for CalDAV, I'd like to use syncevolution for performance reasons. It works well the only point that i have dificulties with configuring this to sync tasks as well.

        • 21
          tanghus says:

          I will have to read up a bit on that issue, but I'm almost sure that it's possible. I'm a bit busy with other stuff atm, but I'll look into it at some point. Configuring syncevolution is still mostly Greek to me πŸ˜›

        • 22
          tanghus says:

          I think the missing tasks is because I only specify 'type=maemo-events'. I don't know if it's possible to list them comma-separated like 'type=maemo-events,maemo-tasks' or if they should go in a separate config.

  6. 23
    Blizzz says:

    If you have spaces in your calendar URL (e.g. with default calender), it should work when you replace the space with %20.

    For example:
    syncURL="https://mylovelyserver.com/apps/calendar/caldav.php/calendars/user/default%20calendar"

  7. 25
    Blizzz says:

    Weird, for me it works flawlessly.

    When I look at the config file in ~/.config/syncevolution/my-target/sources/calendar/config.ini the working line reads:

    database = https://mylovelyserver.com:443/apps/calendar/caldav.php/calendars/user/default%20calendar/

    Though I have another problem. Obviously it is easily possible to sync to more ownCloud-calendars. But you can only sync with a single local calendar

    Β»Source properties are:

    per source
    the same for all users of a certain source, like backend and database selectionΒ«
    http://syncevolution.org/development/configuration-handling

    In the end would have the same calendars.. do i miss a workaround or do you have an idea for this?

    • 26
      tanghus says:

      In the example I setup the local source like this:

      evolutionsource=N900

      which is also listed when you run 'syncevolution' without any arguments. On my device it shows like:

      Maemo Calendar = maemo-events:
      N900 (id:1)
      Private (id:2)

      And in the calendar settings I have an option to add new calendars.

  8. 27
    Gunni says:

    Great, that works. Thanks for this HOWTO.
    One question though: Are the only syncable fields name, phone, email and organisation, or is there a way to sync fields like ICQ, Jabber-ID and so on? Is this because of syncevolution or because of owncloud?

  9. 31
    Jan says:

    Thanks for the great post. But you said this would also work on the N9, but it seems like it isn't. It says that syncevolution can't use CardDav

  10. 33
    Vlad says:

    The right way to do multiple backends in one sync and even multiple addressbooks/calendars:
    # syncevolution --configure --template WebDav syncurl=https://www.net.home:5232/ username=test password=xxx target-config@radicale
    # syncevolution --configure database=https://www.net.home:5232/test/addressbook/ backend=carddav target-config@radicale addressbook
    # syncevolution --configure database=https://www.net.home:5232/test/addressbook2/ backend=carddav target-config@radicale addressbook2

    Checks could be performed by
    # syncevolution --print-items target-config@radicale addressbook
    # syncevolution --configure --template SyncEvolution_Client syncurl=local://@radicale username= password= addressbook/database=local:system addressbook/uri=addressbook addressbook/backend=addressbook addressbook/sync=two-way addressbook2/database=local:1329395525.27462.4@vovan addressbook2/uri=addressbook2 addressbook2/backend=addressbook addressbook2/sync=two-way radicale addressbook addressbook2

  11. 34
    crypton says:

    Thank you for the great how-to. Syncing the calendar works perfect, but i'm having problems syncing the todolist of the n900. Syncevolution seems to read the changes correctly but the owncloud server seems to have a problem with the data:

    *** @default/todo ***
    after last sync | current data
    removed since last sync added since last sync
    -------------------------------------------------------------------------------
    > BEGIN:VCALENDAR
    > VERSION:1.0
    > BEGIN:VTIMEZONE
    > TZID:Europe/Berlin [...]
    > END:VTIMEZONE
    > BEGIN:VTODO
    > DTSTART:20120216T000000
    > DUE:20120216T000000
    > SEQUENCE:0
    > STATUS:NEEDS-ACTION
    > SUMMARY;ENCODING=QUOTED-PRINTABLE:=
    > UID:3080
    > test
    > END:VTODO
    > END:VCALENDAR
    -------------------------------------------------------------------------------

    [INFO] @default/todo: started
    [INFO] @default/todo: sent 1
    [INFO @owncloud-calendar] @owncloud-calendar/todo: started
    [INFO @owncloud-calendar] @owncloud-calendar/todo: adding "test"
    [ERROR @owncloud-calendar] @owncloud-calendar/todo: new CalDAV item did not contain exactly one VEVENT
    [INFO @owncloud-calendar] @owncloud-calendar/todo: received 1/1
    [INFO] @default/todo: normal sync done unsuccessfully
    [ERROR] @default/todo: fatal error (remote, status 500)

    Do you have any idea, what's going wrong here?

  12. 41
    ChoMar says:

    Great howto, Calendar works. But when i run Sync on the Contacts i get:
    First ERROR encountered: child process failed: error code from SyncEvolution fatal error (local, status 10500): @owncloud-contactsevolutionsource=file____home_user_.osso-abook_db/contacts: source not configured

    • 42
      tanghus says:

      Thanks :-)

      Just to ask the obvious first πŸ˜‰
      You did remember to configure the local source before syncing?
      syncevolution --configure \
      --template "SyncEvolution Client" \
      syncURL=local://@owncloud-contacts\
      evolutionsource=file:///home/user/.osso-abook/db \
      username= \
      password= \
      type=evolution-contacts \
      consumerReady=1 \
      owncloud-contacts contacts

      • 43
        ChoMar says:

        Yup... and its trying to access osso-abook, wich is the contact database if im interpreting things right. It just quits with "source not configured".
        So it fails on reading the local contact list. And i dont have a file contacts in ~/.osso-abook/db/

        • 44
          tanghus says:

          Hmm. Frankly I'm surprised that I got it to work in the first place πŸ˜€ SyncEvolution is so convoluted, that most of what it does is all Greek to me.
          Maybe you're better off asking in either a SyncEvolution or Maemo/N900 forum.
          Not much of an answer, I know, but I would be fooling you if I tried to "explain" πŸ˜›

      • 45
        villager says:

        You should place a space between the "syncURL=local://@owncloud-contacts" and the backslash, otherwise the evolutionsource part would become part of the syncURL. The error message suggests that this is what happened.

  13. 47
    Karel says:

    Hello Thomas

    I was playing with the setup for the last few days. With a lot of help from the syncevolution developpers I was able to extend your how-tp, which involves a few unnecessary or obsolete settings. Now the synchronisation between the right calendars works fine, just as sync of the contacts. Everything alltogether i
    under one setup - I can easily run the synchronisation from thesSyncevolution GUI with just one click.
    I am going to try the same setup with the synceoltuion on my desktop. I thought it might be a good idea to write those things into the owncloud documentation. Did not find how could I do this. I would like to contribute by helping with the documentation.

    • 48
      tanghus says:

      Hi Karel

      That is really great! I was kinda in the dark when I wrote this howto, so some cleanup would be in its place :-)

      The right place would probably be at http://owncloud.org/support/usage/synchronization/

      I do have write permissions, but you should probably contact Tom Needham, who is 'in charge' of the site. He is 'tpn' on the #owncloud freenet IRC channel found here: http://owncloud.org/contact/

      Regarding desktop synchronization using syncevolution at least Ubuntu lacks DAV support as I've written in this bug report:

      https://bugs.launchpad.net/ubuntu/+source/syncevolution/+bug/928210

      • 49
        Karel says:

        Hi

        I also thought about the synchronization-section in the documentation. I try to reach Tom and ask him how could I contribute on the documentation.

        Recently I started Ubuntu 12.04 Beta 1 from a USB-flash, installed owncloud 3 which is present there in the repo's, installed syncevolution 1.2 and the setup worked like a charm! So up syncevolution 1.2 upward should be everything ok, users with Ubuntu 11.10 or older have to compile syncevolution from the sources to get the WebDavo support I guess.

        I am also hoping to have working Tasks and Notes in the comming owncloud4. Anything I could help you with ?

        • 50
          tanghus says:

          That is good news indeed. I'll wait for the release before I'll test it though πŸ˜‰

          Regarding Tasks and Notes (I'm guessing you're talking about VTODO and VJOURNAL entries?) at least Bart Vischer has started on a web interface for it https://mail.kde.org/pipermail/owncloud/2011-September/001011.html and https://gitorious.org/owncloud/owncloud/commits/tasks
          I think I also read about someone making a notes app, but I can't remember where.
          If it's something you want to work on simply announce it on the mailing list. I think Bart has been too busy to continue work on the Tasks app πŸ˜‰

        • 51
          tanghus says:

          Hi Karel

          Did you manage to get in touch with Tom?
          You can contact me at thomas at tanghus dot net if you want me to put the documentation on owncloud.org instead.

          BTW I noticed Bart did a commit to the Tasks app on the 19th I think, so he hasn't given up on it. Would be great to have in OC4.

          • 52
            Karel says:

            Hi Thomas

            I did not have time yet to look for Tom, I am quite bussy with finding new PhD positin for myself :-). I would like to contribute and make the documentation by myself, but in the meantime I can send you the commands I used to set up the sync between the N900 and owncloud 3.

            I am glad to hear that there could be a Tasks-app in the upcomming owncloud 4. Any plans to merge the Calendar and the Tasks apps together in the future? Like it is done in Outlook/Evolution or other PIM programms?

            It is pitty, that VTODO and VJOURNAL are not supported by the syncevolution. I think that owncloud would need a own SyncMl service in the future. There could be still a way to sync Tasks and Notes by using Syncevolution as a SyncML server over HTTP. Syncevolution would then store the data in plain files which could be again used to sync them again the notes. I am investigating this now.

  14. 53
    An Owl says:

    Hi Thomas,

    thanks to your HowTo I finally got my N900 synched with OwnCloud and from there synched with Evolution.
    Though it it still was a pain in my behind. I finally found out that OwnCloud 4 seems to have a different DirTree than the previous versions. The "right" syncURLs are therefore
    "PathToOwnCloud/remote.php/caldav/calendars/USERNAME/YOURCALENDAR"
    and
    "PathToOwnCloud/remote.php/carddav/addressbooks/USERNAME/YOURADDRESSBOOK"
    Both can be optained directly in OwnCloud.

    • 54
      tanghus says:

      Yes, I should update the post to show the new paths. Thanks for reminding me.

      • 55
        An Owl says:

        Well I updated OwnCloud and it completely broke my calendar on my N900 and access with Evolution was not possible. After painfully reinstalling and setting up a new MySql database the solution was so trivial...

        They changed the path back, so yours the right one again, but OwnCloud still gives you the one introduced in v4.0.0 which is now wrong.

        • 56
          tanghus says:

          Actually both path schemes "should" work. I had it working perfectly with Kontact using the old paths with git stable4, but when I uploaded to my hosting space, I had to change it to /remote.php/...
          I still haven't tested on my N900 though.

  15. 57
    An Owl says:

    Mhm, we just need more people working with and at OwnCloud. Maybe someone gets lucky and finds a way to sync tasks, too, which strange is called ToDo in Maemo.

  16. 58
    ali c says:

    hello I'm looking for a working sync config. The config in the blog post didnt work for me.
    Tells me: "[Error] no such source"..
    but the link works in browser!
    Maybe trying the Radicale way specifing the DB.
    I'm using N900 with CSSU
    looking forward for having a working sync for my NIT.
    Sync with Evolution in Fedora 17 is working!
    Hoping there will be a community wiki for more actual documentation on working configs with different OC versions. After 4.0 desaster I'm using 3.0.3 and now 4.0.2 parralel.
    Still testing this cool stuff I've ever wished myself

  17. 59
    Mr.Gosh says:

    How did you guys get the SSL Certificate checking errors away? I imported my cacert certificate - but it still asumes a problem on an untrusted SSL certificate.

    How is it possible to deactivate the checking or better - to import the cacert root certificate to syncevolution?

    THX

  18. 60
    Vincent Petry says:

    It was very useful, thanks tanghus.

    @Mr.Gosh: For the SSL Certificate, you can add "SSLVerifyServer=0" after "consumerReady=0" when configuring the first time.

  19. 61
    Mr.Gosh says:

    Ah OK, I'll give it a try again. But is this still the way to do it? I saw a "CalDAV / CardDAV" Server preset in the syncevolution UI - this is not working?

  20. 63
    loop says:

    Thanks a lot for this very, very useful Howto.

    Maybe you can give the version of syncevolution that you used for this Howto. There are different version of syncevolution in the maemo repositries.

    Syncevolution version 1.1.1-1 currently in extras-testing did not work for me (β€œ[Error] no such source”.. ). I had to use version 1.2.1-1 in order to make it work.

    @ali c: This may also be the source of the error you encounter.

  21. 66
    narcisgarcia says:

    An easy way to synchronize Maemo Calendar with a CalDAV service:

    1. With the extras-devel repository enabled, install the package syncevolution-frontend

    2. Open the SyncEvolution application

    3. Tap on "Sync services", and press "Add new service". Next.

    4. Give a name to this subscription, select "Google calendar" template, and Next.

    5. Replace the "Sync URL" for the right one of your existing remote account. Fill username and password in Account boxes if necessary.

    6. Ignore the "Database configuration is not currently available for this service type" warning. Next, Finish.

    * Tested with DAViCal server software

  22. 68
    narcisgarcia says:

    Also contacts can be syncronized via CardDAV with the Yahoo template.