User avatar
Emanuele
Posts: 178
Joined: Wed Aug 03, 2011 5:28 pm
Contact: Website

Re: Developing world - A scenario

Sun Aug 14, 2011 7:52 am

I do have some very limited, indirect experience in the developing world, so I wanted to share a realistic scenario. We are now starting to talk about distros, and I think this is a relevant use case:

A teenager managed to have a Raspberry Pi. He has no Internet access (not even at school). He goes once a week to the nearest town. When he has enough money (say once a month), he can afford a couple of hours in an Internet cafe. There he will find an old Windows 98 PC. If he boots a different operating system (e.g. Live Ubuntu from a CD-ROM / Flash drive), he risks getting kicked out because the shop assistant thinks he's "hacking" the PC. There's no TV there, so there is no point in bringing his Raspberry Pi. But for a fee he can have some of the stuff he's downloaded saved on his card.

Some questions: How can he update the system without losing his data? Some included documentation refers to PostgreSQL (not included in the main distro). He researched it and he would like to try it. How can he install it? He can download .deb/.rpm files, but he's got one shot. If he doesn't get all the dependecies right and forgets even one .deb, he'll have to wait another month.

As a starting point, I think that having some unused space in the FAT32 partition would be a good idea.

User avatar
Gert van Loo
Posts: 2482
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Developing world - A scenario

Sun Aug 14, 2011 8:58 am

I like that scenario because it is exactly the kind of person we are trying to reach.
To stay in the same mindset: he/she has little money but plenty of time. swapping cards, USB sticks plugging unplugging etc. is no issue.
The only solution is that to he/she has a second storage device.
In this case I would suggest a USB stick as the internet cafe will not have SDCARD access. So the images can be downloaded to the USB stick and taken home. There he/she will use the Linux file manager to copy files between USB and SDCARD. The only trick is the app has to be controlled by keyboard or mouse only as one of the two has to be temporary replaced to plug the USB-stick in.
If they have an alpha board there is no second USB plug. In that case there needs to be an application which copies file autonomously. The user does a "delay_copy *.* c:" It then says: "You have now ten seconds to unplug your keyboard and plug in the USB key".10, 9, 8...
For changing the boot image: I don't think there is a real safe solution apart from having a spare SD-card. I will have to check if the system support double -boot: First from from SD-card and if that fails USB (or vice versa)

Michael
Posts: 340
Joined: Sat Jul 30, 2011 6:05 pm

Re: Developing world - A scenario

Sun Aug 14, 2011 10:21 am

RaspberryPi tasks list updated: http://elinux.org/RaspberryPiBoardTasks ;)
Adding Network boot (perform dhcp, get tftp or http location as a parameter in the dhcp response, fetch the image, boot) to the boot order would also be nice to have.

User avatar
Emanuele
Posts: 178
Joined: Wed Aug 03, 2011 5:28 pm
Contact: Website

Re: Developing world - A scenario

Sun Aug 14, 2011 12:22 pm

The deferred copy is a very good idea.

I have an addition to that scenario. It might sound unrealistic to someone, but I do believe it is realistic (see below):

The kid has a bluetooth-enabled phone and he bought a USB bluetooth dongle. The dongle is supported by Linux (I believe most are). GPRS is quite expensive, but very limited data usage is feasible, so he can download files on his phone.

I think that a deferred copy from bluetooth would also be useful. It is a more difficult project (e.g. before disconnecting the keyboard/mouse you have to enter the name of the device (and the files?), so Raspberry Pi knows what to look for), but it should be feasible.

Now, I don't want to give the impression that I've dreamed the scenarios last night. So, here is my evidence.

The homepage for my project is on sourceforge, but I hardly get any downloads from there. The vast majority of the downloads come from getjar and mobile8. Overall, it's 200K+ so far. I don't know about mobile8, as someone else uploaded the app for me. But, here are some stats from getjar. Over the last month, I got about 1.5K downloads.

Top countries:

Philippines 51%
India 11%
Brazil 7%
United States 4%
Bangladesh 2%
Mexico 2%
Viet Nam 2%
Pakistan 2%
Indonesia 1%
Malaysia 1%
Ghana 1%
Nigeria 1%

