# Issue with Thin-Edge Cumulocity IoT Connection on Raspberry Pi

**URL:** <https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544>\
**Category:** Forum\
**Tags:** thin-edge-io, device-connectivity, cumulocity\
**Created:** [December 22, 2023, 10:36am UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544 "2023-12-22T10:36:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjamin.ruoff](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/benjamin.ruoff/32/12298_2.png) [@benjamin.ruoff](https://community.cumulocity.com/u/benjamin.ruoff)\
**Post date:** [December 22, 2023, 10:36am UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/1 "2023-12-22T10:36:56Z")

</div>

We are currently in the process of connecting our Raspberry Pi to our Cumulocity tenant using the steps outlined in the documentation: Connecting to Cumulocity IoT | Thin-edge documentation.

So far, everything has proceeded smoothly until we reached the command:

`sudo tedge connect c8y`

However, the execution of this command is being canceled, and we are encountering the following error:

```auto
ERROR: Custom { kind: InvalidData, error: InvalidCertificate(NotValidForName) }
Error: failed to connect Cumulocity cloud.

Caused by:
    Connection check failed

```

We have followed the certificate creation process diligently, and it completed without any issues. Despite this, the connection check is failing, and the certificate appears to be the source of the problem.

Do any of you have insights into why we might be facing this issue? We would appreciate any assistance or guidance you can provide to help us resolve this matter.

---

<div class="post-metadata">

**Author:** ![Stefan\_Witschel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/stefan_witschel/32/31955_2.png) [@Stefan\_Witschel](https://community.cumulocity.com/u/Stefan_Witschel)\
**Post date:** [December 22, 2023, 11:06am UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/2 "2023-12-22T11:06:48Z")

</div>

Hi @benjamin.ruoff

did you double check if the certificate has been uploaded to your tenant successfully?  
You can check that in `{{YourTenantURL}}/apps/devicemanagement/index.html#/trusted-certificates`

Which deviceID do you use to create the device certificate?

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [December 22, 2023, 11:47am UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/3 "2023-12-22T11:47:04Z")

</div>

You can also activate more detailed debugging information using the modified connect command:

```sh
RUST_LOG=trace tedge connect c8y

```

The output will be very verbose, but it should help to identify which certificate it is having a problem with (e.g. server certificate or the device’s certificate).

And generally detailing which [thin-edge.io](http://thin-edge.io) version would also be helpful.

---

<div class="post-metadata">

**Author:** ![benjamin.ruoff](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/benjamin.ruoff/32/12298_2.png) [@benjamin.ruoff](https://community.cumulocity.com/u/benjamin.ruoff)\
**Post date:** [December 22, 2023, 11:51am UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/4 "2023-12-22T11:51:58Z")

</div>

Hi Stefan, yeah we checked it over the Cumulocity Web UI and the Certificate was uploaded correctly. The deviceID we gave the device was WL02Berlin

---

<div class="post-metadata">

**Author:** ![benjamin.ruoff](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/benjamin.ruoff/32/12298_2.png) [@benjamin.ruoff](https://community.cumulocity.com/u/benjamin.ruoff)\
**Post date:** [December 22, 2023, 11:57am UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/5 "2023-12-22T11:57:00Z")

</div>

checking that and coming back to you.

and additionally is there anything different we need to do if we have an advanced tenant with a custom domain configured and our own wildcard SSL certificate for the domain? Because we are not making the call directly to [cumulocity.com](http://cumulocity.com) but rather to customertenant.wains.info

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [December 22, 2023, 12:03pm UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/6 "2023-12-22T12:03:39Z")

</div>

Ah yes that is the tip that I needed.

If you’re using a custom domain, then the custom domain is only valid for the HTTP traffic and not MQTT.

Instead of calling `tedge config set c8y.url`, you need to configure two separate configuration items to let [thin-edge.io](http://thin-edge.io) know which endpoints should be used for the HTTP and MQTT communication:

1. Set the `c8y.http` using your custom domain name

2. Set the `c8y.mqtt` endpoint to the “real” Cumulocity IoT Endpoint for your tenant

3. Retry the connect

I’ll also create a ticket to add this instructions to the official doc page.

---

<div class="post-metadata">

**Author:** ![benjamin.ruoff](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/benjamin.ruoff/32/12298_2.png) [@benjamin.ruoff](https://community.cumulocity.com/u/benjamin.ruoff)\
**Post date:** [December 22, 2023, 12:27pm UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/7 "2023-12-22T12:27:39Z")

</div>

Ah nice ok, that makes sense.

So one last questions.

we have a sub-tenant on [cumulocity.com](http://cumulocity.com) would it be

`"sub-tenant-name.cumulocity.com"`

or

`"tenantId.cumulocity.com"`

for the mqtt part?

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [December 22, 2023, 12:42pm UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/8 "2023-12-22T12:42:44Z")

</div>

> [@benjamin.ruoff](#):
>
> “[tenantId.cumulocity.com](http://tenantId.cumulocity.com)”

Yes I think that should be correct.

But checking it should be easy, because you should still be able to open up the underlying Cumulocity IoT url in a web browser to check that it is really reachable, though I haven’t used the custom domain feature too often, so I might be wrong there.

---

<div class="post-metadata">

**Author:** ![benjamin.ruoff](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/benjamin.ruoff/32/12298_2.png) [@benjamin.ruoff](https://community.cumulocity.com/u/benjamin.ruoff)\
**Post date:** [December 22, 2023, 2:29pm UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/9 "2023-12-22T14:29:10Z")

</div>

Hi Reuben,

thank you for your help.

Now it works

Wishing you a Merry Christmas and a Happy New Year!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [June 19, 2024, 2:29pm UTC](https://community.cumulocity.com/t/issue-with-thin-edge-cumulocity-iot-connection-on-raspberry-pi/7544/10 "2024-06-19T14:29:56Z")

</div>

Closed on June 19, 2024, 2:29pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
