Hi
Refer to the doc https://docs.espressif.com/projects/esp ... mlink.html
How to get the following result and receive broadcast while the light is turn on/off?
2. Receiving Broadcast UDP Packets
When scanning for devices, the app broadcasts UDP packets and obtains the information about the root node from its reply.
Request:
"Are You Espressif IOT Smart Device?"
Response:
"ESP32 Mesh 112233445566 http 80"
3.5. Device Status Notification
When the status of the ESP-MDF device (on/off), network connection (connected or disconnected), and route table change, the root node will send broadcast UDP packets to notify the app to obtain the latest status of the device.
UDP Broadcast:
mac=112233445566 flag=1234 type=***
mac is the MAC address of the device whose status has changed;
flag is a random integer value used to distinguish among notifications at different times;
type is the type of change, including:
status indicates that the device status has changed;
https indicates that the information of the device connection in the network has changed, and the updated information is required through https communication protocol;
http indicates that the information of the device connection in the network has changed, and the updated information is required through http communication protocol;
sniffer indicates that a new networked device has been sniffered.
ESP32 Mesh Mlink protocol
Re: ESP32 Mesh Mlink protocol
UDP and mDNS are only used for device discovery, that is, the IP address of the root node of the ESP-MESH network is obtained.
If you need to control the device you need to send an http request
If you need to control the device you need to send an http request
Code: Select all
POST /device_request HTTP/1.1
Host: 192.168.111.183:80
Content-Type: application/json
Mesh-Node-Mac: ffffffffffff
cache-control: no-cache
{
"request": "get_device_info"
}
Re: ESP32 Mesh Mlink protocol
In this small repository there is a small example:
https://github.com/martinberlin/M5Stick ... phone-Mesh
It was supposed to be called : Microphone-Mesh and it's ready to be compiled in a M5-Stick-C
The IP of the root lamp you can get making a ping to:
http://esp32_mesh.local
From any device with Bonjour / or linux. I could not find a way to do an MDNS query to read it. Starting to learn IDF now
https://github.com/martinberlin/M5Stick ... phone-Mesh
It was supposed to be called : Microphone-Mesh and it's ready to be compiled in a M5-Stick-C
The IP of the root lamp you can get making a ping to:
http://esp32_mesh.local
From any device with Bonjour / or linux. I could not find a way to do an MDNS query to read it. Starting to learn IDF now
epdiy collaborator | http://fasani.de Fan of Espressif MCUs and electronic design
Re: ESP32 Mesh Mlink protocol
But no answer from the official doc, list below
When the status of the ESP-MDF device (on/off), network connection (connected or disconnected), and route table change, the root node will send broadcast UDP packets to notify the app to obtain the latest status of the device.
I already know how to use http control and get the status, but the important things is how to notify the change automatically while someone turn on/off.
When the status of the ESP-MDF device (on/off), network connection (connected or disconnected), and route table change, the root node will send broadcast UDP packets to notify the app to obtain the latest status of the device.
I already know how to use http control and get the status, but the important things is how to notify the change automatically while someone turn on/off.
Re: ESP32 Mesh Mlink protocol
The device sends a UDP broadcast notification via `mlink_notice_write()`.
The client needs to start a udp sever to receive,
The default port for UDP broadcast is 1025, you can modify it with `make menuconfig`
The client needs to start a udp sever to receive,
The default port for UDP broadcast is 1025, you can modify it with `make menuconfig`
Who is online
Users browsing this forum: No registered users and 69 guests