Phone models are too fragmented, but the top ones should provide a good sample:

Nokia C3-00 3% (*)
Nokia C1-01 3% (*)
Nokia 6300 2% (*)
Nokia 1680 2%
Nokia 2700 2% (*)
Nokia 2690 2% (*)
Samsung GT C3303 2% (*)
Samsung GT S5233 Avila 2% (*)
Nokia 6020 2%
Nokia 2600 classic 2% (*)
Nokia 5130 XpressMusic 2% (*)
Nokia 3110 classic 2% (*)

I marked with (*) the ones that I think are bluetooth enabled. The app is quite hard to use, and I'm sure most people deleted it soon afterwards. On the other hand, I did get some feedback: a teenager managed to exchange a few emails with me from the Philippines using his Nokia 2610 (he hasn't got a computer yet).

Krikunoff
Posts: 6
Joined: Sun Aug 07, 2011 10:40 am

Re: Developing world - A scenario

Sun Aug 14, 2011 4:48 pm

It is possible to use the keyboard with a built-in USB hub and OS update via USB stick or GPRS (3G) modem

DanielSilva
Posts: 71
Joined: Sun Aug 28, 2011 7:07 pm

Re: Developing world - A scenario

Sun Sep 04, 2011 3:05 pm

Quote from Emanuele on August 14, 2011, 08:52
Some questions: How can he update the system without losing his data? Some included documentation refers to PostgreSQL (not included in the main distro). He researched it and he would like to try it. How can he install it? He can download .deb/.rpm files, but he's got one shot. If he doesn't get all the dependecies right and forgets even one .deb, he'll have to wait another month.


Eheh bit late on the party but that would be easy to do on a debian based system ( possibly with rpm's too but it's been ages since i used them ).
You just create an application that tells you what packages ( and their versions ) are installed on the system, dpkg does this so you can even use shells scripts to do it and write the file with them on the usb drive.

Drive to the internet cafe, choose the deb and fire up the software. The software would get the updated package list from the debian apt site, compare the list to your file containing the packages you have installed and check what are missing and/or need to be updated, the software then downloads all the packages and stores them on the pen.
The only problem would be that if the guest OS is Windows you would need to write some interface to the debian download site ( through http or ftp ), when in linux you can use the already present system utilities to do this.

When back on the raspi you would plugin the usb and transfer all the packages to the local apt repository and apt-get update && apt-get upgrade && apt-get install <whatever package>.

Not that hard to do and i think i can do that to be ready when the raspi ships.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Developing world - A scenario

Sun Sep 04, 2011 4:40 pm

If I understand right, there are 2 issues:

1- since the Raspi only has 1 USB port, it can have either a keyboard, or a flash stick. To update from stick, there needs to be a delay mechanism to give the user time to unplug keyboard and plug flash stick instead. It would probably be nice to be able to use the same mechanism for any file, not just system updates. Maybe tick boxes: Copy from Flash stick to internal SD: System Image (will delete all/confirm), All files, System Updates, Movies, Pictures, Music, Programs, ... True/false for each, with space requirements for each, and check.

2- the only Internet access is via Internet cafés; which means 2 sub-things:
2a- Raspi itself never gets connected to the Internet
2b- the user cannot install and run random programs on the "internet" PC.
This makes selecting, downloading, and applying upgrades a bit convoluted. The best I could come up with is:
- have a custom program on the Raspi generate a list of the packages installed, and save that list to the Flash stick
- Once in the net café, upload that list to a Raspberry Update Server. The server then pushes the appropriate updates (plus tha latest bare OS system image) to the Flash stick.
- back at home on the Raspi, do a delayed apt-get from Flash stick. apt-get needs to know to search Flash stick and/or SD for a local repo.

A slightly simpler version would be for a Raspberry server with just a simple list of all "official" and "approved" (community-driven) packages' latest versions, with tick boxes to choose the ones the user wants to DL. Again, once back home, delayed apt-get from local repo.

anndra
Posts: 5
Joined: Mon Aug 29, 2011 3:42 pm

Re: Developing world - A scenario

