Matt McCutchen edited this page Feb 15, 2016 · 35 revisions

Table of Contents

Synchronization doesn't work!

Before posting any issues, please make sure that you have set up org-mobile-push correctly (see question below).

Why do I need to use org-mobile-push before synchronizing?

The org-mobile-push command will copy all files that are included in the variable org-mobile-files to a directory specified by org-mobile-directory. It will also create three additional files called checksum.dat, index.org and agendas.org.

Agendas.org contains all the agendas specified in org-mobile-agendas. The idea is that Emacs will generate the agendas once in a while, instead of MobileOrg having to implement all of the features of org-mode.

Checksums.dat are simply the checksum of all files that will be synchronized. MobileOrg will use those to determine what files where modified since the last synchronization, thereby speeding up the sync and reducing bandwidth consumption.

Index.org contains information about the org files, like a list of tags, all files and their aliases, all todo keywords and whether a todo keyword is active or done.

In addition, MobileOrg will generate so called "edit nodes" when editing nodes in the outline. This makes it possible to edit entries in MobileOrg and synchronize the changes to Emacs in a safe way.

MobileOrg makes use of both checksums.dat and index.org. Without them, synchronization will not work!

More details on how to set up org-mobile-push can be found here, or simply type alt-x customize-group Enter org-mobile in Emacs.

I don't want all this syncing stuff, I just want to edit files!

MobileOrg stores the information contained in org files into a database. To view files, they first need to be transfered into that database. This is what the synchronizers do. It is currently not possible to edit files directly and will most likely not be in the near future.

Synchronization only updates the agendas.org file even though other files are added to index file

Take a look in your checksums.dat file in your org-mobile-directory -- it is probably incomplete. If you are running Windows, download sha1sum and set the variable org-mobile-checksum-binary in Emacs to point to it. Also delete the file that the Emacs variable org-id-locations points to. Finally delete your old checksums.dat, do a org-mobile-push and verify that all files are added to it properly.

Running org-mobile-push aborts with an error related to org-id-locations

Orgmode will cache your :ID: locations into a file. The Emacs variable org-id-locations-file specifies where this file is saved. Deleting it is usually enough to fix that problem.

The synchronization with the calendar doesn't work!

The calendar synchronizer will currently only update the calendar when files are changed through synchronization or if they are removed. The changes won't show up immediately when changing calendar options in the settings menu. When changing any of the options, such as enabling the calendar, press "Clear Database" in the settings menu and synchronize again.

How do I get org-mode to execute org-mobile-push automatically?

The code below will check if an org file that was saved is in the mobile agenda list and if it is the case it will set an idle timer to schedule a sync 30 seconds in the future. This will make it possible to do a chain of edits in several file, resulting in Emacs running push only once after it has been idle for the specified number of seconds.

(defvar org-mobile-push-timer nil
  "Timer that `org-mobile-push-timer' used to reschedule itself, or nil.")

(defun org-mobile-push-with-delay (secs)
  (when org-mobile-push-timer
    (cancel-timer org-mobile-push-timer))
  (setq org-mobile-push-timer
         (* 1 secs) nil 'org-mobile-push)))

(add-hook 'after-save-hook 
 (lambda () 
   (when (eq major-mode 'org-mode)
     (dolist (file (org-mobile-files-alist))
      (if (string= (file-truename (expand-file-name (car file)))
		   (file-truename (buffer-file-name)))
           (org-mobile-push-with-delay 30)))

(run-at-time "00:05" 86400 '(lambda () (org-mobile-push-with-delay 1))) ;; refreshes agenda file each day

How do I get org-mode to execute org-mobile-pull automatically?

Warning! org-mobile-pull removes incoming changes immediately from the mobileorg.org file but leaves them unsaved in the buffers for your org files. So under this configuration, if you open Emacs to do something unrelated to your org files and do not pay attention to the prompt about saving the org buffers when you quit, it is very easy to accidentally lose your changes. If this happens, you may be able to recover your data from the mobileorg.org~ backup file.

To get org-mode to pull at startup and monitor the file MobileOrg writes to, add the following to your Emacs configuration:

(require 'org-mobile)

(org-mobile-pull) ;; run org-mobile-pull at startup

(defun install-monitor (file secs)
   0 secs
   (lambda (f p)
     (unless (< p (float-time (time-since (elt (file-attributes f) 5))))
   file secs))

(install-monitor (file-truename
                   (file-name-as-directory org-mobile-directory)

;; Do a pull every 5 minutes to circumvent problems with timestamping
;; (ie. dropbox bugs)
(run-with-timer 0 (* 5 60) 'org-mobile-pull)

The Dropbox synchronizer doesn't work when I compile MobileOrg from the source code!

The file in res/values/dropbox.xml should contain a valid key for the Dropbox API. It is against the terms Dropbox provides to distribute the key that is integrated in the release version on Market. You can however create your own personal developer keys by going to https://www.dropbox.com/developers/apps. Because mobileorg-android still uses the deprecated v0 of the Dropbox API, you will need to file a Dropbox API support request from the developer site and ask them to specifically enable your app keys to work with API v0.

NOTE: I received this from Dropbox 3/27/14 in response to a request to enable my keys for API v0:

Thanks for writing in. The old v0 version of the API is no longer available, so unfortunately I can't make it available for your app. There's a migration guide here though: