Page 5 of 6

RE: Telegram Push notifications

Posted: Tue Dec 11, 2018 11:09 am
by Robbie Ferguson
How interesting. Are you using some kind of dongle for networking or something?

What does this output: sudo nems-info nic

RE: Telegram Push notifications

Posted: Tue Dec 11, 2018 11:24 am
by baggins
Robbie Ferguson wrote: How interesting. Are you using some kind of dongle for networking or something?

What does this output: sudo nems-info nic
No, NEMS is connected directly to a switch by cable...

Code: Select all

$ sudo nems-info nic
 
eth0 proto ra

RE: Telegram Push notifications

Posted: Tue Dec 11, 2018 1:29 pm
by Robbie Ferguson
Thanks.
What is the full output of this command? ip route get "172.217.10.142"

RE: Telegram Push notifications

Posted: Tue Dec 11, 2018 5:14 pm
by baggins
Robbie Ferguson wrote: Thanks.
What is the full output of this command? ip route get "172.217.10.142"

Code: Select all

ip route get "172.217.10.142"
172.217.10.142 via 192.168.0.1 dev eth0 src 192.168.0.28 
    cache 

RE: Telegram Push notifications

Posted: Sun Dec 16, 2018 3:09 pm
by Robbie Ferguson
Try as I might, I am yet unable to replicate the problem you're experiencing.

What is the output of this command?

Code: Select all

cat /usr/local/bin/nems-info | grep proto

Thanks!

RE: Telegram Push notifications

Posted: Sun Dec 16, 2018 4:58 pm
by baggins

Code: Select all

$ cat /usr/local/bin/nems-info | grep proto
  interface=`ip route get "$host_ip" | grep -Po '(?<=(dev )).*(?= src| proto)'`
BR

RE: Telegram Push notifications

Posted: Sun Dec 16, 2018 8:24 pm
by Robbie Ferguson
Thanks. So you have the latest software, and all should work correctly. It makes no sense that your nems-info nic is outputting "eth0 proto ra" since your nems-info script contains grep -Po '(?<=(dev )).*(?= src| proto)'`... the return from that would be eth0 in your case as per (dev )).*(?= src| proto). Even manually echoing your result I still get eth0.

echo "172.217.10.142 via 192.168.0.1 dev eth0 src 192.168.0.28" | grep -Po '(?<=(dev )).*(?= src| proto)'

You are experiencing the issue on NEMS 1.4.1 on a Pi?

RE: Telegram Push notifications

Posted: Mon Dec 17, 2018 3:45 am
by baggins
Yes, this is 1.4.1 on a Pi.
However, I had a closer look at the output of the nems-info  script.

Code: Select all

host_ip=$(getent ahosts "$host" | awk '{print $1; exit}')
returns: 

Code: Select all

2a00:1450:400e:806::200e
so, this is an IPV6 address...

Code: Select all

interface=`ip route get "$host_ip"`
returns:

Code: Select all

2a00:1450:400e:806::200e from :: via fe80::de53:7cff:feec:d56b dev eth0 proto ra src 2a02:1812:1709:ac00:ba27:ebff:fe42:c170 metric 1024 hoplimit 64 pref high
The grep that this is piped to probably gets confused...

EDIT: I experimented somewhat with the grep command and this does the trick:

Code: Select all

| grep -Po '(?<=dev )[^ ]+'

Code: Select all

echo "2a00:1450:400e:806::200e from :: via fe80::de53:7cff:feec:d56b dev eth0 proto ra src 2a02:1812:1709:ac00:ba27:ebff:fe42:c170 metric 1024 hoplimit 64 pref high" | grep -Po '(?<=dev )[^ ]+'
eth0

RE: Telegram Push notifications

Posted: Mon Dec 17, 2018 10:01 am
by Robbie Ferguson
Oh okay - the result you had posted was IPv4. I'll do some testing with the IPv6 result - thanks.

grep -Po '(?<=(dev )).*(?= src| proto)' -- this selects the text between "dev " and either " src" or " proto". By deleting the second part, you'd break the result on most board, resulting in a result like you are reporting.

This is why I'm confused by your result of 172.217.10.142 via 192.168.0.1 dev eth0 src 192.168.0.28.

As you can see, eth0 is between "dev " and " src" - so the result would be eth0.

I think you tested and gave me answers from the wrong system  :)

I'll fix it based on the new info. I see the problem based on your IPv6 result.

Robbie

RE: Telegram Push notifications

Posted: Mon Dec 17, 2018 10:12 am
by Robbie Ferguson
Please run sudo nems-update

Should be fixed now.

Thanks baggins!