I’ve been doing some experiments with remote device viewing/management taking inspiration from the mDash smart light example here: GitHub - cesanta/mongoose-os-smart-light: An example of full IOT product based on Mongoose OS
Understand it hasn’t had any changes in a few years, so very likely it’s not a working example anymore - I’ve also seen a few people on the forum not been able to get it to work so if it’s deprecated it would be great to know. If there was a better/newer example that would also be great.
On to my questions:
Firmware endpoints - SOLVED
The code example app seems to reference a couple of device endpoints:
- http://192.168.4.1/GetKey
- http://192.168.4.1/Setup
But the firmware source code seems to have no references to this. I thought maybe it was somehow a built-in endpoint or something but none of my devices are responding by default on either /GetKey or /Setup.
I could probably write it, but I’m unsure what the /GetKey endpoint is returning, since when I’ve tried to add a device to a customer in mDash UI the public key doesn’t seem to work.
Looks like the mDash Arduino library has these two endpoints built in
Device ID - SOLVED
There seem to be a couple of device_id that I think is getting me turned around.
1. first is the mDash has a device ID it creates when a new device is added to mDash, and they follow a sequential number as devices are provisioned in mDash
2. the device configuration has a device_id that seems to have no association with the mDash device id, I’ve been setting these to something unique
From what I can tell by manually adding devices to a customer, mDash is expecting the device ID as per the mDash provisioning process (2), but I don’t understand how that would ever end up on the device. Having been through the device config and built in RPC commands I don’t see it anywhere.
This question seems to be irrelevant - it appears that when using the mDash UI the device_ID required is the one that is auto-generated when enrolling a device. This is not the same process followed by the app.
The app directly updates a customers metadata to include the device public key, which is captured from the physical device using the endpoints described above.
The endpoint used to update the customer metadata described in the mDash doco:
POST https://mdash.net/customer {"cconfig": ...} Update customer's metadata
Customer registration / password management - SOLVED
Looking at the mDash UI I see no way to delete a customer, or change their password. I’m guessing that is part of the POST request made to https://mdash.net/customer but details are light in the doco
Hopefully someone has messed around with this with some success, looks like a nice and easy way for remote device management.
Delete can be done via the Management REST API
Password change flow is same as registration - customer needs to click link in email to activate the new password