CLIENT_GW_MQTT / Setup and automatisation of Presentation and set/req



  • Hi,

    just writing a sketch, which i want to share later on wit ALL who wants to have an MEGA as client, sensor node and GW ...

    AT first i want to have a overview over all my pins at MEGA 2560 and see what they "are".

    So i started with setting a String Array for 80 PINS:

    String iomodus[80][3] = { 
    //"presentation", "set/req", "description"
    {„0“,                       “0“,              “free“},
    {„0“,“0“,“free“}, 
    {"S_BINARY","V_STATUS","test switch"}, //D3
    {„0“,“0“,“free“}, //D4
    ...
    {„0“,“0“,“free“}, //D80
    };
    
    1. i want to present sensors ...and here is my problem...

    I want to convert String rows to uint8_t to make a procedure to let the sketch present all my sensors. where
    i= CHILD_ID
    iomodus[i][1st COLUMN] = presentation ID
    iomodus[i][3rd COLUMN] = description as Text
    ACK= true

    void presentation()  
    {   
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Relay+Max31855", "1.0");
    
    for (int i = 0; i<70; i++) //all Ports D0 bis D69
    
    //present(uint8_t childSensorId, uint8_t sensorType, const char *description, bool enableAck)
    present(i, iomodus[i][1], iomodus[i][3], true);
    }
    

    does no work!!!

    and says :

    **cannot convert 'String' to 'uint8_t {aka unsigned char}' for argument '2' to 'void present(uint8_t, uint8_t, const char*, bool)'**
    
    1. Want to set Variables/Topics to my controller with...
      iomodus[i][2nd column]
      Could you please help me to solv this...

    tried 6h everything i knew (pointers etc..) but no luck...

    Thank you in Advance!


Log in to reply
 

Suggested Topics

  • 1
  • 10
  • 2
  • 1
  • 1
  • 2

50
Online

11.4k
Users

11.1k
Topics

112.6k
Posts