Identifying the Pi over the network


48 posts   Page 2 of 2   1, 2
by meltwater » Tue Sep 04, 2012 2:56 pm
droople wrote:
texy wrote:Well despite the dhcp update procedure above, my pi is still 'UNKNOWN' by my Sky router. I seem to have a constant ip address unless I reset the router of course, but its still UNKNOWN. So in order to connect via putty or vnc, I put in the ip of the pi, not the name. Its no big deal to me, but I,d still like to get to the bottom of it.
Texy


I have the same issue :(

I find the hostname works on some networks but not others and for different things. Home network, hostname is fine for everything. Work network, it is fine for vnc, shh, but not smb (annoying, but still enough to work with - shh in to get the ip etc). You'll probably find that the ip address will stick on a network for 24 hours or so, as they get allocated and expire.

You could also try setting a fixed ip address on the Rpi, although that is only useful if keeping on a single network (some routers will allow you to set a static DHCP ip address too - assuming your mac stays put).
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 993
Joined: Tue Oct 18, 2011 11:38 am
by wallarug » Tue Dec 11, 2012 1:10 am
I have no luck in getting RPi hostname to work.

I have a strange issue.

The hostname is broadcasting to the router but I can't ssh, vnc and others into it.

I posted http://www.raspberrypi.org/phpBB3/viewtopic.php?f=27&t=10071&p=230854#p230854 but still no responces.
RPi Hardware Guide

App Store: https://itunes.apple.com/us/app/rpi-hardware-guide/id723108328?ls=1&mt=8
Play Store: https://play.google.com/store/apps/details?id=org.cmdenterprises.rpihardwareguide

http://www.youtube.com/user/CMDenterprises
User avatar
Posts: 454
Joined: Mon May 14, 2012 8:21 am
by Mursili » Tue Dec 11, 2012 3:36 am
What distro are you running?

I am running debian wheezy and I can ping raspberrypi.local practically out of the box. It just works after I set up the network. I have not tried to ssh in.
User avatar
Posts: 28
Joined: Fri Nov 23, 2012 2:12 am
by wallarug » Tue Dec 11, 2012 4:47 am
Mursili wrote:What distro are you running?

I am running debian wheezy and I can ping raspberrypi.local practically out of the box. It just works after I set up the network. I have not tried to ssh in.


Raspbian.

I didn't put in '.local'? Should I have?
RPi Hardware Guide

App Store: https://itunes.apple.com/us/app/rpi-hardware-guide/id723108328?ls=1&mt=8
Play Store: https://play.google.com/store/apps/details?id=org.cmdenterprises.rpihardwareguide

http://www.youtube.com/user/CMDenterprises
User avatar
Posts: 454
Joined: Mon May 14, 2012 8:21 am
by Mursili » Tue Dec 11, 2012 2:52 pm
On my network at home I can ping (or ssh if I have that set up on a machine) their hostname.local by default. Just setting a hostname on one machine does not make other machines on the same network necessarily use that hostname. By default, my network requires me to use hostname.local. I can edit /etc/hosts on the machine I will be ssh'ing from to refer to the other machine if needed.

I suggest that your try pinging the machine using the hostname followed by .local and see if that works any differently. If it does, it simply means that you need to keep using the .local or edit your /etc/hosts file or find another solution.
User avatar
Posts: 28
Joined: Fri Nov 23, 2012 2:12 am
by efflandt » Thu Dec 13, 2012 7:34 am
NOTE: If you change /etc/hostname on the Pi also change that name in its /etc/hosts.

Not sure if it is necessary, but I installed avahi-daemon on my Pi, and Ubuntu Linux has avahi installed by default. That is what allows you to find other computers on the LAN by their hostname.local without having to configure samba for Windows file and printer sharing. Bonjour works for that, which I think comes with Apple and is available for Windows computers. By default avahi is only configured for ssh, so for something like vnc you would need to figure out how to add a file for that to /etc/avahi/services. Although, it works for ping.

efflandt@XPS8100-1204:~$ ping -c2 raspberrypi.local
PING raspberrypi.local (192.168.1.103) 56(84) bytes of data.
64 bytes from raspberrypi.local (192.168.1.103): icmp_req=1 ttl=64 time=3.28 ms
64 bytes from raspberrypi.local (192.168.1.103): icmp_req=2 ttl=64 time=2.89 ms

--- raspberrypi.local ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 2.896/3.088/3.280/0.192 ms
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA
by fatcinco » Thu Dec 13, 2012 7:49 am
Quick bash script to get avahi and netatalk up and running.

https://gist.github.com/raw/73230119a9a ... NSforPI.sh
Posts: 26
Joined: Tue May 15, 2012 4:50 am
by willyt » Fri Dec 28, 2012 10:05 pm
avahi is great and is a good solution for the ip address problem. You don't need to edit hosts or hostnames, just sudo apt-get install avahi-daemon to get going.

If you have vnc installed and set up to start on boot on port 5901 you can also advertise the vnc service as well as ssh. Use nano to create a new file like this in the terminal:
Code: Select all
sudo nano /etc/avahi/services/vnc.service


and paste this into it
Code: Select all
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">%h</name>
  <service>
    <type>_rfb._tcp</type>
    <port>5901</port>
  </service>
</service-group>


hit ctrl-x then Y then enter to save

If you are on a mac, the raspberry pi will show up in the sidebar of the finder after you reboot your pi and you can start a screen sharing session by clicking the share screen button

For ultimate smoothness you can create an ssh key on your main machine and scp the public key to your pi so you don't need to type a password to login.
Posts: 2
Joined: Fri Dec 28, 2012 9:52 pm
by bugloss » Fri Jan 04, 2013 2:54 pm
Hi
First post.
I'm trying to activate a screen sharing session with the pi and a mac book air running Lion.
I've gone through all the steps as you set out and I can connect to the Pi with the Mac finder.
When I try to share the screen I get a dialogue box on the mac

"Connection failed to “raspberrypi”.
Please make sure that Screen Sharing (in the Sharing section of System Preferences) is enabled on the computer to which you are attempting to connect. Also make sure your network connection is working properly."

What am I missing here and am I supposed to see a RasPi screen in a separate window?
Hope someone can help.
http://www.adamwilson.co
Posts: 22
Joined: Fri Jan 04, 2013 2:44 pm
by willyt » Wed Jan 09, 2013 8:55 pm
Hi there, you either need to install and configure a vnc server or your vnc server is not configured to start on boot, follow the instructions here:
http://elinux.org/RPi_VNC_Server
Edit: Assuming you are using the default username and you haven't changed the hostname of your raspberrypi you can connect to the pi over ssh from terminal on your mac by typing
Code: Select all
ssh pi@raspberrypi.local

and then entering following the instructions at the link above.
Hope this helps,
W
Posts: 2
Joined: Fri Dec 28, 2012 9:52 pm
by bugloss » Wed Jan 09, 2013 10:03 pm
Thanks, I'd managed to figure it out immediately after posting my issue as I stumbled accross the link that you mentioned.

Crikey I think I'm in for a mega Python cramming session as this means nothing at all to me. :o
http://www.adamwilson.co
Posts: 22
Joined: Fri Jan 04, 2013 2:44 pm
by mmbcastle » Fri Feb 15, 2013 1:51 pm
As to the MAC address, I've read that the Pi is limited to 10/100 operation because they're running the ethernet through the USB controller. I'd suspect that's the reason for a "soft MAC address".

For a LOT of reasons, it would be very handy to have a way to broadcast the Pi's IP address. I'm researching the code to make a utility to do that. My goal is to make it transmit so a setup program can find it, then give it a fixed IP. Alternately, I may have the utility find it each time a user wants to talk to the Pi, then launch a web page hosted on the Pi.

Most routers don't have DNS enabled, so they won't care about the Pi broadcasting its name. They may list the name in internal tables, but probably won't help you find the device by name. I'm away from my Pi right now. When I get home. I hope one of these solutions will give me a solution for my development machine, but I need something more general.

Edit: Duh! Didn't see page two. Looks very promising.
Posts: 2
Joined: Fri Feb 15, 2013 1:43 pm
Location: USA
by bingnet » Tue Mar 05, 2013 11:45 pm
How to use OS X to locate on the network, login to, and secure your brand new Raspberry Pi running Raspbian “wheezy”.

https://plus.google.com/115605293947059 ... MqeMY9p3gw
Posts: 1
Joined: Tue Mar 05, 2013 11:40 pm
by mmbcastle » Wed Mar 06, 2013 2:24 am
One thing I've been exploring a bit is netcat/nc. It has a lot of potential for making a simple service where you could send a broadcast on a certain port and have the Pi respond with its IP address.

This wiki entry has some interesting examples to build on.
http://en.wikipedia.org/wiki/Netcat
Bill
Posts: 2
Joined: Fri Feb 15, 2013 1:43 pm
Location: USA
by bugloss » Wed Jun 19, 2013 2:37 pm
mmbcastle wrote:One thing I've been exploring a bit is netcat/nc. It has a lot of potential for making a simple service where you could send a broadcast on a certain port and have the Pi respond with its IP address.

This wiki entry has some interesting examples to build on.
http://en.wikipedia.org/wiki/Netcat


Hi Bill

I was just reviewing my old posts after an immense session on the pi. I found a link to how to get the Pi to send an email with its IP address on boot. Plus I've got an Adafruit lcd that shows the IP address on startup, which is a big help.

Here are some helpful links that I used.

http://elinux.org/RPi_Email_IP_On_Boot_Debian
http://stackoverflow.com/questions/1014 ... ing-python
http://thepoch.com/tumblr/be-emailed-wh ... shuts.html
http://www.adamwilson.co
Posts: 22
Joined: Fri Jan 04, 2013 2:44 pm
by yv1hx » Wed Jun 19, 2013 4:09 pm
Very interesting, worked for me straight out the box, Thanks! :D

BTW I should learn Python :idea:
Marco-Luis
http://www.meteoven.org
http://yv1hx.no-ip.org
http://twitter.com/meteoven
Posts: 206
Joined: Sat Jul 21, 2012 10:09 pm
Location: Zulia, Venezuela
by bugloss » Thu Jun 20, 2013 5:55 am
yv1hx wrote:Very interesting, worked for me straight out the box, Thanks! :D

BTW I should learn Python :idea:


Me too..... :)
http://www.adamwilson.co
Posts: 22
Joined: Fri Jan 04, 2013 2:44 pm
by startrek.steve » Thu Jun 20, 2013 7:51 am
Well on my Etek router, it comes up as RASPBERRYPI, I have two Pi's and they both id with the same name.
User avatar
Posts: 53
Joined: Thu Aug 30, 2012 7:19 pm
by startrek.steve » Thu Jun 20, 2013 7:52 am
Anyway cant you assign a name in raspi-config?
User avatar
Posts: 53
Joined: Thu Aug 30, 2012 7:19 pm
by bugloss » Thu Jun 20, 2013 9:00 am
startrek.steve wrote:Anyway cant you assign a name in raspi-config?


