AxelvanH wrote: ↑Wednesday 16 September 2020 18:39
moroen wrote: ↑Wednesday 16 September 2020 18:13
AxelvanH wrote: ↑Wednesday 16 September 2020 17:59
HI Moroen,
Thanks for the swift reply.
1. but then you need a working IDENT/KEY pair:
I have all the data, IP and key were left out intentionally
So if, IP and the identity key (bottom of hub) are enough I have those.
2. Are you able to run the coapcmd command manually?
You might be right that the OS can't find the command, should the directory be listed in the PATH?
Which command should I run to check that. just 'coapcmd' does not resonate at least
Thanks,
Axel
You can't use the KEY printed on the bottom of the gateway in the config file. That key is the "master key", and it can only be used to create KEYS for new IDENTS. That'a what the plugin does when issuing the config command, it uses the master key to generate a PSK for a randomly created IDENT and then stores this random IDENT along with the generated PSK in the config file. So in order to manually specify a IDENT/PSK pair in the config file, you need to have a pair that's generated using a working installation...
In order for the plugin to find coapcmd, the coapcmd needs to be placed in a bin subdirectory in the IKEA-Tradfri directory.
Regards,
M
Hi Moroen,
I have coapcmd working (updated my previous post) by adding the path to PATH.
So it now works from anywhere.
I tried the command agian, but the error message stays the same.
Is there anything else I can check?
Thanks,
Axel
Hi Moroen,
I kept on testing and discovered the following, that hopefully helps solving my issue.
When I delete the config.json file in the IKEA-Tradfri directory and run.
(IP and Code are fake, just for testing)
python3 plugin.py config 1.1.1.1 code
Py3coap module not found!
Install with "pip3 install py3coap" or select another api with "python3 plugin.py api"
So I run
python3 plugin.py api coapcmd
Which recreates the config.json file.
But running
python3 plugin.py config 1.1.1.1 code
Traceback (most recent call last):
File "plugin.py", line 177, in <module>
create_ident(args.IP, args.KEY, CONFIGFILE)
File "/volume1/@appstore/domoticz/var/plugins/IKEA-Tradfri/tradfricoap/coapcmd_api.py", line 81, in create_ident
result = json.loads(subprocess.run([_coapCMD, "post", "--ident", "Client_identity", "--key", key, uri, payload], stdout=subprocess.PIPE).stdout.decode('utf-8'))
File "/volume1/@appstore/py3k/usr/local/lib/python3.5/subprocess.py", line 696, in run
with Popen(*popenargs, **kwargs) as process:
File "/volume1/@appstore/py3k/usr/local/lib/python3.5/subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "/volume1/@appstore/py3k/usr/local/lib/python3.5/subprocess.py", line 1544, in _execute_child
raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied
Again gives still the same error. chmod 777 on config.json did not make any difference.
My config.json file:
vi config.json
{"Gateway": null, "Identity": null, "Api": "Coapcmd", "Transition_time": 10, "Passkey": null, "Verbosity": 0}
Any suggestion is welcome on how to proceed.
Thanks,
Axel