Raspberry Pi Offline

I’ve just set up my first device a Raspberry Pi 3. But it is showing as Offline. I’ve followed Adam’s “Troubleshooting Pi Showing Up as Offline in Dashboard” post 7 June 2016. Below are the outputs from the commands:

From command prompt on my PC:
arp -a
IP 10.1.1.9 MAC b8-27-eb-4a-…

From Putty connected to Pi:
df- h
Filesystem Size Used Avail Use% Mounted on
/dev/root 14G 3.9G 8.6G 32% /
devtmpfs 458M 0 458M 0% /dev
tmpfs 462M 0 462M 0% /dev/shm
tmpfs 462M 6.4M 456M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 462M 0 462M 0% /sys/fs/cgroup
/dev/mmcblk0p6 65M 21M 45M 33% /boot
tmpfs 93M 0 93M 0% /run/user/0
tmpfs 93M 0 93M 0% /run/user/1000
/dev/mmcblk0p5 30M 1.6M 27M 6% /media/pi/SETTINGS1

ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
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: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:1f:82:80 brd ff:ff:ff:ff:ff:ff
inet6 fe80::55ae:2f36:8c97:4b72/64 scope link tentative
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:4a:d7:d5 brd ff:ff:ff:ff:ff:ff
inet 10.1.1.9/24 brd 10.1.1.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fdcc:a223:4673:6400:2d:aaf1:a616:9da3/64 scope global noprefixroute dynamic
valid_lft 7117sec preferred_lft 3517sec
inet6 fe80::5c06:45be:12b8:82c6/64 scope link
valid_lft forever preferred_lft forever

nslookup cloud.mydevices.com
-bash nslookup: command not found
(from command prompt on PC Name: cloud.medevices.com Addresses: 54.173.248.213 & 34.199.178.126)

ping google.com
PING google.com (216.58.196.142) 56(84) bytes of data.
64 bytes from syd15s04-in-f14.1e100.net (216.58.196.142): icmp_seq=1 ttl=53 time=32.4 ms

sudo netstat -natp | grep -i established
tcp 0 0 10.1.1.9:55954 54.173.248.213:8181 ESTABLISHED 530/python3

sudo apt-get install telnet
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt-get -f install’ to correct these:
The following packages have unmet dependencies:
expect : Depends: tcl8.5 (>= 8.5.0) but it is not going to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).
(telnet from PC appears to connect)

sudo netstat -natp | grep -i established
tcp 0 0 10.1.1.9:55954 54.173.248.213:8181 ESTABLISHED 530/python3

sudo service myDevices status
● myDevices.service - myDevices service
Loaded: loaded (/etc/systemd/system/myDevices.service; enabled)
Active: active (running) since Mon 2017-08-28 15:53:16 NZST; 52min ago
Main PID: 530 (python3)
CGroup: /system.slice/myDevices.service
‣ 530 /usr/bin/python3 -m myDevices -P /var/run/myDevices.pid
Aug 28 15:53:16 pi2 systemd[1]: Starting myDevices service…
Aug 28 15:53:16 pi2 systemd[1]: Started myDevices service.
Aug 28 15:53:17 pi2 systemd[530]: pam_exec(login:session): conversation failed
Aug 28 15:53:17 pi2 systemd[530]: pam_unix(login:session): session opened for user root by (uid=0)

sudo service webiopi status
● webiopi.service - LSB: WebIOPi initscript
Loaded: loaded (/etc/init.d/webiopi)
Active: active (running) since Mon 2017-08-28 15:53:16 NZST; 53min ago
Process: 555 ExecStart=/etc/init.d/webiopi start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/webiopi.service
└─580 /usr/bin/python3 -m webiopi -l /var/log/webiopi -c /etc/webiopi/config
Aug 28 15:53:16 pi2 systemd[1]: Started LSB: WebIOPi initscript.

