Troubleshooting Pi Showing Up as Offline in Dashboard

Here are some checks for common problems that will show your Pi as “Offline” in the dashboard.

Are you on a corporate network? Many times, Cayenne is blocked by corporate networks. Cayenne needs port 8181 to be open.

If you are working headless or remote, find your Pi’s IP address:

  • arp -a
  • your Pi’s MAC will begin with b8-27-eb

Use Putty for windows or the command ssh for linux to connect to your Pi with SSH, or use the terminal locally to use the commands below.

Check if your disk is full:

  • df -h

Check everything networking related:

  • ip addr
    • Check that the IP, subnet, and gateway are all correct
  • nslookup cloud.mydevices.com
    • This should return the IP adresses for the Cayenne server. If no IP address is returned or it times out check your DNS server using “nano /etc/resolv.conf”
  • ping google.com
    • This will test your connection out to the internet
  • sudo netstat -natp | grep -i established
    • You should see 52.6.151.66:8181 or whatever cloud.mydevices.com resolves to for you listed here
  • Do you have a firewall blocking port 8181? Corporate networks often block this port. Use telnet to check if the port is open. For some reason this is not installed by default any more so you can install it using sudo apt-get install telnet
    • 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

Check if there are any current connections on port 8181 to the IP address from the NS lookup earlier:

  • sudo netstat -natp | grep -i established

Check the services:

  • sudo service myDevices status
  • sudo service webiopi status

You can also use this command to double check that there is a process running for webiopi and myDevices

  • ps axu | grep python

Check your config file:

  • cat /etc/myDevices/Network.ini

Your config file should contain the following:

[CONFIG]
CayenneApi=https://api.mydevices.com
ServerAddress=cloud.mydevices.com
ServerPort=8181

Check the log file for errors:

  • tail -n 50 /var/log/myDevices.log

If your Pi is still showing as offline please create a new topic and post the output from these commands.

5 Likes

This is great! Thanks for posting Adam.

-B

Hello,

I tried this kind of manual, but most probably company I’m working for is blocking port 8181.

Is there some solution connect to you via some VPN ?

Thank you for your quick reply.

If you have a VPN to connect to to get out of your current network it will work, but Cayenne does not provide a VPN. If 8181 is blocked unfortunately you won’t be able to connect.

Awesome and thorough explanation! thanks for your post. I am experiencing a bit of an odd situation with my Cayenne connection. When I am on my home wifi, I am able to connect my arduino uno to cayenne through a serial-USB connection with my Raspberry Pi 3.

I am a teacher in a public school, so when I am on my school’s network I had to assign a static IP, subnet mask, gateway, and DNS server addresses to my Pi using an ethernet connection. My Pi connects to Cayenne, but my Arduino no longer does when connected via Serial-USB. Cayenne oddly recognizes the Arduino for a split second, and then quickly loses the connection. Do you have any thoughts??

The fact that the Pi connects OK on the school network and not the Arduino make me think it could be that port 8442 is closed on that network, as we use that for Arduino but not Pi. I’m not sure if this meshes with the behavior where you see it connect for a split second but it’s worth checking.

See this post for instructions on how you can test to see if port 8442 is open on that network, and let me know if you have any questions.

I entered the prompt telnet arduino.mydevices.com 8442 and it kicked back
the following:

Trying 54.174.252.197…
Connected to arduino.mydevices.com.
Escape character is ‘^]’.

Then a moment later it wrote
Connection closed by foreign host.

Please advise as to what this tells us. Thank you.

That means that the port is open. I’m not sure why it wouldn’t be working.

Is there anything else I should check into?

Could you show us the output from the cayenne-ser.sh script when the Arduino is behind the school network and attempting to connect to Cayenne? This may provide a hint.

Here is the output for the cayenne-ser.sh script:

pi@Regini:~/Downloads/Cayenne-Arduino-Library-master/extras/scripts $ ./cayenne-ser.sh
[ Press Ctrl+C to exit ]
/dev/ttyUSB0 not found.
Select serial port [ /dev/ttyACM0 ]: /dev/ttyACM0
Resetting device /dev/ttyACM0…
Warning: Server connection may be insecure!
Connecting: FILE:/dev/ttyACM0,raw,echo=0,clocal=1,cs8,nonblock=1,b9600 <-> TCP:arduino.mydevices.com:8442,nodelay
2017/05/18 06:03:15 socat[3154] N opening character device “/dev/ttyACM0” for reading and writing
2017/05/18 06:03:15 socat[3154] N opening connection to AF=2 54.174.252.197:8442
2017/05/18 06:03:15 socat[3154] N successfully connected from local address AF=2 172.32.33.26:44462
2017/05/18 06:03:15 socat[3154] N starting data transfer loop with FDs [5,5] and [6,6]
2017/05/18 06:03:15 socat[3154] N socket 2 (fd 6) is at EOF
2017/05/18 06:03:15 socat[3154] N exiting with status 0
Reconnecting in 3s…
Connecting: FILE:/dev/ttyACM0,raw,echo=0,clocal=1,cs8,nonblock=1,b9600 <-> TCP:arduino.mydevices.com:8442,nodelay
2017/05/18 06:03:18 socat[3157] N opening character device “/dev/ttyACM0” for reading and writing
2017/05/18 06:03:18 socat[3157] N opening connection to AF=2 54.174.252.197:8442
2017/05/18 06:03:18 socat[3157] N successfully connected from local address AF=2 172.32.33.26:44560
2017/05/18 06:03:18 socat[3157] N starting data transfer loop with FDs [5,5] and [6,6]

