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

  • 3
  • 5
  • 2
  • 12
  • 13
  • 14
  • 58
  • 8

194
Online

9.2k
Users

9.9k
Topics

103.2k
Posts