Having issues with ATWINC3400 connecting to wifi

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using the SAMD21 Xplained Pro board with an ATWINC3400 expansion on expansion port 1. I am attempting to connect to an enterprise wifi network (MSCHAPv2) using the example project that is provided by Atmel/Microchip (called WINC3400_SECURITY_ENTERPRISE_NETWORK_MSCHAPV2_EXAMPLE). The only changes I have made to the code is to add a username/password where necessary for the wifi connection. All the setup code is running fine, and then I attempt to actually make the wifi connection. After making the attempt, the wifi_cb function receives a message with a value of 34, and I am not sure how to interpret this message. According to the documentation, this is not even a value that should ever be passed into this function. 

 

For reference, "wifi_cb" is the callback function that is defined in code to fulfill the role of this function pointer found in m2m_wifi.h:

 

typedef void (*tpfAppWifiCb)(uint8 u8MsgType, void *pvMsg);

 

According to the documentation, the following values can be passed in for u8MsgType:

 

@param[in]  u8MsgType
    Type of notification. Possible types are:
       - @ref M2M_WIFI_RESP_CON_STATE_CHANGED
       - @ref M2M_WIFI_RESP_CONN_INFO
       - @ref M2M_WIFI_REQ_DHCP_CONF
       - @ref M2M_WIFI_REQ_WPS
       - @ref M2M_WIFI_RESP_IP_CONFLICT
       - @ref M2M_WIFI_RESP_SCAN_DONE
       - @ref M2M_WIFI_RESP_SCAN_RESULT
       - @ref M2M_WIFI_RESP_CURRENT_RSSI
       - @ref M2M_WIFI_RESP_CLIENT_INFO
       - @ref M2M_WIFI_RESP_PROVISION_INFO
       - @ref M2M_WIFI_RESP_DEFAULT_CONNECT
       - @ref M2M_WIFI_RESP_ETHERNET_RX_PACKET (If Bypass mode is active)
       - @ref M2M_WIFI_RESP_WIFI_RX_PACKET (If monitoring mode is active)

The integer value of 34 (the value that my function is receiving as a message) does not match any of those possible values as defined by the documentation. Therefore, I am at a complete loss for what is going wrong with my program.

 

I have tried my code with firmware versions 1.2 (it had a 2017 build date and it came stock on the WINC3400), 1.3.1 (it has a June 2019 build date), and 1.4.1 (It has an Oct 2020 build date).

 

Any suggestions on how I can figure out what is going wrong?

 

[edit]

 

After some further research, it looks like the value 34 corresponds to M2M_WIFI_RESP_BLE_API_RECV. Has anyone experienced this issue? Any suggestions?

 

A similar issue was posted by another user last year, but no one responded to his post with an answer: https://community.atmel.com/foru...

 

[/edit]

Last Edited: Mon. Jun 7, 2021 - 04:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

davidpruitt wrote:
Any suggestions on how I can figure out what is going wrong?

I think this may be something that you need to raise with Microchip on a Support Ticket

 

frown

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just finished a port of this driver to a mynewt project and I'm seeing the same event.

 

Did you get any further? I suspect the firmware of the module is incompatible with the win3400 driver I took from asf 3.5.0 framework. I see however you tried several firmware versions so not liking my chances.

 

Will investigate how different the asf driver is to the harmony microchip one. I definitely had this working with a SAME54 and the WINC3400 via a harmony project.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see no breaking API changes between versions. Verified that my winc3400-stk is on 1.3.1.

 

pebkac

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Definitely pebkac

 

I decided to clear my mind and slowly redo, and indirectly recheck the port. Event M2M_WIFI_RESP_BLE_API_RECV is actually expected btw because m2m_wifi_init(...) executes another func m2m_wifi_ble_set_gain_table(...) and I'm pretty sure that event is its response. It fires on init and not on m2m_wifi_connect(...).

 

Make sure module has good power and recheck your port.