khoih-prog / WiFiNINA_Generic

Enables WiFiNINA network connection (local and Internet) for SAM DUE, SAMD21, SAMD51, Teensy, AVR Mega, STM32, RP2040-based boards, etc. in addition to Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000, Arduino UNO WiFi Rev.2 , Nano 33 IoT, Nano_RP2040_Connect. Now with fix of severe limitation to permit sending much larger data than total 4K
GNU General Public License v3.0
37 stars 12 forks source link

Issues with platformIO project getting error Communication with WiFi module failed! #21

Closed gbernal closed 2 years ago

gbernal commented 2 years ago

Describe the bug

I have a custom board based on the sparkfun_samd51_micromod that has a Ublox W102 attached to it. I'm able to use the WiFiNINA from Arduino and Adafruit WiFiNINA Library by only changing the corresponding pins. However, I would like to use the WiFiManager_NINA_Lite in my project so I tried to use the WiFiNINA_Generic but I get Communication with WiFi Module error. So I tried with one of the supported boards in my case the Arduino MKR1010 and I get the same error which makes me think that something in my PlatformIO project is not set correctly.

Steps to Reproduce

Create a new project using PlatformIO Core 6.0.2·Home 3.4.2 for board select mkrwifi1010 frame work arduino. install WiFiNINA_Generic using the Library registry. copy the patch https://raw.githubusercontent.com/khoih-prog/WiFiNINA_Generic/master/Packages_Patches/arduino/hardware/samd/1.8.13/platform.txt

into C:\xxxx\xxxx.platformio\packages\framework-arduino-samd\

The plarformio.ini file should look like this

[env:mkrwifi1010]
platform = atmelsam
board = mkrwifi1010
framework = arduino
lib_deps = khoih-prog/WiFiNINA_Generic@^1.8.14-5

copy the content of WiFiping.ino into the main.cpp and move the .h files to the lib folder

Expected behavior

I would expect the board to connect to the local wiifi and ping google.com

Actual behavior

For the Arduino MKR1010 I get Serial console prints

Start WiFiPing on SAMD MKRWIFI1010
WiFiNINA_Generic v1.8.14-5        
Communication with WiFi module failed!

Information

Please ensure to specify the following:

khoih-prog commented 2 years ago

Hi @gbernal

It's good that you went back and started over with the supported MKR1010. Be sure you have the updated WiFi101 library and use Arduino WiFiNINA to test first to know the hardware is OK

Then use the latest Arduino IDE v1.8.19, and be sure everything is working OK with WiFiNINA_Generic, then with WiFiManager_NINA_Lite.

Moving to PIO only all is OK with Arduino IDE.


I have a custom board based on the sparkfun_samd51_micromod that has a Ublox W102 attached to it. I'm able to use the WiFiNINA from Arduino and Adafruit WiFiNINA Library by only changing the corresponding pins.

For currently unsupported sparkfun_samd51_micromod, this is so good and you can use this info to modify the WiFiNINA_Pinout_Generic.h if necessary, then repeat the previous steps over again.

Sorry I can't help you any further as the sparkfun_samd51_micromod and your hardware is so special and I don't have that kind of hardware combination.


As this is not an issue or bug of the library, I'm closing it now. Post for help on Discussions, Arduino Forum or PIO Forum if PIO related issue if not a bug of this library.

Good Luck,

gbernal commented 2 years ago

Dear @khoih-prog Thank you for responding so quickly. I have followed your suggestions and ran your library using the Arduino IDE as you can see in the screenshot attached. The hardware is working fine and runs as it should. image

I went back to PIO and created a fresh project and added the latest version of WifiNINA_Generic and W101 but I get the same issue as before.

image

Thank you for your help in advance!

khoih-prog commented 2 years ago

So please post your issue on PIO Forum for help as this is PIO bug / issue.