[INSTALLATION] myDevices

Hi,

I’m trying to install myDevices agent, but no way I can get it to work.

I’ve tried installing through my Android device, then I also tried with the script installation (rpi_dam7lfusiz.sh).

Both methods conclude their installation, but I can’t see the Device on my Dashboard.

I’ve included a print screen of the end of the script installation and I’ve also included the log file from the Raspberry in /var/log/myDevicesSetup

My OS release info from /etc/os-release:

PRETTY_NAME=“Raspbian GNU/Linux 8 (jessie)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“8”
VERSION=“8 (jessie)”
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/
SUPPORT_URL=“RaspbianForums - Raspbian
BUG_REPORT_URL=“RaspbianBugs - Raspbian

myDevicesSetup.txt (8.2 KB)

Could anyone help me with that?

Hello @bruno.debrida and welcome to the Cayenne Community. I’d be happy to help.

Since it looks from the log like the install really did go OK, I suspect this could be because port 8181 might be closed on your network, and this port is required for our Pi agent software to connect to our cloud server. If it can’t make this connection, then it may not be able to tell the server the install was OK and start transmitting data to Cayenne.

You can use telnet to check if the port is open. 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

Hi, @rsiegel,

That might be the cause, but still I can't see myDevices agent running

with ps aux. What should I look for?

Telnet will only work on this port if I have this agent running and

listening to 8181, right?

Also, I can't even find my Pi in my local network with Cayenne app. I

can ping my Pi, but it seems there’s no agent running so that the app can
find it in the local network.

An easy way to check if the Cayenne Pi agent is running at all is to run the command:

tail -f /var/log/myDevices.log which will follow our agent’s log and should produce some output at least once a minute, no matter whether the device is properly communicating with our server or not, it will produce messaging either way.

That telnet test to check if port 8181 is open will work on any Linux device with the telnet software installed, it doesn’t require our agent software. It’s just an easy way to check if the port is open or not based on the response from the telnet command. Saves us the trouble of having to guess at where to check that on each user’s unique network setup. :slight_smile:

I’d leave the Android app out of this until we can get your devices showing on your web dashboard. Mostly because it has limited ability to display error messaging if something has gone wrong. Once we have the cloud agent transmitting to our server and can see the device on the web, it should appear in your Android app as well.

@rsiegel

I've attached the results from the commands you asked me to run.
  1. I could successfully connect through telnet at the address you gave me

  2. There’s no log file in that path you mentioned. I supposed that
    myDevices agent is no running

Here it is the file.

It seems to be running but it is not generating log.

Hi,

I got it to work! It was a symbolic link which was pointing to

python3.4, not to python3.6. I change it and the agent started to run. It
is also showing in my Cloud Dashboard and on the app.

I only have one more question: I went through the log file and I found

an error:

2017-04-18 00:08:48 - myDevices - ERROR - Initialize error:
/etc/myDevices/libs/libDiscovery.so: cannot open shared object file: No
such file or directory
Traceback (most recent call last):
File
“/usr/local/lib/python3.6/site-packages/myDevices-0.1.20822-py3.6.egg/myDevices/cloud/client.py”,
line 390, in Initialize
self.libDiscovery = CDLL(“/etc/myDevices/libs/libDiscovery.so”)
File “/usr/local/lib/python3.6/ctypes/init.py”, line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: /etc/myDevices/libs/libDiscovery.so: cannot open shared object
file: No such file or directory

  • Is this ok or not? How can I solve it?*
Thanks!
2 Likes

That is great that you found the issue with the agent not running. I think typically we install against Python 3.4 as this is the latest that’s in a default install of Raspbian. I’ll do some additional test to make sure we can properly handle 3.6 so we’re ready when they choose to update to this.

As for the log message about libDiscovery.so you can ignore this. It’s a component of the agent that we are no longer working on that it can’t find, and in fact with today’s update (coming in the next few hours…) the agent will no longer check for it and output this error message all over your log. It’s in everyone’s logs at the moment so nothing to worry about here.

OK, thanks!

