Archive

Archive for November, 2006

How to get local routing(BGP) info for South Africa

November 19th, 2006

I recently went on a mission to discover, which subnets are “local” to South African networks, whether by ISP peering arrangements, or direct connection. I wanted this information, so that I could setup my home linux router to use Telkom’s ADSL connection for local traffic, and to use Sentech’s MyWireless connection for international traffic. Reason: Sentech pings aren’t really good for local gaming, but international speeds are great.

BGP (Border Gateway Protocol) 

All route information is published, and synchronized between ISP peers, via the BGP protocol, which is a dynamic routing protocol.

Unfortunately, it’s not as simple as install something like Zebra (a routing daemon for linux that does BGP, set it up on a Linux machine, receiving a BGP feend and have it make clever routing decisions.

No ISP will let you connect to their routers’ BGP port. Easily, or without a fight, or without paying them money for transit. This kind of public routing information, is unfortunately only available to the end-user via a series of public route-servers, and there aren’t any that I know that will allow you to receive the feed via BGP either.

So, I looked at alternative methods. I went from writing scripts to dig through the ripe, arin, and radb databases, to turning to lists of IP ranges arrange by geographic location. All the time, using whois queries to resolve the AS (AutonomousSystem) numbers, and then querying them for their official public routes. The problem is, that these routing databases aren’t always up to date, and that it’s quite difficult to figure out which AS numbers are actually local ISPs.

AS Numbers

An AS number is a  unique number, assigned by ARIN, or RIPE, that defines a BGP routing “area” or an ISP. Internet Solutions’ AS number is 3471. To see the details in the registry for an AS, go to http://www.radb.net/cgi-bin/radb/whois.cgi?obj=AS3741

To see the routes published by this AS, go to http://www.radb.net/cgi-bin/radb/whois.cgi?obj=!gAS3741

There is a set of RESERVED AS numbers, similar to “reserved” IP ranges that is supposed to be used for people that don’t have AS’s to obtain BGP information, or used for private or interior routing. Again, good luck in finding someone that’s prepared to configure a feed for you using a private AS, on a dynamic IP such as ADSL.

In the end, Gregory Massel, of http://www.ispmap.org.za/ fame, helped me to get hold of directly accessible BGP route information, courtesy of telnet://route-server.is.co.za, a public service by Internet Solutions. SAIX also runs a route-server at telnet://tpr-route-server.saix.net/
I wrote a small script that would telnet to this router, and dump the BGP routing table. This table contains local subnets, which is exactly what I was after.

From here on, it’s pretty simple to modify the script to add routes on my linux machine for these subnets on a specific interface. The net result in my scenario: ADSL gets used for local traffic, and Sentech for international.

Example script:

#!/usr/bin/perl

use Net::Telnet;

$prompt = '/public-route-server>/';
$server="route-server.is.co.za";

print "Connecting to $servern";
my $session = Net::Telnet->new(Host => $server,Prompt => $prompt,Timeout=>30);
unlink("t.log");
$session->dump_log("t.log");

$session->waitfor($prompt);

#turn off paging
$session->cmd("terminal length 0");

#get list of local routes
print "Retrieving BGP routes\n";
my @output = $session->cmd("show ip bgp\n");
print @output;
print "Route list received\n";
$session->close;

roelf Internet , , ,

Tribes:Vengeance Infinite Spawn Tool

November 19th, 2006

o, I have to run a T:V server at a service provider that’ll only let me use FTP to administer my T:V server. This is a problem, because it becomes difficult to restart the server using FTP only :)

So I pulled out the good old Borland C++ compiler and started coding.

“Hah”, I said after a day or two to the service provider. “Please install this executable.”

TVSpawn is similar to the ISpawn of T1, and T2 except it’s a bit more clever. It will restart the Tribes server, and itsself (TVSpawn) if it detects a change in it’s “.ini” file. This means that you can restart a T:V server running remotely by simply uploading a new .ini file with a new date/timestamp.

TVSpawn will also apply the settings inside the new .ini file upon restart, allowing you to change the server’s startup commandline on-the-fly. That’s the neat part.

The mediocre part is that it basically does the normal stuff that T1/T2’s ISpawn did, which is monitoring the server on it’s query port (typically port 7778) to see if it’s still responding. If the polls to port 7778 fails a predetermined number of times (maxfailures in the .ini) it will assume that the server died and respawn it.

The program and and an example ini file is available  here: http://rodent.za.net/files/tribes/tvspawn/

 Installation:

  • Drop the .ini, and .exe into our tvprogrambin directory.
  • Edit the .ini and fix all the paths/settings to your liking.
  • Run it.

