Ztc aws add-things failing


#1

Hi,

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
cli()
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
thing.create_with_keys_and_certificate()
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?

Cheers,
Steven.


#2

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?