Yes you can.

I've got mine setup to use wifi as I want to use other peoples wifi networks.

Having wlan0 as dhcp and the email script or the lcd plate to display the ip address makes life on the move a breeze, as you don't have to try and find it's address.

Of course you need to set the thing up first. :roll:
http://www.adamwilson.co
Posts: 22
Joined: Fri Jan 04, 2013 2:44 pm
by philrosenberg » Fri Feb 07, 2014 10:56 am
I have just had a similar problem, it turned out to be linked to my router. I just got a new router - my old one died - and I got a really cheap router modem with just one LAN connection, and no wifi. It then got connected to another (rather old) wifi router acting as a wifi extender and network switch in the loft (please don't ask why this strange setup it's a long story).
Anyway everything worked with the old router, but on the new router I could not connect to the pi using its hostname, either from windows or from a Linux machine. It seems the problem was that my old router was acting as a dns server using the hostnames provided by each computer on the network. My new one doesn't. Maybe there is a setting to switch this on somewhere, but I haven't found it.
The solution for me was here: https://www.zulius.com/how-to/resolve-windows-netbios-names-from-linux/ You need to install samba then follow the instructions. Remember to backup you settings file before editing.

For some reason I still cannot see my pi from my Linux machine, but I can now see it from my windows machine

Phil
Posts: 4
Joined: Thu May 30, 2013 3:21 pm
by philrosenberg » Fri Feb 07, 2014 11:16 am
the last piece of the puzzle was that you also need to install winbind - thanks to this threadhttp://www.linuxquestions.org/questions/linux-networking-3/ping-netbios-names-from-linux-samba-271336/ although the poster incorrectly called it winbinds with an s

Now I can connect between all my machines using NetBIOS names

Phil
Posts: 4
Joined: Thu May 30, 2013 3:21 pm
by meltwater » Fri Feb 07, 2014 10:00 pm
An excellent tip from Raspi.TV is android app Fing. If you have wifi access to the same network it will find all the devices you have attached and make a guess at the manufacturer based on the MAC address.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 993
Joined: Tue Oct 18, 2011 11:38 am