Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

nbtscan cannot see Pi

Tue Dec 18, 2012 5:35 pm

I have one ethernet wired Pi here and one wireless connected Pi. When I run nbtscan on the wired one it finds all computers on the network, wired or wireless (including itself) apart from the wireless Pi. When I run nbtscan on the wireless Pi it finds all computers on the net wired or wireless apart from itself.
I did think it was possibly due to both computers having the same hostname so I edited /etc/hostname on the wireless Pi and changed the name and still the issue persists.
I can ping it, ssh into it, access shared drives connected to it but still nbtscan fails to see it. It will only ever become a real problem if it's IP address ever changes as it is now headless and without the scanner seeing it it may be a bit tricky.
I think it's very much a software issue as it was fine until I did a new Raspbian image for it recently but I really have no clue what may be wrong.
Can anybody shed any light please?
Cheers, Hiro.

Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

Re: nbtscan cannot see Pi (Solved)

Mon Dec 24, 2012 7:09 pm

Managed to get this sorted. Installed Samba on both machines and told them to be a member of the same workgroup and now they are able to see each other. They still have the same hostname but that doesn't seem to bother them possibly as neither run a DNS?
Installing Samba seems a long winded way of getting computers onto the same workgroup especially if you are not intending to share to Windows computers but it was the only way i could find to do it. Does anybody know a better or simpler way? One that doesn't take up 20mb of disk space on each computer would be nice.
Cheers, Hiro.

DirkS
Posts: 10127
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: nbtscan cannot see Pi

Tue Dec 25, 2012 3:02 pm

From your first post I gather your biggest worry is changing IP addresses. I solved this by letting the DHCP server in my router issue fixed addresses to my PIs. You basically link the MAC address to a fixed IP address.

BTW: nbtscan apparently scans for NETBIOS names / services. AFAIK you *do* need SAMBA installed for computers to be found...

Gr.
Dirk.

Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

Re: nbtscan cannot see Pi

Tue Dec 25, 2012 9:31 pm

Not too bothered about the IP address, quite happy with dynamic, i just expected that the network scanner would search by IP address and not netbios name. Now that you have enlightened me i will have to accept installing samba on both to get around it. In fact, as i said, it is already done and working but was just looking for a simpler way to do it that used a smaller footprint.
As a additional note, once i had set smb.conf to have both machines on the same workgroup nbtscan found them both even though they were called the same hostname so i changed them to save confusion.
BTW for anybody wanting to change the hostname, research led me to believe that i could simply edit /etc/hostname to change the hostname and whilst this did seem to work it also threw an error of something like "unable to resovle hostname" every time i tried to sudo any command. A quick search led me to change /etc/hosts as well and then it all worked fine. Just thought i'd mention this in case any other newcomers get caught out the same way.
Cheers, Hiro.

efflandt
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA

Re: nbtscan cannot see Pi

Wed Dec 26, 2012 6:38 am

Note that if you change the hostname in /etc/hostname, you also need to change it in /etc/hosts, then reboot.

Since I run Ubuntu Linux on my desktop PC which has avahi installed by default, I just needed to sudo apt-get install avahi-daemon on each Pi for ssh in Ubuntu to find them by their hostname.local. I think Apple computers have Bonjour zeroconfig by default that works with avahi, and Bonjour is available for Windows computers too. I set different hostnames on each SD card and same host keys in /etc/ssh, and have my .ssh/config set to find them by simple names (like rpi for raspberrypi.local, rpi4 for rpi4.local, etc.). Then ssh can still find them if they end up with a different dynamic IP addresses and the host keys are trusted since they all have same host keys.

Return to “Beginners”