logo elektroda
logo elektroda
X
logo elektroda

How to Track and Assign Unused Channels for DS1820 Temperature Sensors in Config Files

max4elektroda 84 2
ADVERTISEMENT
  • #1 21621179
    max4elektroda
    Level 20  
    I recently came to the point where I wanted to find out, which channels are "in use" in order to avoid assigning an already used channel to DS1820 for temperature.

    It reminded me about my approach to center pinrole and channels, actually spread over different files in one.
    This is updated and actual work can be found here: in this branch

    Basic idea:
    There is one new text file with all information
    An awk script will generate an header file included by multiple files to replace the information prior coded there.

    It won't break anything, saves some bytes but "uglifies" JavaScript code a bit.
    And not yet done: I need to figure out/check automatic build of documentation (since the information will be in another file now).

    I also included a new #define to have the possibility to change the GUI
    Inspired by an idea of @divadiow I tried to extend the page for "Configure Module" to add a "description" for the channels.
    Adding the descriptions is quite straightforward; since adds some information to the image it will increase size a bit.

    Here's a preview of the actual possible work the following changes to the actual page (its enabled for the windows simulator to test):

    Removed channels from "0 channel" roles
    Hide pins with no role assignment
    Added simple "function" to channels

    Screenshot of module configuration page showing a list of channels, pin roles, and their descriptions.
    Screenshot showing the module configuration page with unassigned pins hidden and channel descriptions added for each available channel.

    Just actual work to see what is possible...




    So: Why this post? Its not really about the changes above, but a related question:


    But then I realized we have quite some different approaches for handling of
    Pins, roles, channels and drivers.

    We have drivers which are configured through the "Configure Module" page:
    - setting the role for the pin and possibly the channels
    - this has two possible results:
    - you can start the driver via command or autostart
    - driver automatically starts if all pins are configured
    - setting the channel will result in channel to be recognized as "known in use"

    Examples are DHT drivers (autostarted) and DS1820 (start with command)


    Other drivers can not be configured on this page, but are configured during driver start.
    The used channels are usually not recognized as "in use"

    Examples are AHT2X, BMP280 ...

    So my question is to discuss, if we maybe want to change this (in either direction)?

    I would help changing/extending the "Configure Module" page if we might decide this way.
  • ADVERTISEMENT
  • #2 21621385
    divadiow
    Level 34  
    Well, I definitely favour consistency, whichever method. At the moment it's not obvious (to new users), from the GUI alone, which drivers will start automatically and which require startdriver cmd and which need both. It may mean users having to spend less time looking around for what arguments there are (to complete setup) if they were revealed in GUI on driver selection.

    Also, if the driver isn't included in build it'd be good if it wasn't shown at all.

    I do like the option of channels having better labels like shown in your pic.

    Depending on the driver, maybe a drop-down menu option for every argument possible? Maybe that would be too long for some and I guess some would need to be user-input value fields rather than drop-down?

    I hadn't thought about only showing configured IOs. Personally, I'd rather see them all in a big list, but that's just me.
  • #3 21621685
    max4elektroda
    Level 20  
    Thanks for your feedback. The labels are easily changed, for several functions you even can have some fancy Unicode symbols like🌡️ or 💧 for temperature or humidity.

    To address the drivers arguments question I had the same idea actually. But it doesn't seem too simple, at least I didn't find an approach for this extending the current page.
    I could only think of a complete new approach not pin but driver/function centered.
    So you add a role/driver DHT and select the pin it's connected to plus two channels for temperature and humidity.
    Or a BL0937 and select all three pins for this device grouped together.

    But that would need a complete rework (not impossible but challenging) and make all guides and documentation obsolete.
ADVERTISEMENT