Moodlebox and Moodle Mobile App

Moodlebox and Moodle Mobile App

by Ian Amess -
Number of replies: 22

Greetings from Zimbabwe. 

We have been using the MoodleBox (moodlebox.net) for remote area teaching and students have been using the Moodle mobile app on their phones to work "ofline" at home. It has been working great up to now.

Since I upgraded to Moodle 3.11 new users are struggling to get connected via the app (using version 3.9.4). I cannot pinpoint the problem as some eventually connect (usually after several attempts and by retyping the server address) whilst some have not been able to connect at all.

The only thing I can think of is that the Moodle app may be looking for online verification (which cannot happen as MoodleBox is working totally off grid.)

Has anyone else experienced this? Any proposed solutions would help please

Average of ratings: Useful (1)
In reply to Ian Amess

Re: Moodlebox and Moodle Mobile App

by Noel De Martin -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi there,

If you say it works after several attempts, I'm not sure if it's a problem with the app because it looks more like a connectivity problem. If it were a problem with the app, it wouldn't work at all. Can you try to reproduce the problem and see what are the common causes? I'm not sure what upgrading to 3.11 had to do with this change, but maybe there's something we're missing here that caused this problem.

I suggest that you debug the network requests to see what's going on under the hood, that may give you some hints as to what is the problem. You can learn how to do that here: Moodle Mobile debugging WS requests.

In reply to Ian Amess

Re: Moodlebox and Moodle Mobile App

by Frank Koch -
Picture of Plugin developers

I might have the same problem with the Moodle Mobile App connecting to the MoodleBox:

I'm running the MoodleBox version 2.6.2 (2019-02-03) with Moodle v3.6 on a Raspberry Pi 3B+ with Linux 4.14.79-v7+ armv7l.

My observation is that users with the Moodle Mobile App v3.8.2 can connect to the MoodleBox while users with the latest v3.9.4 cannot. For v3.9.4-users no error is prompted while they have to wait endlessly for the connect.

Did anybody figure out how to connect the latest Moodle Mobile App to the MoodleBox?

Thank you, Frank

Average of ratings: Useful (1)
In reply to Frank Koch

Re: Moodlebox and Moodle Mobile App

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
More information coming up in the MoodleBox community: https://discuss.moodlebox.net/d/254-mobile-app/9.
In reply to Visvanath Ratnaweera

Re: Moodlebox and Moodle Mobile App

by Ralf Krause -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators

Dear MoodleBox users

Today I did some tests with the MoodleBox 4.1.0 and the Moodle app 3.9.5.

With the Moodle app on an iPad I had no problems. And with the Moodle app on an Android tablet I could not get any connection to the MoodleBox. Please see my test results with iOS https://discuss.moodlebox.net/d/254-mobile-app/17 and with Android https://discuss.moodlebox.net/d/254-mobile-app/18.

Ralf


Ralf Krause
moodleSCHULE e.V.

Average of ratings: Useful (1)
In reply to Ralf Krause

Re: Moodlebox and Moodle Mobile App

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Ralf

Many thanks for your investigation and the suggested solution!

I'm a reluctant smart-phone user and don't know the details. Am I right in saying that MoodleBox, being make for a physical classroom, does serve only HTTP (no 'S') by default. You can change it to serve HTTPS, but the built-in SSL certificate is self-signed, which the Moodle Mobile App rejects. The solution is to fall back to HTTP and to activate the Site administration > Mobile app > Mobile settings 'Enable web services for mobile devices'?
In reply to Visvanath Ratnaweera

Re: Moodlebox and Moodle Mobile App

by Ralf Krause -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators

Hi 

As numerous teachers from very different countries around the world tell us, they are using the MoodleBox for their lessons even where there is no Internet and no IT infrastructure.

