mailto: blog -at- heyrick -dot- eu

Navi: Previous entry Display calendar Next entry
Switch to desktop version

FYI! Last read at 00:16 on 2024/05/04.

Getting a Pi online with RISC OS and a WiFi XP machine

There is just time remaining, this year, for one last hack.

Sitting in front of me is a netbook running XP. It is what I am writing this on. It has a WiFi connection to an ADSL router, which can offer up to 2mbit.

Sitting on the shelf beside me is a RaspberryPi running RISC OS. It has no connectivity at all.

Wouldn't it be nice if I could join the two together?

 

Actually... it is possible.

 

Preparing the hardware

For this experiment, I simply found a short network cable and connected it between the Pi and the eeePC. I think it is a cross-over cable. All it says is "certified for gigabit ethernet 24awgx4p type cm" followed by a standards number. I suspect this is talking about the cable, not how it is wired up. I was not overly concerned, as I know that the port on the eeePC can switch polarity if necessary.

If you connect your machines via a hub or some other sort of router, be aware that using Internet Connection Sharing will force the PC's ethernet port to have IP address 192.168.0.1 - so you may need to tweak other settings on your network to compensate.

 

Preparing the XP box

This is written with Windows XP in mind. It should be broadly similar for Vista and maybe Windows 7 as well. If you have Windows 8...God Help You.

See that little WiFi icon on the system tray? Double-click it. The usual diagnostics will appear showing your interface is connected to such and such, your connection rate is blah and a little graphic of blah packets have been sent and blah packets have been received.
There are three buttons along the bottom, plus the Close button. Click on the Properties button.

If you cannot find the above (or if you have no obvious WiFi indication on the system tray), go to Start, then Control Panel, then Network Connections (XP) or Network and Internet (after XP). If you see something that looks like the names of networking devices, try double-clicking on the one that corresponds to the WiFi device. You ought to end up with a window that looks vaguely like the one above.
Failing this, look in the "Help Center" for "internet connection sharing".

Carrying on... In the complicated-looking window that appears, click on the Advanced tab. [this may be a simpler "Sharing" tab in Vista/7]

Now click on the option "Allow other network users blah blah" and select the name of the connection that corresponds to the Ethernet port (later versions of Windows might be smart enough to figure this one out for themselves...). I tried with and without the option to change the status, it didn't seem to make any difference.

Click on OK. You may or may not be asked for a copy of the Windows installation CD, it may or may not then ignore that and read stuff from inside Windows, and you may or may not need to reboot. When I tried this a long time ago for playing with my OSD, it kept asking for a CD that I could not give it (netbook, no optical drive) then 'finding' the files within Windows, then insisting on rebooting. A lot.
This time? It did it on the fly while I was downloading something. Not so much as a hiccup.

Note - you might need to reboot your hub if you connect the intranet like that, for the ethernet port on this XP box will become 192.168.0.1. You cannot change this.

 

Preparing RISC OS

I'm running my own ROM build on the Pi, so for some reason the network configuration tool positively insists that there is no network interface.
Going to the command line and entering ifconfig -a will show that the interface ej0 exists.

This isn't a problem, it is perhaps easier to edit the config file manually than to go through the ridiculous pile of windows necessary to set things up in the UI.

Open the directory $.!Boot.Choices.Internet and you will see three files - Routes, Startup, and User.
Copy the file Startup as Startup_O.

Now open the file Startup in a text editor, and delete everything within.
Now enter the following:

Set Inet$HostName RaspberryPi
Set Inet$EtherTypeA <Inet$EtherType>

IfConfig -e ej0 192.168.0.2 netmask default
CheckError
IfConfig -e lo0 127.0.0.1
CheckError
Set Inet$EtherType <Inet$EtherTypeA>
Unset Inet$EtherTypeA

Set Inet$Resolvers 192.168.1.1 192.168.0.1
ResolverConfig

Route -e add default 192.168.0.1
CheckError
Set Inet$IsGateway ""
Set Inet$RouteDOptions ""
What is worth looking at in more detail are the two IP addresses shown in colour. The blue address is the IP address of the Pi. You can change this if you like, to be 192.168.0.something.
The address in red is the address of the internet router. This is used for DNS queries by preference, the host PC probably does the same unless you have configured to use OpenDNS or somesuch.

Your configuration file should look like this:

Save the configuration file, shut down, reboot (RISC OS, not the PC!).

 

Testing it

First step - try to ping the Windows box:

Then try to ping the internet router:

Now ping the OpenDNS server, it is easy to remember, 8.8.8.8:

Finally, ping something by name, here I am pinging en.wikipedia.org:

 

If it fails with no route to host, check that your gateway (the Route -e add default) line is correctly pointing to the Windows XP box, not the internet router.
If the IP address tests work but the named test fails, you have not put the correct address of the internet router into the Set Inet$Resolvers line. Either insert the correct address, or cheat and use 8.8.8.8 (though I warn against using OpenDNS as it appears to break DNS rules by returning spam responses for non-existent domains, instead of the expected/required "NXDOMAIN" error).

 

All good so far? Okay then - time to load NetSurf!

 

All done, yay, etc

Fire up NetSurf, go look at stuff...

 

Speaking of hacking...

I saw a while back, a reminiscence of those little cards you used to get in boxes of tea (Brooke Bond (PG Tips) used to do many). Cards that presented many topics (Google for "Brooke Bond cards" to get an idea) and also sometimes instructed you on such useful things as how to fight off a tiger using a broom handle. This, most likely, had its origin in the days of the Raj when it might be possible that a big angry cat decide you are an annoyance...and you, armed only with a mop. What amused me was that this description was described as "the ultimate life hack".
No.
Not really.

Life hacking, in its basic form, is using standard stuff to make complicated/boring tasks simpler in non-obvious ways. The essence of playful hacking applied to life. Saving your sorry ass from a tiger with a bit of wood is not so much a hack as a "dammit, where's me cannon?" moment. Assuming, of course, you survive. It is also not something you are likely to encounter much in this day and age.

Life hacking, in its more wishful form, is exactly that. You see this? It's my katana. It's so bloody awesome it can slice through solid objects, like cars, in slow motion.
That would be a life hack. Sadly, I have not yet found the cheat code, despite trying the Konami code on every elevator and vending machine with the appropriate buttons...

 

 

Your comments:

Rick, 30th December 2013, 20:27
The Konami code is: up up down down left right left right b a 
 
Mmmm... I wonder what would happen if you tried it now? <hint!> ☺
joe, 3rd January 2014, 00:54
How long would one's PC be on line, to get that many packets sent and received? 
Packets received amounts to US's latest national debt figures.

Add a comment (v0.11) [help?]
Your name:

 
Your email (optional):

 
Validation:
Please type 62258 backwards.

 
Your comment:

 

Navi: Previous entry Display calendar Next entry
Switch to desktop version

Search:

See the rest of HeyRick :-)