How to assign token from mDash to mOS without used mos tool

Hi

I have 50 devices to manage. I see from Quickstart example we need to copy device Token from mDash to setup via mos tool.

To prevent user error or device config saving problem it’s better way to manage everything on mDash?
For example
We used serial number or something unique on device if-self to authen to mDash

Is anyone know I also try to Enterprise License but it don’t help.

Maybe you can be more specific about what you want to do.

  • are you trying to provision a device remotely that does not exist on mDash?
  • are you trying to provision a device that already exists on mDash?
  • is your device already connected to the internet?
  • is your device already deployed in the field?

Very basic answer is to push a conf(*).json file to your device with the mDash keys required, which can be done a few different ways.

If I’m not mistaken all the mos tool does it push the keys to your device that you give it.

You can remotely register a new device using these endpoints and then push the keys to your device either with the mos tool or by pushing a conf(*).json file to your device with the info

Thanks you @klimbot for your reply

The goal of this is

  • I want to used mdash as OTA tools and remote debug via RPC
  • When Customer claim back the device I not need to manage to token&device that already register unless I want to remove them from mdash.

What am see in the example QuickStart is
I need to do mos config-set dash.enable=true dash.token=TOKEN to register device with mdash. But if I flash firmware update into the device again I need to used mos tool to apply the token again. It might be alot of human error to do this because I have alot of device.

So what I need is …

  • when I already register device with mdash success. But when I have to re-flash firmware it it have to online by it self
  • I can’t fix mdash token inside mos.yml for every device because it alot of it. I need to have only 1 app 1 config to manage.
  • Can I change/Override Device name on mDash from mOS I want it to replace with my device ID automatically now I have to manual copy into Label on mDash 1 by 1

thanks you very much for your help.

Yes this is not an easy problem to solve. Unfortunately I’ve not seen a way to configure a device without some custom per-device config.

In my opinion the best way to do this is to create a custom conf.json file (say conf2.json) file for every single device on your network.
This way you can have a single firmware and then just upload a specific conf2.json file to your device with the dash.token and dash.enable.

EG:

{
    "dash": {
        "enable": true,
        "token": "specific_device_mdash_token"
    }
}

From this point on flashing your device with mos flash will remove the conf2.json file, so from this point on the best thing to do is to flash with OTA update which will preserve the conf.json file

I asked a similar question a little while back here

Thanks you

So can we change/override Device ID on mdash with Device ID from mOS?

I think maybe you are confused with the sequential number assigned to a device in mDash and the device.id assigned to a device itself. They are different

From what I know you can’t change the “Device ID” in mDash not can you change your physical device id.

53

Because saw some sample like in the attachment file it has a difference name of Device ID (d1,d2)
But what for my console is device1,device2 etc…

Reason I need to change Device ID on mDash is

  • when I search them mdash by ESP32 Device ID it will be alot more easy to find.
  • it prevent human error to put the wrong id on mdash.

Now what I did is…I need to manual put ESP32 Device ID on the Label Column

PS. I used device MAC address as my Local Device ID in mos.yml

@klimbot The link you posted is obsolete. The current documentation for the management REST API is here.