Sun Sep 04, 2011 5:42 pm

On connecting to the internet in a café. I have managed to in both India and Napal take the tower of the shagged-out computer form the school where I was volunteering to a local internet café and plug it in using their peripherals. This was to go through the unmitigated joy of running windows update.

The folk that run internet cafés are usually happy to help. They are also a canny bunch so, if you dump a box of 50 R-pis on a local school to give out to their pupils it probably won't take long for the local caf to set up an old screen and a keyboard and mouse in the corner for the pupils to use.

That said; It would still be a good idea to have a easy to use repository for off-line update via USB-stick.

And while considering off-line things: would it be possible to have an off-line wikipedia viewing application?

Blars
Posts: 88
Joined: Sun Aug 28, 2011 3:22 am
Contact: Website

Re: Developing world - A scenario

Sun Sep 04, 2011 9:51 pm

Debian already has a way of doing offline updates, I forget what the package is called. It's so you can update a system via floppies or other removable media.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5201
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Developing world - A scenario

Sun Sep 04, 2011 10:05 pm

Quote from anndra on September 4, 2011, 18:42

And while considering off-line things: would it be possible to have an off-line wikipedia viewing application?

There are quite a few of these around already (I remember putting one on my iPod in around 2004). I've just had a look at the Wikipedia dump index from April, and it looks like about 8GB for the compressed files. It'd be challenging, but I don't see anything stopping a smart software engineer from coming up with a solution.
Director of Communications, Raspberry Pi

DanielSilva
Posts: 71
Joined: Sun Aug 28, 2011 7:07 pm

Re: Developing world - A scenario

Sun Sep 04, 2011 10:25 pm

Quote from obarthelemy on September 4, 2011, 17:40
If I understand right, there are 2 issues:

1- since the Raspi only has 1 USB port, it can have either a keyboard, or a flash stick. To update from stick, there needs to be a delay mechanism to give the user time to unplug keyboard and plug flash stick instead. It would probably be nice to be able to use the same mechanism for any file, not just system updates. Maybe tick boxes: Copy from Flash stick to internal SD: System Image (will delete all/confirm), All files, System Updates, Movies, Pictures, Music, Programs, ... True/false for each, with space requirements for each, and check.


This wouldn't be necessary because everything would be made through the software before having to download anything to the usb drive, so you could select everything you wanted to do, remove your keyboard and use the mouse to just select "Download to USB drive".
Even in the case that you can't use either keyboard or mouse you could just tell the software to wait until it detects a flash drive being plugged in and once it does, mount it and transfer everything automatically. This is actually pretty easy to do in Linux.

But your idea of also being able to also transfer other type of files is pretty good *adds to the list* :D


2- the only Internet access is via Internet cafés; which means 2 sub-things:
2a- Raspi itself never gets connected to the Internet
2b- the user cannot install and run random programs on the "internet" PC.
This makes selecting, downloading, and applying upgrades a bit convoluted. The best I could come up with is:
- have a custom program on the Raspi generate a list of the packages installed, and save that list to the Flash stick
- Once in the net café, upload that list to a Raspberry Update Server. The server then pushes the appropriate updates (plus tha latest bare OS system image) to the Flash stick.
- back at home on the Raspi, do a delayed apt-get from Flash stick. apt-get needs to know to search Flash stick and/or SD for a local repo.


Well i never thought of this simply because i never had those issues around here, as long as you don't want to install anything on the systems ( access system files, write to the registry etc ) you usually don't have any problems using standalone software on Internet cafes. Even when they don't have the usb ports available it's just a matter of asking and they allow it. That might be problems in other countries it seems.


A slightly simpler version would be for a Raspberry server with just a simple list of all "official" and "approved" (community-driven) packages' latest versions, with tick boxes to choose the ones the user wants to DL. Again, once back home, delayed apt-get from local repo.

That's more tricky because every person has different needs and having someone approving what apps are ok or not to use would be a huge burden itself.

Quote from Blars on September 4, 2011, 22:51
Debian already has a way of doing offline updates, I forget what the package is called. It's so you can update a system via floppies or other removable media.


