Andyroo
Posts: 4206
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 9:18 pm

Just look on the router / dhcp server?
Need Pi spray - these things are breeding in my house...

User avatar
rin67630
Posts: 462
Joined: Fri Mar 04, 2016 10:15 am

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 9:21 pm

thagrol wrote:
Fri Jun 28, 2019 8:48 pm
99.9% is a little strong, it's unlikely that you have experience of that many routers.
OK my realm is the typical noob's home*, who never changed the defaults of his router, does not know how to do it, is even unable to remember the routers credentials and has got a very max of 6-7 devices connected. Else you haven't got any problem and can look at the DHCP report.

*I am installing residential environmental data loggers.

Ernst
Posts: 1215
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 9:33 pm

rin67630 wrote:
Fri Jun 28, 2019 9:21 pm
thagrol wrote:
Fri Jun 28, 2019 8:48 pm
99.9% is a little strong, it's unlikely that you have experience of that many routers.
OK my realm is the typical noob's home*, who never changed the defaults of his router, does not know how to do it, is even unable to remember the routers credentials and has got a very max of 6-7 devices connected. Else you haven't got any problem and can look at the DHCP report.

*I am installing residential environmental data loggers.
What about a school environment ? That is where there can be much more devices and the pupils do not have a access to the DHCP report, most likely they do not even know what DHCP means.
The road to insanity is paved with static ip addresses

Andyroo
Posts: 4206
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 9:38 pm

knute wrote:
Fri Jun 28, 2019 9:14 pm
I do a lot of development on a Windows 10 machine. I use it to burn my SD cards. I've installed Bonjour but for the life of me can't get it to find other computers on the network with their hostname.
...
Can you find other computers by name from a Pi or other computers on the network?

Newer updates of Windows 10 have had a few fixes of the inbuilt mDNS support I understand so it may be worth trying without Bonjour :lol: The other thing to test is with the devices on the same physical segment of your LAN - either in the same Ethernet switch or WiFi SSID and AP. Going by the issues with Plus-net it would not surprise me is other cheaper home kit has issues.
Need Pi spray - these things are breeding in my house...

Andyroo
Posts: 4206
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 9:39 pm

Ernst wrote:
Fri Jun 28, 2019 9:33 pm
rin67630 wrote:
Fri Jun 28, 2019 9:21 pm
thagrol wrote:
Fri Jun 28, 2019 8:48 pm
99.9% is a little strong, it's unlikely that you have experience of that many routers.
OK my realm is the typical noob's home*, who never changed the defaults of his router, does not know how to do it, is even unable to remember the routers credentials and has got a very max of 6-7 devices connected. Else you haven't got any problem and can look at the DHCP report.

*I am installing residential environmental data loggers.
What about a school environment ? That is where there can be much more devices and the pupils do not have a access to the DHCP report, most likely they do not even know what DHCP means.
I would hope that the class tutor would know how to find the Pi info or any tech support the school has. Given how regulated the local schools are around here then there is no way these would be used with a whole lot of work :lol:
Need Pi spray - these things are breeding in my house...

User avatar
thagrol
Posts: 1777
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 9:53 pm

rin67630 wrote:
Fri Jun 28, 2019 9:21 pm
thagrol wrote:
Fri Jun 28, 2019 8:48 pm
99.9% is a little strong, it's unlikely that you have experience of that many routers.
OK my realm is the typical noob's home*, who never changed the defaults of his router, does not know how to do it, is even unable to remember the routers credentials and has got a very max of 6-7 devices connected. Else you haven't got any problem and can look at the DHCP report.

*I am installing residential environmental data loggers.
Fair enough. You've probably got experience of more models of domestic routers than I have. You'll forgive my challenge, I hope, it's my experience that many folks who make claims about 99.9% of X actualy have experience of less than 1% of X (and yes I know I'm doing the same thing by quoting stastics without evidence ;))
This space unintentionally left blank.

User avatar
thagrol
Posts: 1777
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 9:55 pm

Andyroo wrote:
Fri Jun 28, 2019 9:39 pm
I would hope that the class tutor would know how to find the Pi info or any tech support the school has. Given how regulated the local schools are around here then there is no way these would be used with a whole lot of work :lol:
Back in my day you were lucky if the class tutor could find the on switch.

Though to be fair computers have changed somewhat since then.
This space unintentionally left blank.

knute
Posts: 462
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 10:22 pm

