How ethernet gateway code can check if is connected with controller?



  • Having arduino ethernet gateway I need to send messages with senors values to controller (Home assistant requirement to auto configure sensors).
    With serial gateway simple sending in first iteration of loop:

    	void loop() {
    		if ( ! inital_msgs_sent ) {
    			inputs.sendStates(); 
    			outputs.sendStates();
    			inital_msgs_sent = true;
    

    worked.

    But with ethernet controller loop starts when HA is not yet connected to GW so sent messages do not reach controller 😕
    So, how should I fix it?

    1. Is any way to know if controller is connected ?
    2. Is any way to know if controller requested presentation?
    3. Is any way to know if send message really reached controller?

    TIA, regards,



  • @matkor said in How ethernet gateway code can check if is connected with controller?:

    1. Is any way to know if controller is connected ?
    2. Is any way to know if send message really reached controller?

    Seems positive send() result means message reached controller when executed on gateway?


Log in to reply
 

Suggested Topics

134
Online

9.7k
Users

10.3k
Topics

106.4k
Posts