Using node-red to extract conduit serial number or UUID

Home Forums Conduit: AEP Model Using node-red to extract conduit serial number or UUID

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11458
    Chad Goyette
    Participant

    Is there a way to extract either the conduits serial number or the UUID using node-red so that a conduit can self register to a cloud service with a unique ID?

    #11461
    Jeff Hatch
    Keymaster

    Chad,

    There is a cli command that returns the uuid:

    mts-io-sysfs show uuid

    and the serial number:

    mts-io-sysfs show device-id

    On the other hand you can do a REST’ful GET request using the http request node for both these values from the configuration database locally:

    admin@mtcdt:/sbin# curl -m 5 -s 127.0.0.1/api/system/uuid
    {
    “code” : 200,
    “result” : “ABCDEF0123456789ABCDEF0123456789”,
    “status” : “success”
    }

    admin@mtcdt:/sbin# curl -m 5 -s 127.0.0.1/api/system/deviceId
    {
    “code” : 200,
    “result” : “18114615”,
    “status” : “success”
    }

    Jeff

    #11462
    Brandon Bayer
    Blocked

    Chad,

    Probably the easiest way in Node-RED is to use the http request node. Do a GET to 127.0.0.1/api/system/uuid and return a parsed JSON object. Send the output to a function node where you can extract the UUID from msg.payload.result. To test this, you can put an inject in front of the http request node, set the Payload to blank, and then use it to trigger the http request.

    -Brandon

    #11463
    Chad Goyette
    Participant

    Thank you this works perfect.

    #11465
    Chad Goyette
    Participant

    Is there documentation that explains this? for instance if i want to get the node ID or some other information from the conduit.

    #11466
    Jeff Hatch
    Keymaster

    Right now there is nothing official. We are hoping to develop some documentation going into detail on the API to the configuration database on the Conduit, but it is currently not being worked on.

    Asking questions here is probably your best bet for now. The configuration database is in /var/config/db.json on the Conduit. Pretty much all of the data in that file can be accessed by making GET requests to 127.0.0.1/api and then following the pattern of the JSON object being retrieved in that file.

    Jeff

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.