simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Where's my Pi?

Tue May 14, 2013 8:34 pm

The simple ideas are always the best :)

Just a quick cut and paste from twitter
run
http://pastebin.com/uKBmeAyU

on your desktop computer

and then save this
http://pastebin.com/03piWyvy

as client.py

then run client.py

Code: Select all

 python client.py uniquename
on your RPi
and up will pop your RPi's id address :)

This should allow us to run headless RPi on networks using DHCP and be able to find out how to connect to it using SSH or VNC or whatever you want. :)

Code not down to me - I've got a friend at the Preston RaspberryJam who has some game at times :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

mbateman
Posts: 2
Joined: Tue May 14, 2013 10:04 pm

Re: Where's my Pi?

Tue May 14, 2013 10:08 pm

Would it be useful to have a GUI/TUI that displays a unique list of names rather than printing out the IP and name every 2 seconds? I can imagine if you have a lot of RPis your screen would fill up quickly and it might be a bit hard to find the entry you want.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Where's my Pi?

Wed May 15, 2013 6:40 am

The programmer arrives :)

The things that we could now do could end up quite long :)

A GUI would be nice (but not top of my list) :)
"Server" -I'd prefer some other name BTW - like "discoverer" (but better than that) :) program should run on any main stream OS Windoz/MAC/Linux without installing other progs - so might need specfic versions as can't assume python loaded onto someones Win8 laptop :)

I think the client should default to sending the RPi hostname if no uniquename is specified as parameter

Maybe 2min should be configurable

Eventually we are going to need an installer to insert client.py into the right point of the RPi startup sequence

And then we have to get it as part of the Raspbian distro so we can find our RPi straight out the box :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

mbateman
Posts: 2
Joined: Tue May 14, 2013 10:04 pm

Re: Where's my Pi?

Wed May 15, 2013 1:41 pm

Using the hostname if there isn't a name supplied should be simple.

I'll have a look at pyinstaller I believe it will produce executables for various platforms. Windows is probably the one to start with.

Instead of configuring the 1 minute thing it is probably better to make it broadcast messages until the Bob (the machine formerly known as discoverer and server) acknowledges that it has received the IP and name.

trouch
Posts: 310
Joined: Fri Aug 03, 2012 7:24 pm
Location: France
Contact: Website

Re: Where's my Pi?

Wed May 15, 2013 3:09 pm

use Fing, a free network scanner available on desktop, android, and iOS !
Official site : http://www.overlooksoft.com/features
Android app : https://play.google.com/store/apps/deta ... droid.fing
iOS app : https://itunes.apple.com/fr/app/fing-ne ... d430921107

WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Where's my Pi?

Wed May 15, 2013 5:22 pm

Instead of configuring the 1 minute thing it is probably better to make it broadcast messages until the Bob (the machine formerly known as discoverer and server) acknowledges that it has received the IP and name.
I like "Bob" :)

Not sure about that approach - we don't want to be blamed for swamping a LAN with broadcast traffic :) - even its only once every 2 secs :)

And using precious CPU cycles when trying to do some real processing :)

But we' need to trial and error the process :)
use Fing, a free network scanner available on desktop, android, and iOS !
I use Fling on my 'droid myself to do this at the moment :) but I think its a bit of a geeky tool :)

(I hadn't realised they did a desktop version though - I'll have to give that a whirl :) )

I'm hoping this other approach can be used by say teachers in a class or just "users" being told to stick in the number it gives into a VNC type prog and then start running stuff remotely on their RPi .

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

Return to “Networking and servers”