1

What would be the best way to manage multiple raspberry Pi in kiosk mode? I was thinking on pointing them to a website that has the information they need to display. But I don't know if there's anything or I need to build something to be able to remote edit those raspberry pi kiosk to point to a different website. (Not all the raspberry pi will point to the same url).

I was thinking on searching Raspberry Pi in the network with something like this: Find Raspberry PI address on local network But then I don't know if they will be in the same network or not. So it's better if I assume that will need WAN access.

So to make it short: - Multiple Raspberry pi in Kiosk mode pointing to a url (can be different for different Pi) - Wan access to modify the url they are pointing to or restart it. - Will only display a website each of those Pi

SERPRO
  • 113
  • 7

1 Answers1

1

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>';
?>
EDP
  • 1,691
  • 1
  • 14
  • 24