mender -portal i am creating a virtual device quemx - i have done these steps
Connecting a device
- Get Docker Engine
If you do not have it already, please install Docker on your local machine.
- Copy & paste and run the following command to start the virtual device:
TENANT_TOKEN=‘’
docker run -it -p 85:85 -e SERVER_URL=‘https://hosted.mender.io’
-e TENANT_TOKEN=$TENANT_TOKEN --pull=always mendersoftware/mender-client-qemu
after perfoming the steps on the ubuntu machine(VM) the device can be seen as pending state and then later I was able to accept the device and see - device related info such as inventory, configurations etc.
![Picture1](https://global.discourse-cdn.com/standard10/uploads/mender/original/2X/a/a470cf78bba8d838c3a62fc08cd89488758af59a.png)
and was also able to perfom deployment(using mender - artifact).
![Picture2](https://global.discourse-cdn.com/standard10/uploads/mender/original/2X/5/575d3ccd064d0a3216273544e0f3f347cc73aa92.png)
Now the same process if am trying to create a device using API,
and I am using the preaut api POST - -https://hosted.mender.io/api/management/v2/devauth/devices headers (Authorization", "Bearer " + JWT)
and after this I am able to see the device in the preauthorized state in mender portal. but in config I can see this in configurations tab.
![Picture3](https://global.discourse-cdn.com/standard10/uploads/mender/original/2X/d/d12d16184ff179b74182f34e2396b7ee8bc6e529.png)
and then I used Authenticate Device API POST - https://hosted.mender.io/api/devices/v1/authentication/auth_requests
and passing {
“id_data”:“{"DeviceId":"edgedevice9"}”,
“pubkey”: “”,
“tenant_token” : “”
}
I can see the device in accepted state, but cannot find inventory and other details.
![Picture4](https://global.discourse-cdn.com/standard10/uploads/mender/original/2X/8/8ba24a22856cf73f18f8d21a05fa8c88377916a3.png)
Am I missing any configuration setting, should I call a different api along with preauth or authorization.
And we are using Linux ubuntu 22.04,
requesting your inputs on this.
Hi @sahithi,
Just as pointed out in the other thread at Preauth state to accepted state - #4 by TheYoctoJester, the device has to send the inventory. It’s not a management API call or such, but it is the device that needs to send out the data. If it doesn’t show up in a reasonable amount in time, then check the logs of the client device. Also as mentioned, you can also use the mender-update send-inventory
command to trigger the update.
Greets,
Josef
Hi @TheYoctoJester
I have an IoTedge device created in Azure IoTHub Portal. And want the same device to use in mender server.So i have used preauth api to send the device to Mender server.
POST - https://hosted.mender.io/api/management/v2/devauth/devices headers (Authorization", "Bearer " + JWT)
body {“pubkey”: “”, “identity_key”:{“deviceId”: “edgedevice9”}}
and after this I am able to see the device in the preauthorized state in mender portal. but in config I can see this in configurations tab.
![Picture3](https://global.discourse-cdn.com/standard10/uploads/mender/original/2X/d/d12d16184ff179b74182f34e2396b7ee8bc6e529.png)
and then I used Authenticate Device API POST - https://hosted.mender.io/api/devices/v1/authentication/auth_requests
and passing {
“id_data”:“{“DeviceId”:“edgedevice9”}”,
“pubkey”: “”,
“tenant_token” : “”
}
![Picture4](https://global.discourse-cdn.com/standard10/uploads/mender/original/2X/8/8ba24a22856cf73f18f8d21a05fa8c88377916a3.png)
can you guide us on the device cretaed in Azure IoTHub should it be configured or for such devices what additional things we have to do.
requesting your inputs on this
Hi @sahithi,
I understand your process, but that still does not change what I explained above. Maybe the problem is that Azure and Mender both use the word “inventory”, but mean different things? I cannot comment on the Azure side as I have never used it, but for Mender, it is like that:
The inventory is a collection of key-value pairs that reflects information on the client device, as described here: Inventory | Mender documentation. The information is gathered through a customisable set of scripts, and uploaded to the Mender server cyclically through the Mender client, following the configured polling interval. It has no connection to other device registries.
Hence I am sorry, but I fail to understand the problem. You have devices that you pre-authenticate, and then you have them automatically accepted. So far, so good. You say that you use the API for the accepting step, which is a bit strange: then you have an accepted device, but still no client that you can actually use. Technically you could also use the device API to upload inventory data instead of “just” running the client (see Mender API docs), but I wonder what the goal is. You end up with an accepted device that has no client running, and without a client there’s no real functionality.
Greets,
Josef