OVMS3-idf/examples/protocols/mdns
Angus Gratton 800bffb8b0 cmake: Add CMakeLists.txt files for all examples
Generating using convert_to_cmake.py, with some minor cleanup
2018-04-30 09:59:20 +10:00
..
main Fix Kconfig.projbuild in some examples, where myssid is erroneously kept as the default value for password. 2018-04-05 14:34:43 +05:30
CMakeLists.txt cmake: Add CMakeLists.txt files for all examples 2018-04-30 09:59:20 +10:00
Makefile Moved examples to new folders / categories. Removed example numbers from example names 2017-01-16 23:08:35 +01:00
README.md Import mDNS changes 2018-01-16 10:58:34 +02:00

mDNS example

Shows how to use mDNS to advertise lookup services and hosts

Example workflow

  • mDNS is initialized with host name and instance name defined through make menuconfig and _http._tcp service is added to be advertised
  • WiFi STA is started and trying to connect to the access point defined through make menuconfig
  • The system event handler is used to pass the network events to mDNS so the service is aware when the interface comes up or down
  • GPIO0 (BOOT Button) is initialized as pulled-up input that can be monitored for button press
  • Example task is started to check if the button is pressed so it can execute the mDNS queries defined

Running the example

  • Run make menuconfig to configure the access point's SSID and Password and the default device mDNS host name and instance name
  • Run make flash monitor to build and upload the example to your board and connect to it's serial terminal
  • Wait for WiFi to connec to your access point
  • You can now ping the device at [hostname].local and browse for _http._tcp on the same network to find the advertised service
  • Pressing the BOOT button will start quring the local network for the predefined in check_button hosts and services

See the README.md file in the upper level 'examples' directory for more information about examples.