Hey rsiegel,

You had asked for my output from the cayenne-sed.ch script a little over a week ago and I was wondering if it led to any insights as to what the problem may have been. Thanks.

Yikes, I’m sorry, I missed your response.

Unfortunately, I was hoping for something that jumped out at me more than what I see there. I mean I see the single re-connection, but minus the different IPs this looks exactly like my Pi looks on a successful connection via serial USB.

Are you sure if /dev/ttyACM0 is the correct serial port that your Arduino is plugged into on the Pi? If you edit the cayenne-ser.sh script you’ll see there is a place where you can specify the comm port, and I wonder if this could be set to the wrong device. I always make sure it matches the one that my Arduino IDE sees the device on in the Tools>Port menu when it is plugged in.

Though I don’t see any reason to suspect why this would change between your home and school networks, unless you plugged in the Pi to a different USB port when setting things up at school, or have other USB devices plugged into the Pi in one location and not the other.

Thanks for getting back to me. I am sure it is the correct port because it works when connected on my home wifi network. I am really wracking my brain on this.

grep Id /etc/myDevices/AppSettings.ini
ID=
id is empti no id is showing and
nano /etc/myDevices/AppSettings.ini
no such file in the directory
although i install the cayenne through IOS ,through raspberry pi3 cnncted to laptop but dashboard isnt showing up…
whats should i do …
in ios app it stuck and the last step just a momment
and on laptop cnncted to pi3 stuck on the step 4 after pi is rebooted .!!
what should i do
kindly help !!

Hi @ziashahid104 and welcome to the Cayenne Community.

I edited out the part in the first post of this thread calling about the ID entry in /etc/myDevices/AppSettings.ini, as this ID referred to an older system that we used to use that is now deprecated. It is in fact OK that your AppSettings.ini file has a blank ID= line.

Could you share with me the output from telnet cloud.mydevices.com 8181 as well as service myDevices status and service webiopi status, so I can give you the next best troubleshooting steps?

1 Like

rsiegel http://community.mydevices.com/u/rsiegel Technical Product
Manager
July 25

Hi @ziashahid104 http://community.mydevices.com/u/ziashahid104 and
welcome to the Cayenne Community.

I edited out the part in the first post of this thread calling about the
ID entry in /etc/myDevices/AppSettings.ini, as this ID referred to an
older system that we used to use that is now deprecated. It is in fact OK
that your AppSettings.ini file has a blank ID= line.

Could you share with me the output from telnet cloud.mydevices.com 8181
as well as service myDevices status and service webiopi status, so I can
give you the next best troubleshooting steps?

Visit Topic
http://community.mydevices.com/t/troubleshooting-pi-showing-up-as-offline-in-dashboard/720/18
or reply to this email to respond.

In Reply To
ziashahid104 http://community.mydevices.com/u/ziashahid104
July 25
grep Id /etc/myDevices/AppSettings.ini ID= id is empti no id is showing
and nano /etc/myDevices/AppSettings.ini no such file in the directory
although i install the cayenne through IOS ,through raspberry pi3 cnncted
to laptop but dashboard isnt showing up… whats should i do … in ios app it
st…

Visit Topic
http://community.mydevices.com/t/troubleshooting-pi-showing-up-as-offline-in-dashboard/720/18
or reply to this email to respond.

To unsubscribe from these emails, click here
http://community.mydevices.com/email/unsubscribe/22305f3785bba0b7e825e05a6abd17c57a9d246e0c3df9720d7e1a7792515fec
.

sir i have attached the results of the outputs of
telnet cloud.mydevices.com 8181
service myDevices status
service webiopi status

although sir im attaching the ios and andriod screenshots.
in IOS app it stuck at final step.(screenshot attached).
in andriod app after installation it add the device but show this
(screenshot attached).

waiting for the solution !
thankyou

This part looks like it is the explanation. The myDevices service is the core component of our Pi agent, and if it’s not running then it explains why the device wasn’t able to communicate back to Cayenne that the install finished.

As a first troubleshooting step, if you haven’t already, reboot the Pi and see if service myDevices status switches to ‘active’ after the reboot. If it does, your device should be showing online in the Cayenne dashboard now. If it still shows ‘failed’, let’s try a re-install to make sure that the agent install is going OK. We can do it from the web dashboard rather than from the mobile apps, because the commands provided from the web dashboard will offer better output for debug. To do this:

  1. Uninstall what’s currently on the Pi by running:
    sudo /etc/myDevices/uninstall/./uninstall.sh
    then:
    sudo /etc/webiopi/uninstall/./uninstall.sh

  2. Log into the Web Dashboard and add a new Raspberry Pi. On the “Connect your Raspberry Pi” screen, use the 2 commands under ‘Option 2’ instead of the mobile apps. The first command downloads the installer to your Pi, and the second one runs it.

  3. If it stops anywhere during the installation, please share the full output from your command line when running that 2nd command so I can help troublshoot. If it completes installation OK, it will automatically reboot your Pi at the end of installation.

  4. Once the Pi is back up from reboot, check service myDevices status one more time. If the myDevices service is still showing ‘failed’ at this point, then it’s likely some conflict with other software on the Pi, or some OS setting or package. We can look at that next if that is the case.