I'd try a a different angle. All raspberries are somehow identifiable in a couple of ways:
- via a separate URL (hard coded solution)
- the WAN IP (dynamic solution but probably not fixed and not useable for setups with multiple raspberries behind the same router)
- their MAC address or their Serial number. (also dynamic, needs some minor scripting to extract it)
If you do a request to an external webpage, you can use this identifiers to redirect you to the desired page.
The solution below will allow you to setup your raspberries without needing to know where they need to point at beforehand. It logs the requests in http://yourserver/kiosk.log so you can identify new raspberries more easily. The scripts on both sides probably will need some fine tuning, but I hope it helps you to get started.
It obviously requires an external webserver with PHP.
On the Pi side:
(example for use in bash)
wget http://yourwebserver/kiosk.php?id=`awk '/^Serial\s*:\s/{print $3}' /proc/cpuinfo`
If you're using X
to display your pages you'll need to find a way to get this serial number pasted correctly. I cannot help you with that, I suggest you open a separate new question to get answers on how to do this.
On webserver/kios.php
<?
// redirect url for when ID is given but not found in the serial list
$default_unknown_id = 'http://google.com';
// redirect url for when no ID is given at all
$default_no_id = 'http://stackexchange.com';
// list your raspberry serial numbers with their redirects
$serial['0000001234000001'] = 'http://yourserver/url1';
$serial['0000001234000002'] = 'http://anotherserver/url2';
$serial['0000001234000003'] = 'http://example.org/';
$serial['0000001234000004'] = 'http://yourserver/url4';
$serial['0000001234000005'] = 'http://yourserver/url5';
if (@$_REQUEST['id'])
{
$request = $_REQUEST['id'];
if (array_key_exists($request, $serial))
{
$url = $serial[$request];
}
else
{
$url = $default_unknown_id;
}
$log[] = date('Y-m-d H:i:s');
$log[] = $_SERVER['REMOTE_ADDR'];
$log[] = $request;
file_put_contents('kiosk.log', implode("\t",$log)."\n",FILE_APPEND);
}
else
{
$url = $default_no_id;
}
echo '<html><head><META http-equiv="refresh" content="1;URL='.$url.'"></head>';
?>