Skip to content
emarffy edited this page Jul 24, 2014 · 14 revisions

Symbai

A user manual of sorts, firstly a description of where and what all the files are, in order to facilitate maintenance at the field site - followed by some instructions.

On the tablet

The app creates and writes to a directory on the sdcard called symbai which contains:

  • local-symbai.db: this is the database the app opens, edits and syncs
  • files: a directory which contains all the images and audio files everyone has made
  • symbai.db: the latest database file downloaded directly from the raspberry pi, (whenever the user pressed download last). This can be copied to a Raspberry Pi in order to restore from backup (see below).
  • backup: contains dated copies of the raspberry pi's database, for redundancy - can also be used to roll back changes in extreme circumstances by renaming to symbai.db and copying to the raspberry pi. A new backup is created every time the main database is downloaded ("Download Main DB").
  • various csv files, raw formatted text files from the raspberry pi - for debugging/checking purposes

What to back up

The 'files' directory and 'local-symbai.db' are the important files - considered the output we will use later on. These are duplicated over all tablets in use as well as the Raspberry Pi so if they are regularly synced you'd need to lose all the devices to lose data, however it's a good idea to back them up elsewhere when you can.

I'd recommend periodically compressing the symbai directory on one of the tablets and either saving it to a laptop or emailing it somewhere safe.

NOTE the 'email main db' button in the sync screen only emails out the database, NOT the image/audio files.

"Download main DB" should be done on at least one tablet every day to create a daily backup.

###Deleted entities

Entities (Village/household/individual/child/crop) can be "deleted" in the main app, although they actually just hidden.

To un-delete an entity go to the symbaiDB app and locate the deleted entity. The field deleted:int will be "1" if the entity is deleted. Change this to "0" to un-delete.

##On the Raspberry Pi

The Raspberry Pi is simply a little computer, you can plug a keyboard and monitor in, but you don't need these to access it directly in the field.

###Accessing the Pi's database

You shouldn't need to access the Pi's database directly, except in extreme circumstances such as:

  • One of the Raspberry Pi's and/or sdcards is destroyed or stolen and you need to replace it with a new one.
  • Someone has deleted a lot of data or made a huge mess and the simplest option is to 'roll back' the database to a previously saved version (e.g. from one of the tablet's backup directories).

You can pull out the sdcard when the Pi is turned off, and look at it in a laptop (or even the tablet possibly, as the sdcard is actually an adapter for a micro-sdcard, which you can plug into some android tablets).

The main database file can be found at this location: /var/www/symbai/web/client/htdocs/symbai.db

You can copy databases from the tablets over this one, but make sure you back all the files up.

###Reading from the Pi without the app

It's also possible to read the Pi's database by connecting to symbai-web wifi, and visiting this URL on a normal internet browser: http://192.168.2.1:8889/symbai.db this will download the current version of the Pi's database. Probably not of much use, as this is simply what the download database button does on the tablets.

##Restarting the app

The app should be quite happy, but occasionally it's possible it may get stuck in a strange state and need to be restarted, for example if the sync doesn't post any messages. There are two ways to do this:

  • Press back until you get the the splash screen and then the desktop, then re-enter the app.
  • Use settings->applications to manually "Force stop" the symbai application.

##Reset the app to "factory settings"

Re-installing the app has no effect on the database (this means we can update it without losing data). However sometimes you may need to reset the database on the tablet, which you can do in the following way:

  • "Force stop" the symbai app (see above)
  • Delete sdcard/symbai/local-symbai.db and the contents of the files directory.

This will lose all un-synced changes so back up these files before deleting if you are unsure.

Clone this wiki locally