What it does:

  • Uses a .ini to read it’s configuration
  • Will restart the T:V server, and itsself if the configuration file changes (date,size, etc…)
  •  Polls the T:V server on it’s GaySpy port, to ensure it’s alive.
  • Restarts the T:V server if it stops responding to polls (maximum failures configurable in the .ini)
  • Restart the T:V server if it exits
  • Applies a “startup delay” (spawnwait in .ini) whenever the process is restarted to prevent insane respawning.
  • Has mostly all options configurable in the .ini file

 Hints:

  • tvspawn.exe will take a single commandline argument. The name of the .ini file. Thus, if you want to run multiple servers, with different configurations, run “tvspawn.exe myserver.ini” to have it use a different .ini file. By default (if no commandline arguments are specified) it will look for tvspawn.ini in the current directory.
  •  Set “hidelog=1″ in the .ini file to have a “slim” version, minus the log window started up. You can always review the log by clicking on the “Show Log” button.

 To Do:

  • Make it a configurable, and installable service, with a service name for each .ini
  • Get an icon that isn’t a Llama.
  •  Include a small socket server that’ll accept remote commands, such as “reset”, “status”, and “booyah!”.

Mail me at rodent at rodent dot za dot net, if you have tips, suggestions etc…

roelf Uncategorized

Tribes:Vengeance Scripting tips, and gotchas

November 19th, 2006

Tribes:Vengeance is based on the Unreal Tournament Engine.

Here’s how it differs from normal UT scripting:

  •  When extending other base classes you have to specify the fully qualified name of the base class, e.g. instead of doing class Foo extends Object; you HAVE to do class Foo extends Core.Object; – this is naturally braindead but I guess IG may have had their reasons.
  •  C-Style comments are broken. Don’t use /* or */ to delimit comments, or blocks of code. It breaks if there are any other slashes inside. This  is pretty dumb.
  • When attempting to use structs defined inside other classes in your own derived classes, you may have to use the dependson() directive like so: class Foo extends Engine.Object dependson(~SomeClassWithStructsInIt);

Things you will need to do to make UCC work (For Beta/Demo)

Edit your UCC.ini, and ensure that you have the packages that you’re working on listed like in this following example:

~EditPackages=~Core ~EditPackages=~Engine ~EditPackages=~IGEffectsSystem ~EditPackages=~IGVisualEffectsSubsystem ~EditPackages=~IGSoundEffectsSubsystem ~EditPackages=~Editor ~EditPackages=~UWindow ~EditPackages=~GUI ~EditPackages=~UnrealEd ~EditPackages=~IpDrv ~EditPackages=~UWeb ~EditPackages=~UDebugMenu ~EditPackages=~MojoCore ~EditPackages=~MojoActions ~EditPackages=~PathFinding ~EditPackages=~Scripting ~EditPackages=~AICommon ~EditPackages=~Movement ~EditPackages=~Gameplay ;~EditPackages=~TribesGui ; these have to be commented out, crashes otherwise. ;~EditPackages=~Tyrion ; these have to be commented out, crashes otherwise. ~EditPackages=~Physics ~EditPackages=~TribesAdmin ~EditPackages=~TribesWebAdmin ~EditPackages=~TribesVoting ~EditPackages=~TribesTVClient ~EditPackages=~TribesTVServer ; my packages ~EditPackages=~FooPackage ; Add your packages at the bottom of the list, othwerise you’ll get undefined()s

  •  When compiling, you need to use “ucc make -NoBind” otherwise all the core packages will look for their associated headers/and dll’s to bind.
  • You will need to edit StartupUCC.ini and include the path to the script source code.

roelf Game Development ,

Tribes:Vengeance Master Server Polling

November 19th, 2006

I wrote a bit of code, using Luigi’s code for GameSpy in PHP, that allows you to query the gamespy master server and retrieve the list of IP and port’s for any of the GameSpy supported games.

