# How to Configure and Connect to Cumulocity IoT in Rasbery Pi?

**URL:** <https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [July 4, 2023, 4:52am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528 "2023-07-04T04:52:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aatif.jariwala](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@aatif.jariwala](https://community.cumulocity.com/u/aatif.jariwala)\
**Post date:** [July 4, 2023, 4:52am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/1 "2023-07-04T04:52:33Z")

</div>

#### _ **Product/components** used and **version/fix** level:_

Cumulocity IoT

#### _Detailed explanation of the problem:_

I have tried to connect the Cumulocity IoT account to the raspberry pi using the c8y command using thing-edge io in step 2

but this step displays the error and can not connect Cumulocity account

#### _Error messages / **full error** message screenshot / **log** file:_

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/e/7/e7cb57e0256846c293ae8a3f2e5c752d48d91c87.png)

#### _Question related to a **free trial** , or to a **production (customer)** instance?_

free trial  
my tenant id:- aatif312

---

<div class="post-metadata">

**Author:** ![Yishu\_Zhong](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/yishu_zhong/32/31128_2.png) [@Yishu\_Zhong](https://community.cumulocity.com/u/Yishu_Zhong)\
**Post date:** [July 4, 2023, 6:05am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/2 "2023-07-04T06:05:08Z")

</div>

Hi Aatif, to upload the certificate, you need to give your username not the tenant id in the command. Please try again with your username.

---

<div class="post-metadata">

**Author:** ![aatif.jariwala](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@aatif.jariwala](https://community.cumulocity.com/u/aatif.jariwala)\
**Post date:** [July 4, 2023, 6:42am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/3 "2023-07-04T06:42:50Z")

</div>

Hi Yishu Zhong,I also try the username but gives the same error

---

<div class="post-metadata">

**Author:** ![Yishu\_Zhong](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/yishu_zhong/32/31128_2.png) [@Yishu\_Zhong](https://community.cumulocity.com/u/Yishu_Zhong)\
**Post date:** [July 4, 2023, 7:11am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/4 "2023-07-04T07:11:14Z")

</div>

Hi Aatif, error 401 means [credentials are invalid](https://cumulocity.com/api/core/10.16.0/#operation/getCurrentTenantResource). Please make sure the combination of user and password is correct. The second password you enter should be the password of your Cumulocity account. You can also use `tedge config list` command to check if the URL and other settings are correct.

---

<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:** [July 4, 2023, 7:49am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/5 "2023-07-04T07:49:08Z")

</div>

Are you using a single sign on user, as I believe this is the default for trial tenants (though I’m not 100% sure about this). If so you can create another user in your tenant which has the “Tenant Management” permissions to use for the certificate uploads.

Alternatively you can always manually upload the device public certificate in the Cumulocity IoT Device Management UI.

1. On the device, display the certificate on the console (if you get permission denied, then run the command again using `sudo`)

2. Copy the printed certificate text (including the `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----` lines) and save it to a file on your local machine (e.g. `device-001-certificate.pem`)

3. Open a browser and navigate to your Tenant, and open the **Device Management** UI application

4. Navigate to `Management` \> `Trusted Certificates`

5. Click `Add trusted certificate` (in the top right corner). Activate `auto registration` and `Enable` options. (Note: the certificate name does not matter too much, but using a descriptive name is always helpful for your future self). Upload the certificate file you saved locally in step 2.

6. On the device, you can speed up the reconnection attempt by reconnecting

---

<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:** [July 4, 2023, 7:50am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/6 "2023-07-04T07:50:31Z")

</div>

**Note** Your Cumulocity IoT user must have the `Tenant Manager` role (and adding this will require you to log out and log in again in the UI)

---

<div class="post-metadata">

**Author:** ![Robert\_Neale](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/robert_neale/32/31965_2.png) [@Robert\_Neale](https://community.cumulocity.com/u/Robert_Neale)\
**Post date:** [July 4, 2023, 8:11am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/7 "2023-07-04T08:11:40Z")

</div>

I checked - there is no tenant [https://aatif312.cumulocity.com/](https://aatif312.cumulocity.com/).  
That’s why you get the 401.  
Why do you think this is the tenant url?

---

<div class="post-metadata">

**Author:** ![aatif.jariwala](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@aatif.jariwala](https://community.cumulocity.com/u/aatif.jariwala)\
**Post date:** [July 4, 2023, 9:13am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/8 "2023-07-04T09:13:10Z")

</div>

So how can I get my tenant Role in Cumulocity Iot Account?

---

<div class="post-metadata">

**Author:** ![Robert\_Neale](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/robert_neale/32/31965_2.png) [@Robert\_Neale](https://community.cumulocity.com/u/Robert_Neale)\
**Post date:** [July 4, 2023, 9:24am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/9 "2023-07-04T09:24:31Z")

</div>

Have you got a tenant?

---

<div class="post-metadata">

**Author:** ![aatif.jariwala](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@aatif.jariwala](https://community.cumulocity.com/u/aatif.jariwala)\
**Post date:** [July 4, 2023, 9:27am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/10 "2023-07-04T09:27:58Z")

</div>

Yes I have created one tenant from the administration account

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/8/e/8e53c2fbdafa957c8d67e406d580c78eee786116.png)

---

<div class="post-metadata">

**Author:** ![Robert\_Neale](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/robert_neale/32/31965_2.png) [@Robert\_Neale](https://community.cumulocity.com/u/Robert_Neale)\
**Post date:** [July 4, 2023, 10:31am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/11 "2023-07-04T10:31:23Z")

</div>

What you are showing me there is a user account, with Tenant manager permissions. What is the tenant in which you are doing this? What is the url in the address bar at the top of the screen?

---

<div class="post-metadata">

**Author:** ![aatif.jariwala](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@aatif.jariwala](https://community.cumulocity.com/u/aatif.jariwala)\
**Post date:** [July 4, 2023, 10:33am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/12 "2023-07-04T10:33:38Z")

</div>

this is my URL

[https://aatif312.eu-latest.cumulocity.com/apps/administration/index.html](https://aatif312.eu-latest.cumulocity.com/apps/administration/index.html)

---

<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:** [July 4, 2023, 10:39am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/13 "2023-07-04T10:39:06Z")

</div>

In your case the `c8y.url` should be

```auto
aatif312.eu-latest.cumulocity.com

```

You were incorrectly using `aatif312.cumulocity.com` before.

---

<div class="post-metadata">

**Author:** ![Robert\_Neale](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/robert_neale/32/31965_2.png) [@Robert\_Neale](https://community.cumulocity.com/u/Robert_Neale)\
**Post date:** [July 4, 2023, 10:45am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/14 "2023-07-04T10:45:05Z")

</div>

[https://aatif312.eu-latest.cumulocity.com/apps/administration/index.html](https://aatif312.eu-latest.cumulocity.com/apps/administration/index.html)

Your output early on in this thread shows [cumulocity.com](http://cumulocity.com), not eu-latest.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/d/7/d7164131b8d6e3e9381a793a1718ce5c3962cbe2.png)

---

<div class="post-metadata">

**Author:** ![aatif.jariwala](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@aatif.jariwala](https://community.cumulocity.com/u/aatif.jariwala)\
**Post date:** [July 4, 2023, 11:01am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/15 "2023-07-04T11:01:46Z")

</div>

Same Error ☹  
What am I doing wrong?

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/b/7/b7ab2ed489eb50ab94621ca8282c808d8abcd31b.png)

---

<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:** [July 4, 2023, 11:38am UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/16 "2023-07-04T11:38:47Z")

</div>

The user aatif312 does not exist. Instead you should a user name that is provided in your user management view you’ve posted above (and have the Tenant Manager role).  
I think you have common misunderstanding about tenants and user… What you’ve created is a user in a specific tenant.

---

<div class="post-metadata">

**Author:** ![aatif.jariwala](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@aatif.jariwala](https://community.cumulocity.com/u/aatif.jariwala)\
**Post date:** [July 4, 2023, 12:14pm UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/17 "2023-07-04T12:14:46Z")

</div>

Sorry but I can’t understand what you say about the tenant, could you brief detail about this?

What did I do wrong?

---

<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:** [July 4, 2023, 12:33pm UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/18 "2023-07-04T12:33:51Z")

</div>

What you think is a “user” is actually a tenant.  
When you do this:  
`tedge cert upload c8y --user "aatif312"`there is no user “aatif312” in your tenant “aatif312” but users systemuser, aatif\_jariwala2 … etc.

---

<div class="post-metadata">

**Author:** ![aatif.jariwala](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@aatif.jariwala](https://community.cumulocity.com/u/aatif.jariwala)\
**Post date:** [July 4, 2023, 12:46pm UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/19 "2023-07-04T12:46:50Z")

</div>

So  
How can I log in to the aatif\_jariwala2 account in Cumulocity?

If I log in to this tenant Where to get the tenant environment for login purposes?

---

<div class="post-metadata">

**Author:** ![Robert\_Neale](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/robert_neale/32/31965_2.png) [@Robert\_Neale](https://community.cumulocity.com/u/Robert_Neale)\
**Post date:** [July 4, 2023, 1:57pm UTC](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528/20 "2023-07-04T13:57:08Z")

</div>

The tenant is [aatif312.eu-latest.cumulocity.com](http://aatif312.eu-latest.cumulocity.com).

On that tenant there are four user accounts one of which is ‘aatif\_jariwala’.

It is this account you should specify as --user in the tedge command, and when prompted type the password for it.

[Next page](https://community.cumulocity.com/t/how-to-configure-and-connect-to-cumulocity-iot-in-rasbery-pi/1528.md?page=2)
