Ztc aws add-things failing



I’m attempting to use the ztc command to generate my thing certificates in aws. But so far no luck.

ztc aws add-things ./mything --thing-base-name ESP32Zerynth --things-number 1

Throws the long error:

[info]> Creating thing ESP32Zerynth_0
Traceback (most recent call last):
File “/Users/steven/.zerynth2/dist/r2.1.2/ztc/ztc.py”, line 112, in
File “/Users/steven/.zerynth2/sys/python/lib/python3.5/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/Users/steven/.zerynth2/sys/python/lib/python3.5/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/Users/steven/.zerynth2/sys/python/lib/python3.5/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/steven/.zerynth2/sys/python/lib/python3.5/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/steven/.zerynth2/sys/python/lib/python3.5/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Users/steven/.zerynth2/sys/python/lib/python3.5/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/Users/steven/.zerynth2/dist/r2.1.2/ztc/aws/awscmd.py”, line 189, in __add_things
File “/Users/steven/.zerynth2/dist/r2.1.2/ztc/aws/awsthing.py”, line 23, in create_with_keys_and_certificate
data = self._awscli.create_keys_and_certificate()
File “/Users/steven/.zerynth2/dist/r2.1.2/ztc/aws/awscli.py”, line 22, in create_keys_and_certificate
return json.loads(out)
File “/Users/steven/.zerynth2/sys/python/lib/python3.5/json/init.py”, line 319, in loads
return _default_decoder.decode(s)
File “/Users/steven/.zerynth2/sys/python/lib/python3.5/json/decoder.py”, line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/Users/steven/.zerynth2/sys/python/lib/python3.5/json/decoder.py”, line 357, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)

Looks like there is just nothing coming back from AWS.

Any ideas?



Hi Steven,

have you correctly configured aws cli? Can you check if you are able to create a certificate through the cli (aws iot create-keys-and-certificate) and messages to the user are output in json format?


I am having the same problem and trying to debug. Are you running Anaconda by chance? I am thinking this is a path problem - but not sure …


Hi @ktomes,

have you tried to run aws iot create-keys-and-certificate and check if the output is in json format?
If not, you should set aws iot output format to JSON.

A preliminary passage for ztc aws commands to correctly work is to have the Amazon Web Services CLI correctly installed on your system.

Let me know :slight_smile:


That was it! I used aws configure to set the output to json.
Thanks! Keith