Enketo Form is missing an icon at top left corner

140 views
Skip to first unread message

Sounay Phothisane

unread,
Dec 4, 2015, 5:57:25 AM12/4/15
to enketo-users
Hi,

I'm using Enketo Express, and when we go to the form, the status icon located at the top left is missing as attached.

Thus, I could not collect data while offline. can anybody help?

Regards,
Sounay

Sounay Phothisane

unread,
Dec 4, 2015, 6:21:20 AM12/4/15
to enketo...@googlegroups.com
Is it the difference between Enketo Express and Core?

Regards,
Sounay

--
You received this message because you are subscribed to a topic in the Google Groups "enketo-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/enketo-users/n4Xm_bcXkVA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to enketo-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martijn van de Rijdt

unread,
Dec 4, 2015, 11:24:28 AM12/4/15
to enketo...@googlegroups.com
Hi Sounay,

Both Enketo Legacy (old) and Enketo Express (new) use Enketo Core. (The version in Enketo Legacy is no longer updated though).

Both have online-only and offline-capable webform views. It looks like you may either be loading an online-only webform (which won't show that icon), or something is going wrong with downloading the applicationCache manifest or resources (and Enketo warns you that this form is not offline-capable yet). In the latter case you should see errors in the console.

Cheers,



--
You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


-- 
Revolutionizing data collection since 2012.

Enketo    |    LinkedIn    |    GitHub    |    Twitter    |    Blog

Sounay Phothisane

unread,
Dec 4, 2015, 11:38:05 AM12/4/15
to enketo...@googlegroups.com
Dear Matijn,

I think this is really important feature of Enketo and its usage. I followed all the steps in http://blog.enketo.org/install-enketo-production-ubuntu/ 
Should I download the files manually and overwrite it?

The one you showed me https://odk.enke.to/::YYYV  is having the same issue too, i guess.

Best Regards,
Sounay

Martijn van de Rijdt

unread,
Dec 4, 2015, 11:46:19 AM12/4/15
to enketo...@googlegroups.com
Yes, the one I sent is an online-only version.... :)

So to use offline-capable webforms, the best way depends what you're server you are using, and if you have buttons for both offline-capable and online-only forms, but it works like this:

  • Set "offline enabled" to true in config/config.json
  • restart the app (pm2 restart enketo)

api/v1 (this is probably the one you use):
  • the /survey API endpoint will now return an offline-capable webform (this API endpoint is hardcoded into formhub and Aggregate, not sure about Ona and Kobo)

api/v2:
  • use the /survey/offline API endpoint (the /survey endpoint will always return an online-only form).

Cheers,

Sounay Phothisane

unread,
Dec 4, 2015, 1:12:39 PM12/4/15
to enketo...@googlegroups.com
Set "Offline enabled" to true

and Ona settings:

# Enketo settings
ENKETO_URL = 'https://form.data.com/'
ENKETO_PREVIEW_URL = ENKETO_URL + 'preview'
ENKETO_API_INSTANCE_IFRAME_URL = ENKETO_URL + "api_v1/instance/iframe"
ENKETO_API_TOKEN = '0b24cee3dfcb35a10853f52b60e53db14d20433a'
ENKETO_API_SURVEY_PATH = '/api/v1/survey'
ENKETO_API_INSTANCE_PATH = '/api/v1/instance'
ENKETO_PROTOCOL = 'https'


But still does not work.

Do I have reboot Ona server every time when settings.py is changed?

Regards,
Sounay

Peter Lubell-Doughtie

unread,
Dec 4, 2015, 1:22:54 PM12/4/15
to enketo...@googlegroups.com

Hi Sounay,

Regarding the Ona server, yes you need to restart the python processes running the Ona webserver whenever the settings.py file is changed. This loads the new python code into memory.

Best,
Peter

Sounay Phothisane

unread,
Dec 4, 2015, 2:51:41 PM12/4/15
to enketo...@googlegroups.com
Hi Peter,

I rebooted it but nothing changed.

Regards,
Sounay

Sounay Phothisane

unread,
Dec 5, 2015, 12:06:55 AM12/5/15
to enketo...@googlegroups.com
I tried with Ona settings with everything /api/v1, /api/v2, /api_v1, /api_v2 and restarted.

But the offline mode is not working.

Here is my Enketo Settings:


    "app name": "Data Form",
    "port": "8005",
    "offline enabled": true,
    "linked form and data server": {
        "name": "KeptData",
        "server url": "data.com",
        "api key": "0b24cee3dfcb35a10853f52b60e53db1",
        "legacy formhub": true,
        "authentication": {
            "managed by enketo": true,
            "allow insecure transport": false,
            "external login url that sets cookie": "https://form.data.com/l$
        }
    },