If students find a MoodleBox with WiFi in their school, they can use their smartphone to access their digital courses and their schoolwork and save it in the Moodle app. They can view, read and edit their digital documents on their smartphones. That is why the Moodle app is a very important tool for learning in schools with a bad IT infrastructure. But if smartphones with Android no longer connect because the Moodle app does not accept self-signed certificates, that's bad. There should probably be a switch in the app to allow self-signed certificates.

In such a scenario, the students cannot use a notebook, not to mention the greater energy requirement. In order to be able to take their digital schoolwork home from the MoodleBox, they need the Moodle Desktop app. Unfortunately, Moodle HQ has stopped further development of the Moodle Desktop app  ...certainly a bad idea in this context.

Ralf

Ralf Krause
moodleSCHULE e.V.

Average of ratings: Useful (2)
In reply to Ralf Krause

Re: Moodlebox and Moodle Mobile App

by Ralf Krause -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators

I found a temporary solution for this problem. 

When the https server of the MoodleBox is totally switched off then the Moodle app will connect via http. 
https://discuss.moodlebox.net/d/254-mobile-app/19

Ralf

Ralf Krause
moodleSCHULE e.V.

Average of ratings: Useful (4)
In reply to Ralf Krause

Re: Moodlebox and Moodle Mobile App

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> When the https server of the MoodleBox is totally switched off..

But MoodleBox is delivered with HTTP (not HTTPS). I don't see how it conflicts with the Mobile App.
In reply to Visvanath Ratnaweera

Re: Moodlebox and Moodle Mobile App

by Ralf Krause -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
As I wrote in https://discuss.moodlebox.net/d/254-mobile-app/19 the web server nginx is prepared for https. This seems to be the problem for the Android Moodle app. When I command the 4 lines containing ssl in the nginx configuration and restart the MoodleBox then the Android Moodle app works fine.
Average of ratings: Useful (1)
In reply to Ralf Krause

Re: Moodlebox and Moodle Mobile App

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Sorry for taking so long to understand. So the problem is, even if MoodleBox does not deliver HTTPS, the fact that it is capable of delivering HTTPS upsets the Moodle Mobile App? I imagine that to be a client problem comparable with the "intelligent" browsers these days, which defaults to HTTPS or not display www in the domain, etc. Now I understand why the HTTPS in the MoodleBox needs to be stopped as you documented in https://discuss.moodlebox.net/d/254-mobile-app/19 for Moodle Mobile App to work with MoodleBox.

In reply to Ian Amess

Re: Moodlebox and Moodle Mobile App

by Johanis Burg -

I might have the same problem with the Moodle Mobile App connecting to the MoodleBox: I'm running the MoodleBox version 2.6.2 (2019-02-03) with Moodle v3.6 on a Raspberry Pi 3B+ with Linux 4.14.79-v7+ armv7l in samsung galaxy a51 mobile (https://www.sanamobile.pk/samsung-galaxy-a51/).


In reply to Johanis Burg

Re: Moodlebox and Moodle Mobile App

by Sands Casi -
Unfortunately, this is not something we can enable/allow in the app that is published in Google Play or the Apple App store, it will open the door to several possible security attacks and it will come also with a rejection for publication in those stores.
Please note that a mobile app is not a browser and it does not follow the same rules regarding self-signed certificated. Even for hybrid apps like ours the previous applies.
In reply to Johanis Burg

Re: Moodlebox and Moodle Mobile App

by Sands Casi -
I might have the same problem with the Moodle Mobile App connecting to the MoodleBox: I'm running the MoodleBox version 2.6.2 (2019-02-03) with Moodle v3.6 on a Raspberry Pi 3B+ with Linux 4.14.79-v7+ armv7l in samsung galaxy a51 mobile (https://about.me/alejandro-arraya-avila).

--------------------------------------------------------------------------------------
Yes Ralf, and I'd like a confirmation of Juan that commenting out these lines of Nginx config is enough to "completely disable" SSL.
In reply to Ian Amess

