Hi I'm working on a project where I'm getting some data ( Mac addresses) with esp32 using Arduino and platformio and I want to process it later so I can know who is present or not. There are lots of duplicate data because a phone sends probe requests to all available wifi hosts. I don't want to save duplicate data so I figured I can get last three hex values of Mac put them together and make an integer and I save new data on an array And compare it with each new Mac which is received but the problem is that the array should have variable length which I think is not possible in c++. What is the workaround here ?
Suppose that you could declare the array with a variable size. At some point it would be too large to fit in the available memory and the program would crash
So, declare the array with a fixed size that you know you can accommodate in the available memory
Could you use a strategy that uses the fixed size array but which overwrites the oldest data if the array become full ?
How many different MAC addresses are we talking about ?
there are containers in C++ that have variable lengths (vectors, lists, ...) . Defining a max size is also an option, your memory is not infinite as @UKHeliBob said
remember that most phones nowadays send random / changing Mac Addresses when looking for a wifi network (eg Wi-Fi privacy - Apple Support). So you are not guaranteed to get the same Mac for the same device...
It's certainly possible on an ESP32. std::vector is availble to you. It can be searched using std::find.
lists are available as well..
consider hashing the macs..
ESPVectorList
have fun.. ~q
how many macs would be enough?
Yes the strategy you said might be a good idea I should think about it. The number of Mac addresses depends on the crowdedness of the place which this device is used there. for example in my workplace there are 13 unique Mac addresses that send probe requests with signal strength larger than -80 dBm
in my country apple mobile phones are not that popular because they are really expensive and not compatible with local applications so this might not be a problem.
Android / Samsung doing the same
https://source.android.com/docs/core/connect/wifi-mac-randomization-behavior?hl=en
I think that's optional. We can tell the people in a specific company to make their Mac fixed.
Why would you want to lower the privacy settings ?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.