ps axu | grep python
root 512 1.0 0.7 9584 6716 ? S 15:53 0:34 python /home/pi/therm_sensor.py
root 530 4.9 2.2 138080 21624 ? Ssl 15:53 2:39 /usr/bin/python3 -m myDevices -P /var/run/myDevices.pid
root 580 1.3 1.4 36136 13712 ? Sl 15:53 0:44 /usr/bin/python3 -m webiopi -l /var/log/webiopi -c /etc/webiopi/config
pi 11519 0.0 0.2 4276 1952 pts/0 S+ 16:47 0:00 grep --color=auto python

at /etc/myDevices/Network.ini
[CONFIG]
CayenneApi=https://api.mydevices.com
ServerAddress=cloud.mydevices.com
ServerPort=8181

sudo tail -n 50 /var/log/myDevices.log
2017-08-28 16:46:27 - myDevices - INFO - History CalculateAverages increment: 92
2017-08-28 16:46:27 - myDevices - INFO - Calculate sensor info averages: {‘SensorsInfo’: {‘c544d252320a8ae14f01cdf109373f2b64a97b26’: 92}}
2017-08-28 16:46:27 - myDevices - INFO - Save History Averages
2017-08-28 16:46:27 - myDevices - INFO - Memory usage : 106 size: 21624
2017-08-28 16:46:27 - myDevices - INFO - Resouce usage info: resource.struct_rusage(ru_utime=138.78, ru_stime=17.64, ru_maxrss=21624, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=850237, ru_majflt=19, ru_nswap=0, ru_inblock=12752, ru_oublock=10616, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=67935, ru_nivcsw=13217)
2017-08-28 16:46:27 - myDevices - INFO - PacketTypes.PT_SYSTEM_INFO
2017-08-28 16:46:27 - myDevices - INFO - PacketTypes.PT_UTILIZATION
2017-08-28 16:46:29 - myDevices - INFO - Checking update version
2017-08-28 16:46:29 - myDevices - INFO - https://updates.mydevices.com/raspberry/update /etc/myDevices/updates/update
2017-08-28 16:46:30 - myDevices - INFO - Updater retrieve update success
2017-08-28 16:46:33 - myDevices - INFO - No new version detected. Closing update…
2017-08-28 16:46:57 - myDevices - INFO - History CalculateAverages increment: 93
2017-08-28 16:46:57 - myDevices - INFO - Calculate sensor info averages: {‘SensorsInfo’: {‘c544d252320a8ae14f01cdf109373f2b64a97b26’: 93}}
2017-08-28 16:46:57 - myDevices - INFO - Save History Averages
2017-08-28 16:46:57 - myDevices - INFO - Memory usage : 107 size: 21624
2017-08-28 16:46:57 - myDevices - INFO - Resouce usage info: resource.struct_rusage(ru_utime=140.12, ru_stime=17.79, ru_maxrss=21624, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=859103, ru_majflt=19, ru_nswap=0, ru_inblock=12752, ru_oublock=10720, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=68690, ru_nivcsw=13354)
2017-08-28 16:46:57 - myDevices - INFO - PacketTypes.PT_SYSTEM_INFO
2017-08-28 16:46:57 - myDevices - INFO - PacketTypes.PT_UTILIZATION
2017-08-28 16:47:06 - myDevices - INFO - SendHistoryData previously SendFailed items:
2017-08-28 16:47:27 - myDevices - INFO - History CalculateAverages increment: 94
2017-08-28 16:47:27 - myDevices - INFO - Calculate sensor info averages: {‘SensorsInfo’: {‘c544d252320a8ae14f01cdf109373f2b64a97b26’: 94}}
2017-08-28 16:47:27 - myDevices - INFO - Save History Averages
2017-08-28 16:47:28 - myDevices - INFO - Memory usage : 108 size: 21624
2017-08-28 16:47:28 - myDevices - INFO - Resouce usage info: resource.struct_rusage(ru_utime=141.37, ru_stime=17.98, ru_maxrss=21624, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=867429, ru_majflt=19, ru_nswap=0, ru_inblock=12752, ru_oublock=10816, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=69578, ru_nivcsw=13450)
2017-08-28 16:47:28 - myDevices - INFO - PacketTypes.PT_SYSTEM_INFO
2017-08-28 16:47:28 - myDevices - INFO - PacketTypes.PT_UTILIZATION
2017-08-28 16:47:57 - myDevices - INFO - History CalculateAverages increment: 95
2017-08-28 16:47:57 - myDevices - INFO - Calculate sensor info averages: {‘SensorsInfo’: {‘c544d252320a8ae14f01cdf109373f2b64a97b26’: 95}}
2017-08-28 16:47:57 - myDevices - INFO - Save History Averages
2017-08-28 16:47:57 - myDevices - INFO - Memory usage : 109 size: 21628
2017-08-28 16:47:57 - myDevices - INFO - Resouce usage info: resource.struct_rusage(ru_utime=142.61, ru_stime=18.07, ru_maxrss=21628, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=874510, ru_majflt=19, ru_nswap=0, ru_inblock=12752, ru_oublock=10912, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=70119, ru_nivcsw=13553)
2017-08-28 16:47:57 - myDevices - INFO - PacketTypes.PT_SYSTEM_INFO
2017-08-28 16:47:57 - myDevices - INFO - PacketTypes.PT_UTILIZATION
2017-08-28 16:48:06 - myDevices - INFO - SendHistoryData previously SendFailed items:
2017-08-28 16:48:27 - myDevices - INFO - History CalculateAverages increment: 96
2017-08-28 16:48:27 - myDevices - INFO - Calculate sensor info averages: {‘SensorsInfo’: {‘c544d252320a8ae14f01cdf109373f2b64a97b26’: 96}}
2017-08-28 16:48:27 - myDevices - INFO - Save History Averages
2017-08-28 16:48:27 - myDevices - INFO - Memory usage : 110 size: 21628
2017-08-28 16:48:27 - myDevices - INFO - Resouce usage info: resource.struct_rusage(ru_utime=143.95, ru_stime=18.26, ru_maxrss=21628, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=882410, ru_majflt=19, ru_nswap=0, ru_inblock=12752, ru_oublock=11008, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=70862, ru_nivcsw=13639)
2017-08-28 16:48:27 - myDevices - INFO - PacketTypes.PT_SYSTEM_INFO
2017-08-28 16:48:27 - myDevices - INFO - PacketTypes.PT_UTILIZATION
2017-08-28 16:48:57 - myDevices - INFO - History CalculateAverages increment: 97
2017-08-28 16:48:57 - myDevices - INFO - Calculate sensor info averages: {‘SensorsInfo’: {‘c544d252320a8ae14f01cdf109373f2b64a97b26’: 97}}
2017-08-28 16:48:57 - myDevices - INFO - Save History Averages
2017-08-28 16:48:57 - myDevices - INFO - Memory usage : 111 size: 21628
2017-08-28 16:48:57 - myDevices - INFO - Resouce usage info: resource.struct_rusage(ru_utime=145.25, ru_stime=18.44, ru_maxrss=21628, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=891265, ru_majflt=19, ru_nswap=0, ru_inblock=12752, ru_oublock=11096, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=71515, ru_nivcsw=13694)
2017-08-28 16:48:57 - myDevices - INFO - PacketTypes.PT_SYSTEM_INFO
2017-08-28 16:48:57 - myDevices - INFO - PacketTypes.PT_UTILIZATION
2017-08-28 16:49:03 - myDevices - INFO - Skipping not required packet: 37
2017-08-28 16:49:06 - myDevices - INFO - SendHistoryData previously SendFailed items:

