Packet forwarding (Broadcast)

ThinkalVB
Posts: 13
Joined: Mon Apr 22, 2019 7:09 am

Packet forwarding (Broadcast)

Postby ThinkalVB » Sun Jul 21, 2019 7:40 pm

I am trying to implement a UDP mesh formation library (flooding), kindly evaluate my assumptions and give suggestions
1) I have 2 event handler functions; I need to get the mac of all STA connected to the AP and the mac of the AP the esp's STA is connected to. Then use this MAC mac to send packets to all other nodes except the node from which I receive the packet.
This is how I am assuming to implement it - I am using Arduino IDE; how can I get it done?
https://github.com/ThinkalVB/AirMesh

Code: Select all

    WiFi.onEvent(handleNewSTA, WiFiEvent_t::SYSTEM_EVENT_AP_STACONNECTED);
    WiFi.onEvent(handleLostSTA, WiFiEvent_t::SYSTEM_EVENT_AP_STADISCONNECTED);
    
    void AirMesh::handleNewSTA(WiFiEvent_t event, WiFiEventInfo_t info)
{
    #ifdef _AIRMESH_DEBUG_
    Serial.printf("New STA connected");
    #endif
}

void AirMesh::handleLostSTA(WiFiEvent_t event, WiFiEventInfo_t info)
{
    #ifdef _AIRMESH_DEBUG_
    Serial.printf("STA Lost");
    #endif
}

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Packet forwarding (Broadcast)

Postby WiFive » Mon Jul 22, 2019 12:04 am


ThinkalVB
Posts: 13
Joined: Mon Apr 22, 2019 7:09 am

Re: Packet forwarding (Broadcast)

Postby ThinkalVB » Mon Jul 22, 2019 4:31 am

I did check out the painless mesh and ESP32 MDF, but what I need was the syntactic sugar for implementing the same in Arduino ESP32 ( not using the ESP-IDF if it's possible). Thanks for the replay ...peace .....

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Packet forwarding (Broadcast)

Postby WiFive » Mon Jul 22, 2019 5:14 am

painlessMesh is designed to be used with Arduino, but it does not use the Arduino WiFi libraries, as we were running into performance issues (primarily latency) with them. Rather the networking is all done using the native esp32 and esp8266 SDK libraries, which are available through the Arduino IDE. Hopefully though, which networking libraries are used won’t matter to most users much as you can just include painlessMesh.h, run the init() and then work the library through the API.
I think it's great if you want to implement your own just wanted you to be aware of it.

ThinkalVB
Posts: 13
Joined: Mon Apr 22, 2019 7:09 am

Re: Packet forwarding (Broadcast)

Postby ThinkalVB » Mon Jul 22, 2019 5:28 am

I think it's great if you want to implement your own just wanted you to be aware of it.
Ya, it will be cool... Thank you for understanding.

mpetersen
Posts: 5
Joined: Mon Feb 24, 2020 8:58 pm

Re: Packet forwarding (Broadcast)

Postby mpetersen » Wed Feb 26, 2020 5:58 pm

@WiFive,

Seems like you've been swimming in these water...wonder if you might give me a bit of your experience:

I'm looking at creating a 10-20 node cluster of ESP32-based devices in a Mesh topology.
Considering the devKit-C and/or the M5Stack (an ESP32-based platform with some peripherals).
The integration of peripherals on the M5stack make it an optimum proto platform but the arduino layer has me concerned.
I am also debating whether the ESP-IF or ESP-MDF is the optimum SDK to run for my Mesh application.

You mention in this thread that the ESP-IDF (and I'd think the MDF) can be called/utilized from the Arduino IDE. Does this mean I can have my cake and eat it too ie select the M5stack platform, develop in Arduino IDE and link in the ESP32 IDF or preferably the MDF for core ESP32 WiFi functions & control?

Much appreciate any insight/guidance you can provide,
Thanks much - Mike

Who is online

Users browsing this forum: Bing [Bot], MicroController and 250 guests