JPush

JPush provides a way for information to be pushed to a device or computer. It provides 'hooks' on the server that cause 'actions' to be performed on the device, such as checking for new email.

One common use is to get push email on a N900 device.

Contents

How it Works

JPush utilizes an existing XMPP (Jabber) connection to communicate with a device. The client adds the server as a 'buddy' using any existing jabber account on the N900.

Setup

Pre-Setup

  • Create jabber account separate from your own (anywhere works, gmail, jabber.org, etc).
  • Add server account to buddy list of client account.
  • Modest must be set to check for new email automatically (just set it to once every 24 hours). This is some odd issue that I ran into.
  • Install the following files as instructed below.

Install

  • Server: a .deb file is available here.
  • Client (N900): a .deb is not available yet. Download the source code from here, and install the files in any directory. Make sure the files are executable (chmod +x).

Configuration

Server

1. Edit /usr/bin/jpush-server

  • edit the config block:
    • insert username and password for a new jabber account created above.
    • set a secret that you will also put on the client (make this up).
    • set notifications (type of commands to be sent to the device). Leave this as the default if you only want email.

2. Setup Email Hook

  • /usr/bin/jpush-emailhook should be called whenever a new email is received. This sends an update to JPushServer, which notifies the N900.
  • This file receives two arguments -> /usr/bin/jpush-emailhook username updateType
    • EX: To receive push email, insert new line into /etc/aliases as:
      part-of-email-before-at-symbol "|/usr/bin/emailhook username email"
    • Run 'sudo newaliases' to make server update email config above.
    • Forward all email to part-of-email-before-at-symbol@server.com

3. Starting

  • Run jpush-server start

Client

1. Edit /?/?/jpush

  • edit the config block
    • set a secret (use the same value that you set for the server config above).
  • set client account information. Figure out client account information (run the following command to list all accounts:
/usr/bin/dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.AccountManager /org/freedesktop/Telepathy/AccountManager org.freedesktop.DBus.Properties.Get string:org.freedesktop.Telepathy.AccountManager string:ValidAccounts | grep "jabber"

2. Optional - Edit /?/?/actions.py

  • Follow instructions in file.

Download

https://garage.maemo.org/projects/jpush/

Retrieved from "http://bugs.maemo.org/JPush"