Re: Moodlebox and Moodle Mobile App

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi there,

sorry for being late to this conversation.

This is a recurrent topic, allowing the app to connect to sites using self-signed certificates.

Unfortunately, this is not something we can enable/allow in the app that is published in Google Play or the Apple App store, it will open the door to several possible security attacks and it will come also with a rejection for publication in those stores.
Please note that a mobile app is not a browser and it does not follow the same rules regarding self-signed certificated. Even for hybrid apps like ours the previous applies.
There is a specific mention of this here: https://cordova.apache.org/docs/en/latest/guide/appdev/security/

There are two workarounds here:
* Add a switch to MoodleBox so SSL is completely disabled for being able to use the Moodle App
* Build your own MoodleBox app, allowing self-signed certificates and adding additional security mechanisms so it only can connect to MoodleBox sites, but you won't be able to publish this app in the stores (you will have to distribute the Android apk or do internal distribution via the Apple App store

I hope this clarifies this issue

Regards, Juan
Average of ratings: Useful (2)
In reply to Juan Leyva

Re: Moodlebox and Moodle Mobile App

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Juan,

MoodleBox maintainer here.

> Add a switch to MoodleBox so SSL is completely disabled

Could you be more specific. What do you mean exactly by "completely disabled"? Would it be enough to comment out in the Nginx configuration the lines pertaining to port 443, SSL and the certificates?

TIA for your help!

Nicolas

In reply to Nicolas Martignoni

Re: Moodlebox and Moodle Mobile App

by Ralf Krause -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators

Hi Nicolas,

you need to comment the four lines in nginx configuration and you must restart nginx.
Additionally you also need to change the Moodle configuration $CFG->wwwroot to http if it is https.

But I don't know what happens with all the links https://moodlebox.home/ which users could have set in their text contents as links in labels or on text pages, links in books, links in forum entries, linked pictures in glossary texts and so on. Without https the server can't answer these https links. Normally you must replace these links in the database by the script http://moodlebox.home/admin/tool/replace/ if there are some of them.

Ralf

Ralf Krause
moodleSCHULE e.V.

In reply to Ralf Krause

Re: Moodlebox and Moodle Mobile App

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Ralf

The original MoodleBox comes as http://moodlebox.home/ (no HTTPS). So those who have been using https://moodlebox.home/ (HTTPS) must have made the transition to HTTPS. It is their choice. They can keep HTTPS, can't they?

The good news is that, the Moodle Mobile App does not force HTTPS. So http://moodlebox.home/ (no HTTPS) will work even on the Moodle Mobile App, provided that HTTPS is disabled in the MoodleBox (by commenting out the four lines in the Nginx configuration https://moodle.org/mod/forum/discuss.php?d=424353#p1739474 and https://discuss.moodlebox.net/d/254-mobile-app/19, as you've discovered).

@Nicolas, what do you think about delivering the MoodleBox with those four lines commented out? It will still work as http://moodlebox.home/ as documented. In the documentation on how to go for HTTPS, mention that those lines need to be uncommented. Kind of logical to me: to go from HTTP to HTTPS both the web server and the application need to be reconfigured. Since the Nginx in MoodleBox is dedicated to this single application, nobody else will be disturbed.
wink
In reply to Ralf Krause

Re: Moodlebox and Moodle Mobile App

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Yes Ralf, and I'd like a confirmation of Juan that commenting out these lines of Nginx config is enough to "completely disable" SSL.
In reply to Nicolas Martignoni

Re: Moodlebox and Moodle Mobile App

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi Nicolas,

unfortunately, I don't have any experience with MoodleBox or Nginx so I can't provide valuable feedback. But it seems that what Ralf mentioned is the correct way to do it:
* Remove the SSL lines in Nginx (so the app does not get confused and try to use HTTPS)
* Set the $CFG->wwwroot to http://... if it was sett to https://..

Cheers, Juan
Average of ratings: Useful (2)