Hi @scott2 and welcome to the Cayenne Community.

If your Pi is showing ‘Offline’ and you have the myDevices service running, it’s likely a server side issue we’re aware of at the moment that’s causing some devices to show incorrectly as offline. However there is one more thing I would check – verify that port 8181 is open as that’s what the Pi agent uses to communicate with our server, using telnet cloud.mydevices.com 8181

If the port is open you will see the following (your IP addresses may or may not be the same as mine):

pi@raspberrypi:~ $ telnet cloud.mydevices.com 8181
Trying 54.165.135.17...
Connected to cloud.mydevices.com.
Escape character is '^]'.
Connection closed by foreign host.

If the port is closed you will see the following (your IP addresses may or may not be the same as mine):

pi@raspberrypi:~ $ telnet cloud.mydevices.com 8181
Trying 52.6.151.66...
Trying 54.165.135.17...
telnet: Unable to connect to remote host: Connection timed out

The network.ini file looks like it’s not complete.

That’s all I have on my Pis:

pi@raspberrypi:~ $ cat /etc/myDevices/Network.ini 
[CONFIG]
CayenneApi=https://api.mydevices.com
ServerAddress=cloud.mydevices.com
ServerPort=8181

What else where you expecting here?

Telnet isn’t installed on Raspberry Pi and when I try “sudo apt-get install
telnetd” I get the following:

Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt-get -f install’ to correct these:
The following packages have unmet dependencies:
expect : Depends: tcl8.5 (>= 8.5.0) but it is not going to be installed
telnetd : Depends: openbsd-inetd but it is not going to be installed or
inet-superserver
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or
specify a solution).

