Moodlebox update and internet problem

Moodlebox update and internet problem

by Cade Dopp -
Number of replies: 20
I am unable to update/upgrade my MoodleBox.


When I login to my MoodleBox I see this announcement:

warning

I am unable to navigate to other pages within the moodlebox, anything I click just redirects me back to this page with the announcement about an update. I can get to other pages by typing in the direct url like "http://moodlebox.home/course/". 

I connected my MoodleBox to an ethernet cable (I plugged the MoodleBox in where my router was, so I know it should work). I SSH in and run the commands found here. I get this error:

update error

While the MoodleBox is plugged into ethernet, and I am connected to it via WiFi, I am unable to navigate to any external websites (the MoodleBox is supposed to act as a router). 

I have tried restarting my modem. I am using Xfinity internet in the USA. I am using the MoodleBox 2.1.0 disk image that I downloaded on Feb 14. 

Any ideas?

Average of ratings: -
In reply to Cade Dopp

Re: Moodlebox update and internet problem

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I suggest you contact the maker of "MoodleBox" as it is not standard moodle and as such, most of us are not going to be able to help...sorry!

In reply to Cade Dopp

Re: Moodlebox update and internet problem

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

The apt-get errors point to the fact that your moodlebox cannot connect to the raspberrypi repositories to download the updates... Do you have a working Internet connection on this Moodlebox Raspberry Pi?

In reply to Jon Witts

Re: Moodlebox update and internet problem

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I too think so.

So MoodleBox got an IP address for its Ethernet interface from your router? (How you SSH in to the MoodleBox, through a Ethernet interface or the wireless interface, is not visible in your screen-shot.) What is that address? What is your LAN, for example 192.168.1.0/24? Can you pingan IP address outside from the MoodleBox , eg. "ping 8.8.8.8"? Does MoodleBox resolves domain names, eg. what is the output to the command "host moodle.org"? Is there a proxy-server somewhere, in your LAN for eg.?
In reply to Jon Witts

Re: Moodlebox update and internet problem

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 Cade,

Yes I suspect you network connexion is not working correctly. Maybe try to change your ethernet cable.

Nicolas

PS. I read in your screenshot that the cron didn't run too. This would suggest some modification was done on your MoodleBox. Investigate in this direction too: what modifications, did they break the network settings, etc.

N.

In reply to Nicolas Martignoni

Re: Moodlebox update and internet problem

by Cade Dopp -

I flashed the new MoodleBox image to my sd card so any settings I may have changed should be back to default now. I know that the ethernet cable is good because I plugged the moodlebox in where my router was, and I had an internet connection from my router.

I am still unable to access the internet with the moodlebox. It is plugged directly into my modem. Is there something obvious I'm missing? Or is there a setting I have to change before the MoodleBox will allow an internet connection?

Thanks,

cade

In reply to Cade Dopp

Re: Moodlebox update and internet problem

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 Cade,

What did you use to flash your SD card? Some utilities to do this aren't reliable. Etcher works well. See https://etcher.io.

Maybe you have a buggy flash card? There are quite a lot of fake ones on Amazon. You may try with another one do see if you can reproduce the problem. Myself, I reflashed one to be sure, but could not reproduce your problem.

Nicolas

In reply to Nicolas Martignoni

Re: Moodlebox update and internet problem

by Cade Dopp -

I did use Etcher. I'm using a high quality sd card (maybe it's buggy but everything else on the moodlebox is working properly besides the internet connection).

A few more details about the moodlebox behavior:

I connect to the moodlebox wifi and am able to navigate to moodlebox.home and all of the pages from the menu. As soon as I connect the moodlebox to my modem with ethernet, I am no longer able to navigate to the moodlebox in my browser. The page attempts to load for several minutes without any result, and I don't get any error messages in the browser. As soon as I unplug the ethernet cable the page immediately loads. 

I'll keep experimenting and post a reply when I've found a solution.

Thanks.

In reply to Cade Dopp

Re: Moodlebox update and internet problem

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Cade,

It has been a few months since I set up all my Pi's so my explanation might be a little off, but the behavior you describe is a "feature" of the operating system for Pi's. There is some code that runs during start up that will let you use either the wifi or ethernet plug, but not both unless you go in and change things. I never did get mine to work before the priority for other projects ruled out further playing with the problem.

In reply to AL Rachels

Re: Moodlebox update and internet problem

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,

> but the behavior you describe is a "feature" of the operating system for Pi's. There is some code that runs during start up that will let you use either the wifi or ethernet plug, but not both unless you go in and change things.

I'm very surprised by this affirmation as I never heard of this before, and because Cade is to my knowledge the only person to have reported such a problem to me. Could you please point me to the code or some source, so that I can investigate and hopefully find a fix to include in a next version of the MoodleBox disk image?

In reply to Nicolas Martignoni

Re: Moodlebox update and internet problem

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Newer versions of Raspbian Jessie supposedly have no problems setting up what you need, but if by accident, you are using an older version when Jessie first came out, is where people were having the problem try to get both to work at the same time. My server where I kept notes about this is down for a major rebuild at the moment, so I can't see what notes I tried to keep about it, but if you look through the older Pi forums you can find lots of discussion about people having problems trying to use both ports. 

There is a warning about it in paragraph four here: https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md

In reply to AL Rachels

Re: Moodlebox update and internet problem

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

Thank you for this clarification and the source document. 

