Go Down

Topic: Where is m2m_wifi_enable_monitoring_mode (Read 2345 times) previous topic - next topic


Jul 08, 2016, 02:49 am Last Edit: Jul 08, 2016, 04:54 am by staubinr
Hi Guys,
What a nice board this MKR1000.  Do you know this board has a Wi-Fi Sniffer Mode?   You just have to call m2m_wifi_enable_monitoring_mode(...).  But that my problem. I receive a loader error:

"TestMKR.ino:34: undefined reference to `m2m_wifi_enable_monitoring_mode'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino MKR1000."

My Code is here:

#define CONF_MGMT  // need for tenum type
#include <WiFi101.h>
extern "C" {
#include "driver/include/m2m_wifi.h"
#include "driver/include/m2m_types.h"
/* Declare receive buffer */
uint8 gmgmt[1600];
/* Callback functions */
static void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg) {
// Soemthing here to do
/* Call back monitoring */
static void wifi_monitoring_cb(tstrM2MWifiRxPacketInfo *pstrWifiRxPacket,
                      uint8                   *pu8Payload,
                      uint16                  u16PayloadSize) {
 // Something here to do
void setup() {
while (!Serial) delay(10);
// Mon Call Back
tstrWifiInitParam param = tstrWifiInitParam();
param.pfAppWifiCb = wifi_event_cb;
param.pfAppMonCb  = wifi_monitoring_cb;

if(!m2m_wifi_init(&param)) {
  tstrM2MWifiMonitorModeCtrl strMonitorCtrl = tstrM2MWifiMonitorModeCtrl();
  /* Enable Monitor Mode with filter to receive all data frames on channel 1 */
  strMonitorCtrl.u8ChannelID = 1;
  strMonitorCtrl.u8FrameType = DATA_BASICTYPE;
  strMonitorCtrl.u8FrameSubtype = M2M_WIFI_FRAME_SUB_TYPE_ANY;
  sint8 rsl = m2m_wifi_enable_monitoring_mode(&strMonitorCtrl, gmgmt, sizeof(gmgmt), 0);

void loop() {

It seems that something is missing on a WiFi101 Winc1500 module to link this function with my code.
If I change: m2m_wifi_enable_monitoring_mode(&strMonitorCtrl, gmgmt, sizeof(gmgmt), 0); for
I received a compilation error saying to less parameters.

If I replace m2m_wifi_enable_monitoring_mode(&strMonitorCtrl, gmgmt, sizeof(gmgmt), 0); with
I do not received any link(ld) error.

This function m2m_wifi_disable_monitoring_mode() is also missing.  

I was able to run every example we get with WiFi101 library.  Is there an other library like Winc1500 I should use?

This function m2m_wifi_send_wlan_pkt(...) also is missing.  

In m2m_wifi.c Line 60, I uncommitted #define CONF_MGMT and it seems ok now.

Any Idea?


Hi - i know this is a really old topic, but today I was working on the same thing and I have encountered the exact same problem. Did you find a way around this? I'm trying to use the function "m2m_wifi_enable_monitoring_mode" and its throwing the error about that its an undefined function.

I would really appreciate hearing what you did about this.




I had been batting my head against the promiscuous sniffer mode of the WINC1500, which seems ideal for my project. Finally I found out why, in the following document revision:
There is in this document revision the following obscure footnote:
"14. Wi-Fi Sniffer Mode
Note: Sniffer mode is not supported in the firmware version 19.5.x."
It seems like Microchip has removed this feature that was earlier provided by Atmel!

This was supported in the 19.4.4 firmware and the corresponding Atmel Studio ASF libraries but Microchip has withdrawn the feature, I think because of limited memory on the WINC1500 and the need to better support SSL in the newer firmware. The latest Arduino libraries have of course followed suit.

Go Up