The network.ini is different from the example used in the June 2016 post.

I’m getting emails from the Raspberry Pi. The cron job was running every minute and I’ve changed it to once an hour.

On 29 August 2017 at 09:00, Cron Daemon root@raspberrypi wrote:
myDevices is running.
webiopi is running.

If you run apt-get -f install then try to install telnet again it should probably go OK. The network.ini file structure has changed since Adam made that post, so that’s not the issue here.

edit: just noticing, you want telnet not telnetd

Still doesn’t work.

sudo apt-get -f install telnet
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt-get -f install’ to correct these:
The following packages have unmet dependencies:
expect : Depends: tcl8.5 (>= 8.5.0) but it is not going to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

I don’t have a firewall between the Raspberry Pi and the outside world. Just a ISP supplied modem/router connected to the Internet by Fibre. So there shouldn’t be any issue getting to port 8181.

I think the issue may have been a typo when setting cayenne up on my Pi. I’ve deleted the cayenne and webiopi software from my Pi and reinstalled it using my iPhone. Everything is working now. Just need to delete the Pi from mydevices website. But as it is offline there is no remove button, which seems really stupid.

Hi, I have the same problem as above. Can’t install telnet but i have home network and no firewall. The problem is that pi is showing sometimes as online and sometiems as offline. The temp from ds18b20 is changing after refreshing the page so the system is working. but pi shows and offline. Did you find any solution to the problem?
The same is with my devices on esp8266 node mcc connected to cayenne. the show sometimes as online but changing the state from time to time. is not online all the time. Why?

I think my issue was that I typed in the unique ID wrongly. But now I can’t delete the device as it is “offline” and always will be.

Thanks, I’ve updated the post.

Looks like you still need to run sudo apt-get -f install

If you click the settings wheel on the right side of the screen there is a remove button which will delete it from your dashboard.

There is a known issue with this right now. @rsiegel is there any updates on that yet?

Hello @marcin

Is the ESP8266 you mentioned in this post connected through our MQTT/“Bring Your Own Thing” API already?

If not, I’d like to recommend you try following this tutorial I just wrote up on how to convert your sketch file from our Cayenne Arduino Library to Cayenne Arduino MQTT.

We believe this MQTT connectivity is more stable and fault-tolerant than our original Arduino connectivity and would be interested to hear if you see that as well. Please feel free to contact me if you have any questions or need assistance with converting your code following the steps in that post!

1 Like