I can so confirm that NO MoodleBox image I've produced was ever concerned by this problem. Even versions based on Jessie were tweaked to workaround this smile

Cheers

In reply to AL Rachels

Re: Moodlebox update and internet problem

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

You wrote:
> I connect to the moodlebox wifi and am able to navigate to moodlebox.home and all of the pages from the menu. As soon as I connect the moodlebox to my modem with ethernet, I am no longer able to navigate to the moodlebox in my browser. The page attempts to load for several minutes without any result, and I don't get any error messages in the browser. As soon as I unplug the ethernet cable the page immediately loads.

It shouldn't be like that. Your ethernet (wired) network is playing havoc with MoodleBox.

> I'll keep experimenting and post a reply when I've found a solution.

I thought my previous post explains how to check the network setup systematically. If anything is unclear, please ask.

Hi AL

I can give you shell and web access to a MoodleBox from the Internet - through its ethernet (wired) interface. I will log in and visit the Moodle at the same time through Wi-Fi. Just send me a PM.
In reply to Visvanath Ratnaweera

Re: Moodlebox update and internet problem

by Cade Dopp -

Thanks Visvanath. I'm more of an educator than a technologist so it will take me some time/googling to figure out how to follow your explanations for checking the network setup. I'll be working on it later this week, and will let you know what I find.

Thanks.

In reply to Cade Dopp

Re: Moodlebox update and internet problem

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hallo Cade

Technologist! Ha, ha. I feel more like an Egyptologist. Here comes a papyrus, let's see.
smile

Preparation
- Switch off your home Wi-Fi access point
- Before switching on, remove the network cable from the MoodleBox
- Switch on the MoodleBox
- Connect your laptop to the Wi-Fi network 'MoodleBox' (password moodlebox)

This is what you should do on a Linux laptop. You have to find the equivalent if your OS is different.

$ host moodlebox.home
moodlebox.home has address 10.0.0.1
$ ping -c 4 moodlebox.home
PING moodlebox.home (10.0.0.1) 56(84) bytes of data.
64 bytes from moodlebox.home (10.0.0.1): icmp_seq=1 ttl=64 time=1.36 ms
64 bytes from moodlebox.home (10.0.0.1): icmp_seq=2 ttl=64 time=6.01 ms
64 bytes from moodlebox.home (10.0.0.1): icmp_seq=3 ttl=64 time=6.13 ms
64 bytes from moodlebox.home (10.0.0.1): icmp_seq=4 ttl=64 time=4.39 ms

--- moodlebox.home ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.367/4.478/6.139/1.924 ms

At this point open a browser and visit http://moodlebox.home. You should see the Moodle site. See https://moodlebox.net/en/help/wi-fi-connection/ and https://moodlebox.net/en/help/access-to-moodle/.

Now login to the box through SSH. (You need PuTTY in Windows.)
$ ssh moodlebox@moodlebox.home
The authenticity of host 'moodlebox.home (10.0.0.1)' can't be established.
ECDSA key fingerprint is .......
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'moodlebox.home' (ECDSA) to the list of known hosts.
moodlebox@moodlebox.home's password:
Linux moodlebox 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l

See https://moodlebox.net/en/help/moodlebox-credentials/.

$ sudo -i
# ifconfig -a
# ifconfig -a
eth0: flags=4099 mtu 1500
ether .......
^ no IP address here

lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
....

wlan0: flags=4163 mtu 1500
inet 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255
...

# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
^^^^^^ single line

Now connect the network cable to the MoodleBox.
# ifconfig -a
eth0: flags=4163 mtu 1500
inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
^^^ Now an IP address appear. Your will have a different one. Post it here.

# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 202 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
^^^^^^^ three lines

Still http://moodlebox.home must respond in you browser. If not post the output to the last two commands in the forum.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Moodlebox update and internet problem

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Visvanath,

Thanks for the kind offer, but it's not necessary.  I do not doubt that it can be done. I just mentioned the possibility as something worth checking because I know that when Raspbian Jessie first came out, lots of people struggled with trying to get the type of setup you describe, to work.

In reply to Cade Dopp

Re: Moodlebox update and internet problem

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

Did you try with another router/modem? (just to be sure that the problem does not lie there)

Average of ratings: Useful (1)
In reply to Cade Dopp

Re: Moodlebox update and internet problem

by Cade Dopp -

Solution found! My modem/router is one provided by my ISP (Xfinity) It is a modem/router in one device. "Bridge mode" was disabled, allowing me to use the device as a router. I disabled "bridge mode", which makes the device function only as a modem and not a router, and now my pi is connected to the internet and I can use the pi as a router. 

Thanks for the help. I'm surprised by how willing all of you are to help in this community, it's awesome.

Average of ratings: Useful (1)
In reply to Cade Dopp

Re: Moodlebox update and internet problem

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

Congrats. So, the problem was in your LAN.

You said:
> It is a modem/router in one device.

It is common these days that consumer "routers" to be modem/router/wireless access point/file server/streaming server/... all in one!

> I disabled "bridge mode", which makes the device function only as a modem and not a router,

Isn't it the other way around? The device has to be either a bridge or a router. So if you _disable_ bridge, it'll become a router. (The modem functionality has to be there always, assuming the connection is xDSL.)

> and now my pi is connected to the internet and I can use the pi as a router.

My guess is that you have a block of public IP addresses. In that case ordinary routing (without NAT) is the right one.

It would be nice, if you could clarify these thing, for the benefit of the next visitor!