The APT system can update using local repositories instead of remote ones, no extra packages necessary. Since i have many debian systems at home i just made my fileserver a local apt repository and every time one of the systems is updated, it transfers the deb files to the fileserver and makes them available to the rest :)

Blars
Posts: 88
Joined: Sun Aug 28, 2011 3:22 am
Contact: Website

Re: Developing world - A scenario

Mon Sep 05, 2011 1:18 am

The package I was thinking of is apt-offline. It will create a list of all the packages you need to install what you want to install.

DanielSilva
Posts: 71
Joined: Sun Aug 28, 2011 7:07 pm

Re: Developing world - A scenario

Mon Sep 05, 2011 10:35 am

Quote from Blars on September 5, 2011, 02:18
The package I was thinking of is apt-offline. It will create a list of all the packages you need to install what you want to install.


The problem with that approach is that it assumes that the machine that is being used to connect to the internet is using linux. Unfortunately very few internet/cyber cafes are using anything other than windows.

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Developing world - A scenario

Sat Sep 10, 2011 12:27 am

http://www.debian-administrati.....nt_for_APT - You can run apt-offline on Windows. Unfortunately, it requires Python to be installed on the machine. Portable Python to the rescue! http://www.portablepython.com/

DanielSilva
Posts: 71
Joined: Sun Aug 28, 2011 7:07 pm

Re: Developing world - A scenario

Sat Sep 10, 2011 12:41 pm

Quote from emercer on September 10, 2011, 01:27
http://www.debian-administrati.....nt_for_APT - You can run apt-offline on Windows. Unfortunately, it requires Python to be installed on the machine. Portable Python to the rescue! http://www.portablepython.com/

Still has the same issue as i had, in some places you cannot run custom software on the cyber cafe's computer. It's not much of a problem around here but it seems that is a real limitation in a few countries. A secondary solution, remotely hosted and that only uses default software found in any OS would be ideal.

mlukeys
Posts: 1
Joined: Fri Sep 16, 2011 8:19 pm

Re: Developing world - A scenario

Fri Sep 16, 2011 9:57 pm

if he wanted that package he can go to the cafe and put the package he wants on a usb drive, then take it home boot up his system and type into terminal
$ sleep 30 | mv /home/media/traveldrive /documents
this is just an example he would need to input the correct directory's.
it gives him 30 seconds after he hits enter to plug the drive in but he will have to know ahead of time what the name of the drive is and etc. terminal can help him with that no need for a mouse in terminal

i am assuming there's more to this issue than that solves

SlayingDragons
Posts: 67
Joined: Wed Sep 14, 2011 3:17 am

Re: Developing world - A scenario

Sat Oct 08, 2011 11:46 pm

Heyyo, I wrote a shell script that mounts a usb drive and copies files to or from the drive, and can list files on the drive.

http://pastebin.com/viLFBxB5

I don't know if this is where I would go about posting it, I just came here because it was where the details on http://elinux.org/RaspberryPiBoardTasks came from. If there's another place I should submit this or if it's not needed, just say so. :)

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5201
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Developing world - A scenario

Sun Oct 09, 2011 2:55 am

Do add a note to the wiki pointing people here - and thanks for working on it! I've added it to our big database o'stuff; we'll have a repository for things like this here by the time we launch.
Director of Communications, Raspberry Pi

User avatar
Burngate
Posts: 5972
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Developing world - A scenario

Sun Oct 09, 2011 10:20 am