This handy image –> [http://vengeance.za.net/servers/serverpng.png]
for example, is generated using the code, and is updated dynamically every 3 minutes.

The query code isn’t really cleaned up enough or ready for release yet, but you can mail me  if you’re interested in obtaining a copy in the meantime.

roelf Game Development ,

Tribes:Vengance Server Lister

November 19th, 2006

I wrote a small PHP script that uses QStat, and XML/XSL to display a Tribes:Vengeance servers’ server state. If you can’t make it work please don’t bug me for support. There is NO support for this thing and I don’t have the time to answer everyone’s queries, even though I’d like to.

It’s available here under a GPL license.

roelf Uncategorized

Tribes:Vengeance’s miserable failure

November 19th, 2006

Sadly,  it turned out that Tribes:Vengeance really sucks. Vivendi cancelled the very FIRST patch for the game, with a couple of lame excuses.  Such as “we only sold 7800 copies in the first week”. It’s pretty straight forward guys.  Release a game that is broken, unfinished and no fun to play, and nobody is going to want to buy it. Simple economics. If you had at least bothered to fix it, you may have caught the “long tail” and benefited from the loyalty of the fanbase.

It’s a pity. Tribes was the best team-based Science Fiction game of the last two decades, and I’m going to seriously miss it. Every other game I look at that doesn’t have jetpacks simply gets a “poor groundhuggers” response from me. Perhaps community games like Renegades, or StarSiege:2845 will bring back some of the goodness that was Tribes, but it just simply isn’t going to happen in the next year or two.

*sob*

I have however dabbled in some Tribes:Vengeance development, but only briefly.

My T:V Projects

VengeanceSpawn – infinite spawn-like tool for Tribes:Vengeance
VengeanceMaster – info about the Gamespy system used by the in-game  T:V matchmaking

roelf Business, Game Development ,

The Journalist’s Guide to Gigs and Bytes

November 19th, 2006

It seems like journalists in general are having a hard time to distinguish their gigsfrom their bytes, and their kilobits from their kilobytes. When reporting on internet connectivity in this country, it seems many journalists are incapable of distinguishing one from the other.

Now, I could create this guide by starting WAY from the back, and explain to you whata byte is, and how it differs from a bit, and so forth, but it would probably fail to get the message across. So let’s just start by saying that internet “stuff” and capacity is typically measured along two factors:

  1.  Speed – how fast data can be transferred from A to B, for example how long it takes to download a large file.
  2.  Size – how much you are allowed to, or have transferred from A to B, within a set period of time, or money.

Speed

Speed is normally measured in BITS per SECOND. This is called the bit rate. Don’t ask why, it’ll just get confusing. Just like wordly things are weighed in grams, and kilograms, so speed gets measured in *bits*, and *kilobits*. Instead of tons we have megabits. More or less a thousand bits make up the next unit, i.e. kilobits. Another thousand kilobits make a megabit. Exactly like kilograms, and grams, and tons. Except, a ton in bits is a *gigabit*. Bits, kilobits, megabits, gigabits. Each indicating the next 1000th unit.

The bit rate indicates how FAST one can get data from A to B. When someone says he has a one megabit line. It means that his line can transfer roughly 1000 * 1000  bits per second. See how we got to that?

Each megabit is made up out of 1000 kilobits and each kilobit is made up out of another 1000 bits.

Simple, isn’t it? Just like grams, and kilograms.

“Speed” in internet terms is exactly the same as “how fast does your car go?”

Speed is normally measured in kilobits, megabits, or gigabits per second – the bit rate

Technically when someone talks a bout a “one megabit” connection, he should be saying “one megabit per second” connection, but because speed is normally expressed in bits per second, everyone knows that he means 1 megabit per second, because he used the word *bit*. This is part of slang. “I have a one gigabit connection” will make most nerds want to hump your leg. This is a useful phrase to throw around at a geeky convention where you’d like to elicit some response from otherwise clamped up nerds.

Size

Size is used to measure data transferred from A to B. A transfer allowance is something contrived by ISP’s so that they don’t have to think about ContentionRatio, but that’s another topic altogether. The measurement of “amount of data transferred” is typically bytes, but bytes can be used to measure other things too, including speed (confusing eh, see the Caveats section further down).
Don’t worry. For all intents and purposes bytes are normally used to measure transferred data. A byte is normally the lowest denominator in computers of “how large” something is. Now, the same as with grams, we have bytes and kilobytes. A 1000 kilobytes makes up a *megabyte* (see the pattern here?). 1000 bytes becomes 1 kilobyte. 1000 kilobytes becomes a megabyte. 1000 megabytes make up a *gigabyte*.
Unlike Speed, Size isn’t measured per second or anything. That would be stupid. Size is just that. Size. Data transferred.
It’s akin to saying my car has driven 10 kilometres, or it has 123 000km’s on the odometer. It’s a measurement of size, or distance thus it makes no sense to express it as some size covered over time.
Another good indication of size, is when someone doesn’t mention bits in the sentence. “I have a 10 meg harddrive” means that the poor sap is from the stone ages, and that his disk can store 10 * 1000 * 1000 bytes. One megabyte is roughly equivalent to a single high resolution digital camera picture.
Ever since ISP’s caught on to the “pay per byte” model such as the one thrust upon the general ADSL populous by Telkom, ISP’s have been selling data in Gigabytes.
A gigabyte is by today’s broadband standards a relatively small amount of data. It equates to 1000 highres digital camera pictures, for reference. Some ISP’s notably Sentech, Vodacom, and MTN have also decided to sell data by the megabyte.
Paying for gigabytes and megabytes is like paying per kilometer for a rental car. Except not. Some ISP’s like SAIX have taken this to extreme. You buy three gigs, but if you don’t use them in the month, *they vanish into thin air*. It’s like getting a rental car with the first 300 kilometers free, but they’re only valid for a week.
You pay for something, and then someone else decides for how long you’re allowed to own it! Crazy stuff, and by now all the other ISP’s are emulating Telkom in the same insane scheme. It’s the same principle as cellphone “lost minutes” which is a big money spinner, but I digress…
Slang: “I’ve done forty gigs this month!” indicates that someone has transferred 40 gigabytes of data during the month. This is quite a good bunch of bytes transferred. Around 40 megabytes per month is the international standard for broadband transfer, allowed per month. “I got capped” typically refers to someone who’s finished his 3 gigabyte transfer allowance on the Telkom ADSL network. The “cap” refers to the “transfer allowance” and being “capped” means that your transfer allowance is utterly depleted.

How to write:

Advice to you – the journalist:  keep away from the abbreviations in articles. They confuse your readers and yourselves. Use the WORD terms such as megabits per second, or gigabytes, just like that, in the text of your article. Just as your editor doesn’t like to see “i have 5 apples” in an article, so readers don’t like to see ” 5kbps” in an article. You’re probably using the abbreviation incorrectly in any case and creating confusion. Rather write ” 5 megabit per second” or “five megabits per second” if you prefer. The phrase ” five megabits ” can also be used if the sentence you’re constructing already infers *speed*, such as “the modem speed is five megabit”.
This is the simplest way to avoid confusion, and make your article readable.

Here be dragons

During the expression of speed, abbreviations are used for the words kilobits, megabits, and gigabits per second. For expressing size, or speed there are several strains of abbreviations for kilobytes, kilobits and all the others we’ve covered so far.
I’d recommend any journalist to steer clear of these, but if you’re really brave feel free to use them, as long as you’re capable of using them correctly. I’ve been in IT for 16 years and I still write it down *wrongly* sometimes. The abbreviations suck. People twist them. Even the capitalisation of the letters sometimes makes a difference. *Don’t use them*.
Ok, you’re still here, so here’s the nitty:

Speed abbreviations

Measure in BITS per SECOND. “b” used an abbreviation indicates BITS.
*The B has to be in lower case to mean bits. In upper case it means bytes*
The above is important. Do not forget it.
*kbps = kilobits per second
*mbps = megabits per second
*gbps = gigabits per second
You can also capitalize the first letter like so:
*Kbps = kilobits per second
*Mbps = megabits per second
*Gbps = gigabits per second
The “p” can also be replaced with a slash like so:
*Kb/s = kilobits per second
*Mb/s = megabits per second
*Gb/s = gigabits per second
Americans tend to like the following ones, and it’s easy to see why:
* They avoid ambiguity…
*Kbit/s = kilobits per second
*Mbit/s = megabits per second
*Gbit/s = gigabits per second
If you must use an abbreviation, these last ones are probably the clearest
of the lot. kilobits also seems to be a special case. People argue that it should
always be written with a lower case letter in an abbreviation, such as kb/s rather than Kb/s.
Mb/s and Gb/s however always has to be capitalized. Or so they say. See why abbreviations suck?

Size abbreviations

Simply measured in BYTES. “B” used an abbreviation indicates BITS.
*The B has to be in UPPER case to mean bytes. In lower case it means bits*
The above is important. Do not forget it. This is why things get confused.
Remember SPEED = BITS, and SIZE = BYTES. There’s a vast difference.
* kB=kilobyte
* MB=megabyte
* GB=gigabyte
* TB=terabyte
As you can see, this indicates size, since there is no mention of seconds.
These are the recommended abbreviations for size, but as I explained. Rather steer clear from them.

Caveats:

The moment you see size expressed along with seconds, for example “GB/s” it means that
someone has started expressing SPEED in BYTES, instead of SPEED in BITS, which is perfectly valid.
This is how your internet explorer expresses it’s transfer speed when downloading that huge file.
You will see things like 30kB/s in your internet explorer download, which indicates a speed expressed
in bytes. Most end user software express their download speed in BYTES because BYTES are typically
the smallest unit that computers deal with when storing things.
Modems on the other hand typically deal with BITS which is why modem speeds are expressed in
BITS per second.
There’s also a further BINARY expression of bits,

References:

For further reference:
  •  http://en.wikipedia.org/wiki/Megabyte
  • http://en.wikipedia.org/wiki/Bit_rate
  • http://en.wikipedia.org/wiki/Bits_per_second

roelf Internet , ,

The Fridge, A nightclub

November 19th, 2006

I ran TheFridge (as a partner) for a number of years. Some of us a little “older” in the teeth, and with a taste for Gothic/Industrial music, might remember the club.

I will finish ranting about this at some stage, but let me tell you: being a Nightclub Owner really just isn’t worth it. It sucks your will to live.

The Fridge, is located here http://thefridge.co.za

roelf Uncategorized

An interesting way to increase MyWireless signal strength

November 19th, 2006

Lots of MyWireless users have reported that cutting a hole about 4cm from the back of a Pringles can, and sticking the modem’s antenna into it has increased their gain in signal from ~5% to 15%

This is very likely due to the fact that the PringlesCan acts as a basic “waveguide” which causes the modem’s output signal to be more directional than the standard omnidirectional antenna.

Simply cut a hole in a Pringles Can, and move your modem around towards the direction where it gains the most signal.

Of course, the rolls royce of CanTennae is the 750g Frisco coffee tin, with a PigTail.

roelf Uncategorized

IPWireless Win32 driver – debugging and reversing

November 19th, 2006

A series of tweaks for the Win32 USB drivers of the IPWireless modem, and some more tweaks for the “Wireless Broadband Dialler”

Getting rid of the debug overhead in the drivers:

The USB drivers log a lot of useless information about the USB protocol used to communicate with the modem, using the win32 DbgPrint kernel function-call. This causes some serious overhead, and can amount to quite a bit of extra CPU cycles when running at high speeds. This “spam” is quite obvious when you run a tool such as DebugView. (Try it, you’ll note the spam, and remember to ‘Capture Kernel Events (Ctrl+K)’) In addition the kernel has to buffer any DbgPrint data in an internal buffer until it overflows, or an application such as DebugView reads it off the stack. This incurs even more ring 0 overhead on systems using the USB driver.

The DbgPrint spam is controlled via a registry entry in the ipw_*.inf files… It’s easier, to just find the keys, after installation and change the debug flags, than reinstalling the drivers with modified .inf files.

By disabling the debug information and the extra overhead when talking to the USB device, I’ve managed to shave around 5-8ms off my ping times. (A completely subjective measurement) [YMMV] <— Under profiling conditions, with a kernel debugger the call overhead per USB poll dropped from 230 cycles to 89 cycles which is a considerable saving in CPU cycles wasted. (This was an objective measurement).

I find it quite insane that a company such as MCCI can distribute drivers for production release with full debugging turned on.

Hopefully, once I patch the drivers this may drop to around 3-4% levels since there is still considerable overhead in checking the debug flags.

In the meantime, to at least reduce the syscall overhead when using the drivers, the following can be done:

_Warning, the StandardDisclaimer applies when attempting any of the following:_

Disabling the debug information (Win2000,WinXP):

*Fire up regedit.exe
*Do a search for the string “~MCCIUSB_~DebugLevel” by pressing Ctrl+F (enter it without the quotes)
*Once you’ve found the value (the default will be 0xffffffff), change it by double clicking on it.
*Change the value to 0 (decimal, or hexadicimal)
*Click ok.
*Press F3 to find the next occurrence of “~MCCIUSB_~DebugLevel” and keep on changing the values to 0.
*Once there are no more entries found, reboot your PC.

Getting the dialer to print more information

The dialler application, has a few registry entries to show more “debug” information in it’s window. This kind of information is actually useful, and has very little overhead, since the debug info is only printed during the connection establishment phase. If you’re like me and want to see what your modem is doing, then turn on the debugging for the dialler as described below.

To turn on full debugging for the dialler application:

*Fire up regedit.exe
*Navigate to HKEY_LOCAL_MACHINESOFTWAREIPWireless Inc.IPWireless PC Software
*Right click on “IPWireless PC Software” in the tree, and on the popup menu select New->Key
*Type in “Debug” (without the quotes) and hit enter, to create a new Key.
*Now, left click on HKEY_LOCAL_MACHINESOFTWAREIPWireless Inc.IPWireless PC SoftwareDebug in the tree.

__theloop__
*Right click in the blank area (NOT in the tree) and click on New->String Value
*Enter ATCMD, and hit enter
*Double click the ATCMD entry and type in “Enable” (without the quotes)

*Repeat starting at __theloop__ for the following values:
**ATRES
**ATRESP
**~RasTrace

Now, when you use the “Wireless Broadband Modem Dialler” application, some more debugging information will be shown in the “ISP” window.

Getting the dialler to retry more than 5 times after disconnect:

The “Wireless Broadband Modem Dialler” has an option on the “ISP” tab to “Reconnect if line dropped”
When you turn this checkbox on, the dialler will retry for a maximum amount of 5 times to reconnect to the Sentech network.

This is pretty useless, since we all know: _When it goes down, it goes down for a while_
To increase the number of attempts that the dialler will use when attempting to redial do the following:

*Fire up regedit.exe
*Navigate to HKEY_LOCAL_MACHINESOFTWAREIPWireless Inc.IPWireless PC Software
*Find the entry named RECONNECT_ATTEMPTS on the right-hand side.
*Double click the RECONNECT_ATTEMPTS entry, and change the value to 10000
*This will cause the dialler to retry 65536 times when the line gets disconnected.

roelf Uncategorized , , ,

ProASM releases alternative Sentech MyWireless Dialler

November 19th, 2006

 ProAsm has created a windows dialler application for the Sentech Modem, that replaces the default Sentech dialler, and displays signal strength with a higher frequency, and has some neat other features. http://www.unrealza.co.za/proasm/mywireless.html

roelf Uncategorized

IPWireless P1C Modem Commands

November 19th, 2006

The modem, when connected via USB, emulates a Hayes “AT” command set compatible modem. Some of the commands are extensions for 3G devices ratified the “3GPP TS 27.007 AT command set for 3G User Equipment (UE)”

at http://www.3gpp.org/ftp/Specs/html-info/27007.htm.

The IPWireless modem implements a very basic subset of this specification. Here is a list of known commands, and a description of what they do. This list isn’t exhaustive, there are some other commands, for PIN management etc, but I haven’t bothered to document those, as Sentech doesn’t requires SIM cards – hence the PIN functions don’t do anything. Also note that these are brief, generalized descriptions of what they do. For the full spec, read the 3GPP document.

!AT+CGMM – Get model ID

*Function:* Returns the model ID of the equipment.
*Example:*
AT+CGMM?
+CGMM: Phase 1(c)

0
OK

!AT+CGMR – Get firmware version

*Function:* Returns the firmware level of the modem.
*Example:*
AT+CGMR?
+CGMR: 4.2.1.1 / A1 (2.0) / A2 (2.0); 4.2.1.1

0

OK

!AT+CGSN – Get modem IMEI

*Function:* Returns the GSM IMEI unique identifier of the modem.
*Example:*
AT+CGSN?
+CGSN: 351152000146190

0

OK

!AT+CSQ – Get signal strength information

*Function:* Returns the signal strength percentage, RSCP, and ISCP
*Example:*
AT+CSQ
+CSQ: 29,99,-79,-95,5

OK
*Description:*
In this example, 29 is the reported percentage signal strength, 99=unknown fixed value,
-79 is the RSCP, and -95 is the ISCP. It is unclear what the final "5" indicates.

*Alternate example:* Query supported/range of CSQ values
AT+CSQ=?
+CSQ: (0-91,99),99,-116..-25,-116..-25

OK

!AT+COPS – Operator selection and querying.

*Function:* Returns/selects the Network provider
*Example:*
AT+COPS?
+COPS: 1,2,"00000"

OK

*Description:*
In the above example, the list of known operators was requested, returning Sentech's "00000", which
you will see in the dialler.
"2" is the numeric  ID for use in subsequent commands.
"1" is the current status of the provider. The following status codes apply:
"00000" is the alphanumeric operator ID.

:
0	unknown
1	available
2	current
3	forbidden

An operator Sentech is selected in the following fashion:
AT+COPS=~[,
,]

E.g.
AT+COPS=1,2,"00000"

Where "1" (mode) means manual selection, "2" means 'select-by-numeric-id', and "0000" is Sentech's
ID.

Other modes:
0	automatic ( field is ignored)
1	manual ( field shall be present)
2	deregister from network
3	beyond scope of this description...
4	manual/automatic ( field shall be present); if manual selection fails, automatic mode
        (=0) is entered

!AT+CBC – Get battery information

Function: Returns the signal strength percentage, RSCP, and ISCP
*Example:*
AT+CCBC
+CBC: 13,97

OK

*Description:*
In this example, 13 appears to indicate "AC Power". 97 is the battery level, in percentage.

Alternative example: Query supported/range of CBC values
AT+CBC=?
+CBC: (0,1,2,3,4),(1-100)

OK

It is interesting to note, that the modem appears to report values outside of the
range. (13 in the example).

!AT+CGATT – Get/set frequency information

*Function:* Get the frequency, and base station attached to
*Example:*
AT+CGATT?
+CGATT: 2506000, 7.68Mcps, 31, 126

OK
*Description:*
It's unclear what all these numbers mean, but at a guess 2506000 is obviously
the frequency used to talk to the currrently attached tower. 7.68Mcps is
probably the negotiated maximum speed, 31=unknown, and 126 is the base station
number.

*Function:* Clear frequency list
AT+CGATT=0
OK
AT+CGATT=1,0
OK

Description: Clears the modem's internal frequency list.
AT+CGATT? for instance, will report that the modem is not connected to any tower -
"+CGATT: -, -, -, -"

*Function:* Select a set of frequencies
AT+CGATT=1,,...

Freq, can be any of the three Sentech frequencies:

*Example:*
AT+CGATT=0
OK
AT+CGATT=1,0
OK
AT+CGATT=1,2518000,2506000,2530000

The modem will respond, immediately with "OK" if it was able to attach to a tower
using the specified frequency(ies). If not, it will not respond, until another character
is sent. This can be used to check of it's possible to attach to a tower at the specified
frequency, within a specific timeout.

If the modem attached, using the specified frequencie(s), AT+CGATT? will return the tower
details.

It would be nice if this command actually worked as one would expect it to. The modem however
seems to be very insistent on what tower it latches on, regardless of specified frequencies,
so the data in this command appears to be more of a "hint" to the modem than a set instruction.

The modem seems to scan a wide range of frequencies, regardless of this hint.

roelf Uncategorized

MyWireless/IPWireless P1C USB Modem Drivers for Linux

November 19th, 2006

I wrote a Linux device driver for the IPWireless USB modem that has been included since kernel 2.5 

These can now be found at http://www.neology.co.za/opensource/sentech-mywireless-ipwireless-p1c

I also have some old archives, and collections of tools, firwmare and an alternative driver which was written by some guys for Woosh in New Zealand over here.

The device driver was written by painstakingly reverse engineering the Windows driver using USBSnoopy.

roelf Unix Development , , , ,

Linux Development – The pleasure and the pain

November 19th, 2006

Developing software under Linux can be a pleasure. It can also be a real pain. The following are just *some* of my observations about it.

Why Linux, GNU, and GCC tools are great:

  • It’s the best standards-based compiler in the world:
    I mean it. Nothing beats it’s stability in terms of being able to gronk code written in ANSI, or ISO, or GNU’ish C.
  • Most cross platform toolchain:
    GCC, and tools are the most cross platform compiler, and from all compiler’s I’ve used, allows the most fine-grained control of code optimisation. Aside from that, the assembly code it produces is very optimal, regardless of the platform you code on. Hell, I can even cross-compile Windows code on Linux, and the resulting stuff runs better than what native compilers can produce.

Why Linux, GNU, and GCC tools suck

  • Newer versions of GCC suck:
    Specifically the 3.x series just plain suck. GCC 2.95.3+ are the most stable GNU compilers ever. I don’t know why they even bothered with the 3.x series. It just broke everything, and it’s speed/performance is atrocious. (update: GCC 4 again moved back to ’stable’ predictable)
  • Lack of development IDE:
    I’m a vim, and grep man myself, but the fact is there are very few good IDE’s for the GCC collection. Sure, there are tools. I know, I’ve tried most of them. The fact is, that none of them come close to the INTEGRATED experience that is Microsoft’s Visual C++ (update: I refuse to Eclipse thank you)
  • Lack of integrated ASSEMBLY level debugger:
    Yes, I know about VGDB, and the myriad of other tools out there that front-end GDB, but let’s face it. They’re all still GDB, with a crappy shell. And GDB has never integrated well into any IDE. Hell, even free Windows debuggers (Assembly/source) such as OllyDbg kick the pants out of GDB.
    I know many would say that console level, command prompt driven debugging is the only way to go, but even Visual C++ is able to produce a _proper_ stack backtrace, and produce readable disassemblies from running code, even without debug information. OllyDbg’s code analysis takes it to the next level.Fact is, that even Visual C++’s debugging capabilities kicks GDB and any other available tool for Linux’s behind.
  • !MAN (manual pages) suck:
    Yes, I know that may sound weird. But manpages do suck. Sometimes the actual documentation is more damaging, than not having any documentation at all. Then, there’s the interface, and search capabilities, and just the arrangement of manual pages. Yes, I know there’s tools like apropos, and a myriad other to enhance the searching, but there’s still _nothing_ GNU tools can offer that matches the well maintained, and usable format of Microsoft’s MSDN library. It’s a pity.

roelf Uncategorized

Legends – A spiritual successor to Tribes2

November 19th, 2006

I’m one of the developers behind a game called Legends. Legends started out as a project to be what Tribes2, and Tribes1 never was, and then, it grew completely out of control. I’m officially the Linux port-monkey, and general “plumbing” coder for Legends.

Legends was made possible by the awesome people of Dynamix, who got shut down by Sierra. The lead developers then started a company called GarageGames, which licenses the Torque (ala Tribes2) game engine to developers for the meagre sum of $100.

That’s the best deal you can get for _any_ kind of game engine. Tribes1, and Tribes2 were well known for their excellent network code, and engine. Besides that, the engine has an open scripting interface, and runs on Linux, AppleMacintosh, and Win32.

To checkout, Legends go to http://www.legendsthegame.net/

Contributions are welcome. We need more sound specifically. The game is currently at no 9 on the HappyPenguin rankings, and is well known amongst the Gentoo crowd, and loved elsewhere.

roelf Game Development , ,

GarageGames

November 19th, 2006

This is the company that the ex-developers of Dynamix went to, when [Vivendi] started firing all the talented people that made them rich. These guys rock, and are the next generation studio to be watching.

roelf Uncategorized

GameSpy threatens litigation against developer

November 19th, 2006

GameSpy has a bit of a monopoly around online services for multiplayer games, including server listings etc. They use a lame XOR encryption technique to ‘restrict’ third party access to these master servers. Fortunately, due to their monopoly they can’t really quickly change things without breaking it all, and thus the algorithm has been documented and became available for opensource developers thanks to the efforts of Luigi Auriemma of http://aluigi.altervista.org.

Unfortunately GameSpy then decided it would be good to threaten him with litigation.

Yay. Go Go GameSpy. Read about this pretty sad story at http://aluigi.altervista.org/papers.htm#distrust

roelf Uncategorized

Dynamix

November 19th, 2006

The gods of game programming.

roelf Uncategorized

DataPro

November 19th, 2006

DataPro are one of the best ISP’s in South Africa, in my opinion. These guys care about their staff. And that is something I have to respect.

I’ve been hosting, and dealing with them for well over 4 years now, and I have never had anything but awesome service from them. Heck when we were arranging a Europe — Brittain game of Tribes2, these guys went to the trouble of reprioritizing their traffic, and assuring the best ping times for .za vs .uk. They were even prepared to let us use their offices to reduce any possible latency.

They’re also the first people in South Africa that came out with an industrial grade UNCAPPED ADSL product, including a firewall, and 16 hours support per month.

All I can say, is that in my opinion DataPro will go a long way, due to their superior management and technical skills. Their MD is approachable, and their technical staff are comitted.

Plus, they have one of the most beautiful hosting facilities I’ve seen in my life.

Rock on DataPro.

roelf Business ,

CanTennae: A cheap way to improve MyWireless signal strength.

November 19th, 2006

A Cantenna is a homemade antenna using a coffee can, or even a Pringles can. These are typically called “WaveGuide” antennae since they guide/focus the waves.

This section will be expanded once I take some time to complete it. In the meantime, there are some pictures available here:  http://rodent.za.net/files/cantenna

Since MyWireless generally uses the same frequency as 802.11 kit, any 802.11 antenna design should suffice.

A lot of marvelous, yet highly experimental information about CanTennae is available at http://www.seattlewireless.net/index.cgi/DirectionalAntenna

This is what my Cantenna design was based off.

The best kind of antenna for MyWireless is a *directional* antenna, since it allows you to improve your return signal to the base station.

Cabling:

Cabling from your antenna is very important. You can calculate how much signall loss there is in the cable by using this calculator http://www.timesmicrowave.com/cgi-bin/calculate.pl

LMR195 seems to be used quite often, but over a 15m stretch of LMR195 you will lose 9db. LMR400 is more expensive, but over the same length will only lose 3dB

roelf Hardware , , ,