• @Gordon, great idea... and the IP can be put into a module to externalize the same way as the network credentials - SSID and password - as mentioned in this (and another) post.

    You place the module code

    /* credsXYZ.js */
    exports = { id: "XYZ", ssid: "...", pw: "...", ip: "..." };
    

    as credsXYZ.js into your project's sandbox .../modules folder and pull it into your code and use it this way:

    var creds = require("credsXYZ");
    // ...
    ... .connect(creds.ssid,creds.pwd,...
    //  
    ... .get(creds.ip,...
    

    The creds object can be complemented with other information you need, but at some point you will just create another object of less data privacy and call it cfg and store and use it the same way as the creds object.

    Giving the module a suffix (and id to the object) - such as XYZ - you can have multiples and load the code to the different devices with respective credentials and configuration.

    2cts about code modularity / reuse / 'hiding'.

About

Avatar for allObjects @allObjects started