Don't know if this is any help, or just muddying the waters.
As far as I can see half the problem is that RasPi & internet cafe are both only USB hosts.
But Maplin sell a device for £15 (http://www.maplin.co.uk/usb-da.....ble-221132, order code A42HF) to connect two XP / vista hosts.
No idea how it works, but surely someone out there could make it work so that our lad/lass could take his RasPi to the cafe and download straight to his RasPi?
Maplin are out of stock at the moment, but I might go there next week, buy one just to see what it can do.
& the price is only the same as a RasPi!

lwalthour
Posts: 10
Joined: Mon Oct 03, 2011 3:29 pm

Re: Developing world - A scenario

Mon Oct 10, 2011 2:26 pm

Quote from liz on September 4, 2011, 23:05
Quote from anndra on September 4, 2011, 18:42

And while considering off-line things: would it be possible to have an off-line wikipedia viewing application?

There are quite a few of these around already (I remember putting one on my iPod in around 2004). I've just had a look at the Wikipedia dump index from April, and it looks like about 8GB for the compressed files. It'd be challenging, but I don't see anything stopping a smart software engineer from coming up with a solution.

This is something I've thought about working on... setup a web server on a RPi, hook it up to an external HDD (unless it could be crammed into a $40 32g SD card), wireless router and solar power system. My application was post-apocalypse preservation of human knowledge, but it could be useful in developing areas too.

laurens
Posts: 3
Joined: Thu Oct 20, 2011 2:33 pm

Re: Developing world - A scenario

Fri Oct 21, 2011 1:33 pm

I had some thoughts on this; instead of waiting a random amount of time until someone has swapped out the keyboard for the usb drive, you could also look in /var/log/messages or use some other mechanisms to detect when a usb device is (un)plugged.

So, you could make a script that:
- asks the user to remove the keyboard and plug in the usb device
- do some scripty things with tail and/or grep to detect when the keyboard has been unplugged and the usb drive has been plugged in
- scan the files on the device
- notify the user to swap the keyboard back
- have the user select all the files he wants copied
- ask the user to swap the keyboard again
- wait for the disk to be inserted
- copy the files
- ask to reconnect the keyboard

To me, this sounds nicer than having to wait for a timeout and hope the user swapped.

SlayingDragons
Posts: 67
Joined: Wed Sep 14, 2011 3:17 am

Re: Developing world - A scenario

Tue Oct 25, 2011 3:53 am

Quote from laurens on October 21, 2011, 14:33
I had some thoughts on this; instead of waiting a random amount of time until someone has swapped out the keyboard for the usb drive, you could also look in /var/log/messages or use some other mechanisms to detect when a usb device is (un)plugged.

So, you could make a script that:
- asks the user to remove the keyboard and plug in the usb device
- do some scripty things with tail and/or grep to detect when the keyboard has been unplugged and the usb drive has been plugged in
- scan the files on the device
- notify the user to swap the keyboard back
- have the user select all the files he wants copied
- ask the user to swap the keyboard again
- wait for the disk to be inserted
- copy the files
- ask to reconnect the keyboard

To me, this sounds nicer than having to wait for a timeout and hope the user swapped.

That makes a lot more sense, derp. :P

I'ma work on this instead. This would be a lot better.

zukero
Posts: 4
Joined: Thu Nov 03, 2011 4:47 pm

Re: Developing world - A scenario

Thu Nov 03, 2011 4:56 pm

I played with udev/HAL and shell scripting lately to do exactly that kind of things.
Writing a custom udev script that looks for "instructions" to run upon insertion of any /dev/sdX type of device should be easy. Make the user command add a new "instruction" in the stack is easy bash too.
Make the "instruction stack" a simple text file, if that was unclear.
I had to use HAL to detect media insertion in a USB dvd drive, as udev did not see it, but I read that modern udev replaces totally HAL, so maybe it can handle that too.

I think all of this is possible with simple bash scripts, provided the correct udev/HAL configuration is in place. Luckily for us, both of these support throwing extra configuration files in specific folders to add extra behavior. No need to parse/edit existing configuration files, so it could be made almost distro-independant.

subminiature
Posts: 43
Joined: Wed Nov 02, 2011 6:27 pm
Contact: Website

Re: Developing world - A scenario

Thu Nov 03, 2011 7:22 pm

http://sdict.com/en/ would be a suitable app.

Oxwivi
Posts: 59
Joined: Wed Oct 26, 2011 9:33 am

Re: Developing world - A scenario

Thu Nov 03, 2011 7:26 pm

I'm not sure if USB to USB networking is possible, but if it is, we can simply connect the Windows system in the internet cafe to R-Pi, power it up, and use a Windows SSH client to log in to R-Pi and do the updating.

If the above method does work, R-Pi could simply be bundled with a USB to USB wire and a CD with a SSH client or a lightweight SSH client residing on the FAT32 partition.

Return to “General discussion”