seek advice to localize the network health check in mqtt_as.py #9782
Replies: 3 comments
-
I think you will find the wan_ok() in the mqtt_as.py can be called if it is desired to check on an internet connected broker, but its not used if your broker is a rpi on your local network (as is mine). For the network and broker connection checks then have a look at the _keep_connected(self). The very premiss of the mqtt_as.py library is to be a resilient connection that can handle wifi outages when used on the limits of wifi range and the reception can be a bit flaky and to handle re-connects automatically. You will not need to have an additional lan_ok method as its build into the MQTTClient class in the mqtt_as.py library. Note the co-routine you pass into the config dictionary of 'wifi_coro': eliza, probably to an async function such as wifi_han that utilises an LED as an indication of the wifi state. |
Beta Was this translation helpful? Give feedback.
-
@beetlegigg is correct. When using |
Beta Was this translation helpful? Give feedback.
-
If your query is a general one, rather than specific to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi in this library the network connection is checked in the file mqtt_py with the function wan_ok() that sent a packet to google dns on port 53 and check its answer
I have mqtt sensors newtork that are not connected to internet only to a lan.
I am seeking advice on how to write a lan_ok function that will work in a similar way. The machine always available are the lan router and the mqtt broker. the mqtt broker is a raspi so I guess I could install a dns server on it but I wonder if there are better options to solve this problem
Thanks
Beta Was this translation helpful? Give feedback.
All reactions