Regards,
Sounay

Riungu Pascal

unread,
Dec 5, 2015, 12:49:53 AM12/5/15
to enketo-users
Hi Sounay

When I first set up my enketo-express server, I fought with this issue for over two days just like its happening to you.

The issue is NOT server or config.json related, as I can see your settings are correct. It is a SYNTAX issue. Yes it is.

For a form to be offline, first it has to be loaded to your browser cache as such. Else the default is ONLINE edition.

Also, how do you know your enketo is serving both ONLINE and OFFLINE versions?: In the online edition, the "Save as draft" feature is not available at the lower bottom, before submission button. For offline forms, the "Save as Draft" feature is available.

Here is how to force the offline editions to the cache of your browser:

a) Allow the server to generate for you the ONLINE version of the enketo form. The url will be of the form: https://odk.enke.to/::YYYV (Note the double colon syntax rule here I have highlighted). Scroll down the form and confirm that the "Save as Draft" feature is NOT available.

b). Now force the same form to be offline version by editing the double colon and manually introducing the following in place of the double colon "_/#" so that your new url looks like https://odk.enke.to/_/#YYYV (This is the url you enter in the browser address of the tablets being used to collect data if you expect offline situations to be experienced in the field). Scroll down the far end and you will see that the "SAVE AS DRAFT" feature is now back. With this URL, the data will be queued after you click submit button and automatically submitted every time the device detects a trace of internet. Nevertheless, the form will be working as a online edition if the device is continuously connected to the internet, its only that the submissions are queued first before sending to the server. Else, you can also manually force the pending submissions by clicking the "force submission" button on the upper left corner of your screen.

Let me know this sorted you out

Pascal

Sounay Phothisane

unread,
Dec 5, 2015, 1:03:26 AM12/5/15
to enketo...@googlegroups.com
Dear Riungu,

Thanks for your solution. It works :)   I also tried using this _# and it works too.

Which means, users have to manually edit their url every time to use the offline mode.

is there a way to force this URL permanently because using OFFLINE mode can either be used with or without internet and it would be better.

Best Regards,
Sounay

--
12-5-2015 12-59-40 PM.png

Riungu Pascal

unread,
Dec 5, 2015, 1:22:38 AM12/5/15
to enketo...@googlegroups.com

Hi Sounay

Unless you clear your browser cache, the offline url and unsubmitted data are permanently embedded in your browser and since the system manager is the one aware of this, there is no risk of enumerators compromising the form by reverting to the online version.

Glad you are sorted

Pascal

Sounay Phothisane

unread,
Dec 5, 2015, 2:17:42 AM12/5/15
to enketo...@googlegroups.com
Dear Riungu,

Thanks for the guidance. The issue is solved.

Much appreciated.

Regards,
Sounay

Martijn van de Rijdt

unread,
Dec 7, 2015, 11:56:09 AM12/7/15
to enketo...@googlegroups.com
Hi Sounay and Riungu,

If definitely works automatically as I described above using api/v1 and api/v2. There is no need for any manual URL editing and since those URL structures are likely to change it's really not recommended at all. I recommend you try a few api/v1/survey and api/v2/survey/offline API requests manually via the command line to check it works correctly. If it does, the issue is with the form/data server (I can't help with that but hopefully somebody else in the forum can). If it doesn't, your enketo app is not working properly.

The fact that you are both able to run an offline-capable form (after manually changing the URL) leads me to think the issue is not with your Enketo installation but with your form/data server. It simply might be using /api/v2/survey when it should be using either /api/v1/survey or /api/v2/survey/offline as I explained earlier.

If you have trouble creating the curl snippets to test in the console, you can send me message with the enketo URL and your config.json. I'll create one for you. 

Cheers,
Martijn

You received this message because you are subscribed to the Google Groups "enketo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enketo-users...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


-- 

RIUNGU PASCAL

unread,
Dec 7, 2015, 12:30:00 PM12/7/15
to enketo...@googlegroups.com

Hi Martijn

 

Thanks for this

 

I have updated everything in my server to api/v1 as guided herein and everything is now perfectly working as it should. I have tested with several forms.

 

Regards

 

Pascal

Martijn van de Rijdt

unread,
Dec 7, 2015, 12:43:35 PM12/7/15
to enketo...@googlegroups.com
That's great! Thanks for following up.
Reply all
Reply to author
Forward
0 new messages