Nymea-cli doesn't work

Hi,

I am new to here, and I have installed the latest version of nymea image for my raspberry pi. I follow the instructions in this video: video link

when I try to use nymea-cli (3:14 in video), it report some wrong. Here is the command I use and the error message.

zerorlis@zerorlis-X550JK:~$ ssh nymea@nymea.local
Linux nymea 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l
  _ __  _   _ _ __ ___   ___  __ _
 | '_ \| | | | '_ ` _ \ / _ \/ _` |
 | | | | |_| | | | | | |  __/ (_| |
 |_| |_|\__, |_| |_| |_|\___|\__,_|
         __/ |
        |___/

Last login: Sun Dec 29 10:04:01 2019 from 192.168.120.121
nymea@nymea:~ $ nymea-cli


##############################################
# Handshake:
##############################################


Traceback (most recent call last):
 File "/usr/bin/nymea-cli", line 49, in <module>
   if not nymea.init_connection(args.host, args.port):
 File "/usr/lib/python2.7/dist-packages/nymea/nymea.py", line 61, in init_connection
   handshakeMessage = send_command("JSONRPC.Hello", params)        
 File "/usr/lib/python2.7/dist-packages/nymea/nymea.py", line 218, in send_command
   data = tn.read_until("}\n")
 File "/usr/lib/python2.7/telnetlib.py", line 294, in read_until
   return self._read_until_with_poll(match, timeout)
 File "/usr/lib/python2.7/telnetlib.py", line 343, in _read_until_with_poll
   return self.read_very_lazy()
 File "/usr/lib/python2.7/telnetlib.py", line 455, in read_very_lazy
   raise EOFError, 'telnet connection closed'
EOFError: telnet connection closed

please help me, thanks

Hi Zerorlis, welcome to nymea!

The cli hasn’t received the amount of love it deserves and is a bit outdated since nymea:app is available on all platforms and is feature complete. It’s on our todo list to update the cli again. If it’s just about controlling/configuring nymea I’d recommend to use nymea:app for now. Is there a reason why you need a command line interface instead of a ui app?

I’ll see if I can find some time to make it work again soon. We’re planning to work on a documentation clean up / update in January. Fixing the cli would probably fit into that work package. Thanks for bringing this up.

I just tried it and it seems to still work if nymea:core is configured to not use SSL. So, you can either use nymea:app to disable SSL (System Settings -> API interfaces) or edit nymead.conf and set sslEnabled to false for the port you want.

I’ve added ssl support to nymea-cli. For now it is available in the branch ssl-support on github. It should start working with the next update.

yes, it works! thanks, it help me a lot , and i have tried to use nymea:app now.

I try to use nymea to control my Pi’s GPIO, and i follow the video’s steps. Maybe the video is outdated.

Unfortunately, now I meet new difficulty, I can’t find the GPIO in device list (3:37 in video). Should i install GPIO plugin for it ? I will take some time to reseach how to install and write plugin.

At last, thanks for your help

You can install plugins through the app too. Go to system settings, then system updates, at the bottom you’ll find “install or remove software” and in there you’ll find the gpio plugin. At this point you’ll need to restart nymea to activate the new plugin after installing it (in the near future we’ll support loading new plugins at runtime too).