Sorry to disturb you again but I still have 3 more questions:
  1. My Raspberry CPU keeps 90 to 100% of CPU processing because of myDevices
    agent. Is this common? I can send you a picture of “ps aux | grep myDevices
    output”.

  2. Is it possible to create a network trigger? If so, how can I do it?

  3. I can’t connect remotely on my raspberry through myDevices panel. I have
    VNC running on the raspberry. Is there any conflict with it or should I
    make any additional configuration?

    Thank you.

Obrigado.

Obrigado.

No worries, I’m happy to help.

  1. That is not typical, generally I would expect only about 5%-15% CPU usage from our Raspberry Pi agent software, depending on the model of Pi, and assuming no other major software running at the same time alongside it. We did just push an updated Pi Agent yesterday specifically to address some resource consumption issues, could you tell me if this behavior has persisted into today?

You can check if you have the latest agent, 1.0.0.20838, by running the command cat /etc/myDevices/AppSettings.ini

Another option if you find the resource consumption of the Pi Agent to be too heavy is to connect the Pi via the MQTT API. Then the only activity is publishing and receiving MQTT messages, and there isn’t all the background work of monitoring your running processes/CPU/RAM/etc etc

  1. I’m not sure I understand exactly what you mean here, let me know a bit more and I can give a better answer. If you mean basing a trigger off of the Pi ‘Network Speed’ widget, not at this time. You can make triggers based on device Online/Offline status, however.

  2. You shouldn’t have to make any additional configuration - Cayenne uses RealVNC to establish a connection and should only require that VNC is set to ‘enabled’ in raspi-config. Perhaps you could run that tail -f /var/log/myDevices.log command again while attempting the remote connection and see what if any error messaging you get.

Does it use RealVNC?

Not TightVNC?

Obrigado.

It’s a bit more complicated than I originally described – I have a better handle on it now that I’ve looked deeper. Hopefully this will allow you to get it running for yourself.

  • If neither TightVNC or RealVNC is on the Pi at install time, we’ll install TightVNC during the Cayenne Agent install

  • If TightVNC is already installed on the Pi, we’ll attempt to use that.

  • If RealVNC is already installed on the Pi, we’ll attempt to use that. Raspbian with PIXEL should have RealVNC pre-installed.

The user experience is much better in my experience with RealVNC. The Remote Access runs on the same user session as a connected desktop, so you can see any work/desktop shortcuts/customization that you have done on the physical Pi when viewing through this mode. In addition, the in-browser session resizes to fill your whole browser, rather than TightVNC which produces a fixed-size view. Plus it just seems more responsive to me. :slight_smile:

If you’re not sure if you have RealVNC installed, or want to update to it to get this better experience, just follow the steps on this page until you reach “Connecting to your Raspberry Pi with VNC Viewer”. At that point RealVNC should be set up and Cayenne’s Remote Access feature should be able to function with it.

Weird. I have Raspbian Jessie 8 with RealVNC enabled. Everytime I
enable RealVNC, myDevices agent uninstalls RealVNC and installs TightVNC.

Obrigado.

Actually, I think you’re on to something here, perhaps a bug. I just lost my RealVNC install on the machine where I was testing when I wrote the previous post. It doesn’t seem to happen immediately, but after a few minutes, and definitely after a reboot.

Yes, right. That’s exactly how it happens.

Got it.

I have what I think should be a pretty painless workaround for you. But there is one caveat: Until we push out a Pi agent update with the actual fix for this issue, if we update the Pi agent in some other way, this could get undone and you’ll have to re-do it. I don’t anticipate that would happen more than once or twice before we code up a fix and push that.

To work around the problem, first re-install RealVNC one more time:

sudo apt-get update
sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer

Next, rename the script that is causing RealVNC to get overwritten to something else, so it can’t be called anymore:

cd /etc/myDevices/scripts/
sudo mv tightvncsetup.sh renamed.sh

Optionally, but just to check that this worked, reboot the Pi:

sudo reboot now

then finally check that RealVNC is still installed:

sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer

should return:

realvnc-vnc-server is already the newest version.
realvnc-vnc-viewer is already the newest version.

Yes, it worked. Thanks.

Obrigado.
2 Likes