Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Request for Help with Implementing MAC Filter on ESP8266 in AP Mode using Arduino Platform(PlatformIO)#9177

SajjadQadri started this conversation inGeneral
Discussion options

Hello Everybody,

I am working on a project using the ESP8266 and need to implement a MAC filter in Access Point (AP) mode. I am using the Arduino platform(PlatformIO) for programming and require your assistance.

My main issue is how to define a list of allowed MAC addresses and disconnect a client if its MAC address is not on the allowed list.

I have tried several different codes so far, but it seems that some of these codes do not work correctly. For example, the code that was previously suggested to me:
void wifi_station_deauth(uint8_t *bssid) {
struct auth_deauth_frame {
uint16_t frame_control;
uint16_t duration;
uint8_t da[6];
uint8_t sa[6];
uint8_t bssid[6];
uint16_t seq_ctrl;
uint16_t reason_code;
}attribute((packed));

struct auth_deauth_frame frame;
frame.frame_control = 0x00C0;
frame.duration = 0;
memcpy(frame.da, bssid, 6);
memcpy(frame.sa, WiFi.softAPmacAddress().c_str(), 6);
memcpy(frame.bssid, WiFi.softAPmacAddress().c_str(), 6);
frame.seq_ctrl = 0;
frame.reason_code = 0x0001; // Unspecified reason

wifi_send_pkt_freedom((uint8_t *)&frame, sizeof(frame), 0);
}

This code does not disconnect clients whose MAC addresses are not on the allowed list. I have been using standard Arduino library functions as well as lower-level SDK functions, but I have not been able to resolve the issue.

Has anyone had a similar experience or can provide a comprehensive guide for creating an effective MAC filter on the ESP8266? Any sample code or suggestions in this regard would be greatly appreciated.

Thank you in advance for your help and guidance.

Best regards,
Sajjad Qadri

You must be logged in to vote

Replies: 2 comments

Comment options

Hi,

I'm not a C/C++ expert, but Iread that it is not recommended to use pointers with packed structures.

You must be logged in to vote
0 replies
Comment options

hi enjoyneering
So what is your suggestion?

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@SajjadQadri@enjoyneering
Converted from issue

This discussion was converted from issue #9162 on July 30, 2024 16:40.


[8]ページ先頭

©2009-2025 Movatter.jp