moroen wrote: ↑Monday 21 September 2020 0:35
AxelvanH wrote: ↑Saturday 19 September 2020 21:02
Please help!
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
I'm still pretty sure that the error is a permission error when the plugin tries to run coapcmd, the error seems to occur at
Code: Select all
result = json.loads(subprocess.run([_coapCMD, "post", "--ident", "Client_identity", "--key", key, uri, payload],
Have you tried to set permission on coapcmd?
Reagards,
M
Hi Moroen,
I deleted the whole TIKEA-Tradfri directory and started over again from scratch reading every line meticulously...
Keeping a log off all the messages in the progress. Now everything (except from chaning to the plugins directory differently) worked fine!
Connection is established and all devices are reported.
My appologies for taking your time, I hope the below will help other users.
Thank you for the great work, answers and patience!
Kr, Axel
On the question, where things went wrong, I guess in the switching between installs.
https://github.com/moroen/IKEA-Tradfri- ... /README.md
Point 1 is easy.
Point 2 can be skipped as explained.
At point 3, I go mistaken by the first paragraph. At the link towards coapcmd, I emidattely clicked that.
But the steps for synology should be:
1. Get Golang envirionment:
Download right version xxx
tar -C /usr/local -xzf go1.15.2.linux-xxxx.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
2. Goto pugins-dir
cd /volume1/@appstore/domoticz/var/plugins
3. Get Coapcmd
plugins/IKEA-Tradfri# git clone
https://github.com/moroen/coapcmd.git
plugins/IKEA-Tradfri# cd coapcmd
4. Execute install
plugins/IKEA-Tradfri# bash install_coapcmd.sh
5. Select coapcmd
/plugins/IKEA-Tradfri# python3 plugin.py api coapcmd
6. Configure coapcmd
plugins/IKEA-Tradfri# python3 plugin.py config 192.168.2.71 Key12345678
step 6 only works with the proper IP address of the gateway, else it will fail with:
{'Result': '', 'Status': 'HandshakeError'}
Connection timed out
7. python3 plugin.py list
Listing all connections.
8. Restarting Domoticz and adding the plugin.