Andyroo wrote:
Fri Jun 28, 2019 9:38 pm
knute wrote:
Fri Jun 28, 2019 9:14 pm
I do a lot of development on a Windows 10 machine. I use it to burn my SD cards. I've installed Bonjour but for the life of me can't get it to find other computers on the network with their hostname.
...
Can you find other computers by name from a Pi or other computers on the network?

Newer updates of Windows 10 have had a few fixes of the inbuilt mDNS support I understand so it may be worth trying without Bonjour :lol: The other thing to test is with the devices on the same physical segment of your LAN - either in the same Ethernet switch or WiFi SSID and AP. Going by the issues with Plus-net it would not surprise me is other cheaper home kit has issues.
No problem using a linux computer to find them. I just tried it with my Win 10 machine that is up to date and it works. Straight ping hostname.local returns the IPv6 address but using the -4 option I get the IPv4 address. Thanks for getting me to try it again! I can't tell you how much time I spent trying to get that to work.

Andyroo
Posts: 4206
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 11:11 pm

thagrol wrote:
Fri Jun 28, 2019 9:55 pm
...
Back in my day you were lucky if the class tutor could find the on switch.
...
My class tutor (I'm 57) worked at Rolls Royce using computers to design turbo fans and introduced me to computing using a dial-up terminal to the council mainframe - maybe I was lucky :D
Need Pi spray - these things are breeding in my house...

User avatar
HawaiianPi
Posts: 4534
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 11:12 pm

There was another recent thread on finding the IP. Might want to check that out.

https://www.raspberrypi.org/forums/view ... 3&t=241894
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Andyroo
Posts: 4206
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Suggestion: Reporting ip address in /boot/boot.ip

Fri Jun 28, 2019 11:13 pm

knute wrote:
Fri Jun 28, 2019 10:22 pm
...
No problem using a linux computer to find them. I just tried it with my Win 10 machine that is up to date and it works. Straight ping hostname.local returns the IPv6 address but using the -4 option I get the IPv4 address. Thanks for getting me to try it again! I can't tell you how much time I spent trying to get that to work.
Do not thank me - another poster on here pointed out that Windows has had problems but they got sorted with a fix pack and I remembered it :lol: I'm happy with my dear old Mac and Linux laptop (and a few Pi machines of course).
Need Pi spray - these things are breeding in my house...

User avatar
DougieLawson
Posts: 35811
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Suggestion: Reporting ip address in /boot/boot.ip

Sat Jun 29, 2019 8:04 am

The easiest way to get a file written is this one liner in /etc/rc.local

Code: Select all

ip addr show > /boot/boot.ip
Assuming the DHCP lease time is longer than ten minutes you should be guaranteed to get the same IP address on a reboot.

If you want the IP address mailed use

Code: Select all

ip addr show | mail -s "IP Address" [email protected]
You'll get something like

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether fc:b4:e6:bf:ae:70 brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.14/24 brd 192.168.3.255 scope global wlxfcb4e6bfae70
       valid_lft forever preferred_lft forever
    inet6 fd00:llll:llll:llll:feb4:e6ff:febf:ae70/64 scope global mngtmpaddr noprefixroute dynamic 
       valid_lft 296sec preferred_lft 116sec
    inet6 2002:pppp:pppp:pppp:feb4:e6ff:febf:ae70/64 scope global mngtmpaddr noprefixroute dynamic 
       valid_lft 296sec preferred_lft 116sec
    inet6 fe80::feb4:e6ff:febf:ae70/64 scope link 
       valid_lft forever preferred_lft forever
delivered to your GMail spam folder.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
rin67630
Posts: 462
Joined: Fri Mar 04, 2016 10:15 am

Re: Suggestion: Reporting ip address in /boot/boot.ip

Sat Jun 29, 2019 1:33 pm

DougieLawson wrote:
Sat Jun 29, 2019 8:04 am

If you want the IP address mailed use

Code: Select all

ip addr show | mail -s "IP Address" [email protected]
You'll get something like [...] delivered to your GMail spam folder.
Not that simple! You need first to install and configure SMTP Mail

Code: Select all

sudo apt-get install ssmtp
sudo apt-get install mailutils
Now edit the SSMTP configuration file

Code: Select all

sudo nano /etc/ssmtp/ssmtp.conf
It needs to include this

Code: Select all

root=postmaster
mailhub=smtp.gmail.com:587
hostname=raspberrypi
[email protected]
AuthPass=TheGmailPassword
FromLineOverride=YES
UseSTARTTLS=YES
Save, exit and test Dougies code, praying that GMail will not block your IPv6

Return to “Raspbian”