Go Down

Topic: Mkr 1010 using WifiNina (Read 674 times) previous topic - next topic

PaulCollett

Jul 17, 2019, 11:12 pm Last Edit: Jul 17, 2019, 11:18 pm by PaulCollett
I am trying to figure out how to get the wifi to work on my mkr 1010 board but I'm getting the following error.

Invalid library found in C:\Users\User\Documents\Arduino\libraries\WiFiNINA: no headers files (.h) found in C:\Users\User\Documents\Arduino\libraries\WiFiNINA

When I look at that directory it is empty. I've tried every version of the WiFiNina library and it says it's installed. What files need to be in that folder for this to work and how do I fix this.

pert

The Arduino IDE's Library Manager sometimes has a glitch when you're updating a library where it removes the library files, but then is unable to write to the empty folder (maybe due to an antivirus scan?). When that happens, it will create a new folder named like arduino_nnnn, where nnnn is some random number and install the library to that folder. So even though the library is not installed at C:\Users\User\Documents\Arduino\libraries\WiFiNINA as you would expect, it is indeed installed. This "Invalid library found" message is only a helpful warning and doesn't necessarily indicate any problem. You can fix it by deleting the C:\Users\User\Documents\Arduino\libraries\WiFiNINA folder.

If you're getting a real error message or having some other problem, then we can help with that, but only if you provide the information we need. Otherwise, carry on!

PaulCollett

Confirmed, there is a folder called arduino_124055 with files that appear to belong in the WiFiNINA folder. I copied them in and the error went away.

Thank you very much for that help.

That's the only error message I'm getting from the IDE (Version 1.89), but I'm still not getting any positive results on my Arduino.

If I load the CheckFirmwareVersion example I get this:
Code: [Select]
WiFiNINA firmware check.

Firmware version installed: 1.2.1
Latest firmware version available : 1.2.1

Check result: PASSED




I've tried the ScanNetworks example file. The output is:
Code: [Select]
Scanning available networks...
** Scan Networks **
number of available networks:0
Scanning available networks...
** Scan Networks **
Couldn't get a wifi connection


I've tried the ScanNetworksAdvanced file. The output is:
Code: [Select]
MAC: 84:0D:8E:33:B7:5C

Scanning available networks...
** Scan Networks **
number of available networks: 0

Scanning available networks...
** Scan Networks **
Couldn't get a WiFi connection



If I try ConnectWithWPA (and put in my WiFi credentials I get this output:
Code: [Select]
Attempting to connect to WPA SSID: SatisVideo
Attempting to connect to WPA SSID: SatisVideo
Attempting to connect to WPA SSID: SatisVideo
Attempting to connect to WPA SSID: SatisVideo
Attempting to connect to WPA SSID: SatisVideo


I have three MKR WiFi 1010 boards and all of them are giving me the same results. My computer can see 15 different SSIDs of various networks, most in the 2.4ghz range. But the Arduino is seeing nothing.

pert

Do you have anything connected to pins 11 and 12 on your board? Those are the I2C bus, which is used to communicate with the MKR WiFi 1010's crypto chip. That chip is used in network communications so if you interfere with the I2C bus it can cause network communication to fail. For this reason, you should only connect I2C devices to pins 11 and 12 if you're using WiFi (you can share the I2C bus between many I2C devices).

So you have your MKR WiFi 1010 still inserted in the black anti-static foam it ships with? If so, please remove this foam as it is conductive.

PaulCollett

I have the SCL and SDA ports on the Mkr Wifi soldered to the SCL and SDA ports on the BNO080. I have the VCC going to the 3.3v pin on the BNO080, and Gnd connects to Gnd. The only other thing touching is the microUSB connector to my computer. The anti-static foam is not present.

pert

Do you have the BNO080 connected on all 3 of your boards?

PaulCollett

One of them isn't soldered so I can do testing with and without, but the other two are.

pert

Does the problem still occur on the board without the BNO080?

PaulCollett

Yes, if I upload the example sketch to the board with nothing else connected I get the same result.

Serial Monitor:
Code: [Select]

BNO080 Read Example
wire begin

pert

Great. So we can conclude that the BNO080 definitely has nothing to do with the WiFi problem. I didn't think it did, since you can share the I2C bus between multiple devices, but it's good to eliminate any possible cause.

PaulCollett

Thank you for helping to simplify the problem and eliminate variables. I had not actually tried the sketch without the BNO080 attached because I assumed it was needed.

Can anyone else successfully run the sketch on a Mkr WiFi 1010? I'll include it here for your convenience.

Code: [Select]
/*
  Using the BNO080 IMU
  By: Nathan Seidle
  SparkFun Electronics
  Date: December 21st, 2017
  License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).

  Feel like supporting our work? Buy a board from SparkFun!
  https://www.sparkfun.com/products/14586

  This example shows how to output the i/j/k/real parts of the rotation vector.
  https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

  It takes about 1ms at 400kHz I2C to read a record from the sensor, but we are polling the sensor continually
  between updates from the sensor. Use the interrupt pin on the BNO080 breakout to avoid polling.

  Hardware Connections:
  Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other
  Plug the sensor onto the shield
  Serial.print it out at 9600 baud to serial monitor.
*/

#include <Wire.h>

#include "SparkFun_BNO080_Arduino_Library.h"
BNO080 myIMU;

void setup()
{
  Serial.begin(9600);
    while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.println();
  Serial.println("BNO080 Read Example");

  Wire.begin();

Serial.println("wire begin"); // This is the last command that appears to work successfully.
  if (myIMU.begin() == false)
  {
    Serial.println("BNO080 not detected at default I2C address. Check your jumpers and the hookup guide. Freezing...");
    while (1);
  }
Serial.println("myIMU Begin"); // I have not managed to get this to appear on my serial monitor.

  Wire.setClock(400000); //Increase I2C data rate to 400kHz

  myIMU.enableRotationVector(50); //Send data update every 50ms

  Serial.println(F("Rotation vector enabled"));
  Serial.println(F("Output in form i, j, k, real, accuracy"));
}

void loop()
{
  //Look for reports from the IMU
  if (myIMU.dataAvailable() == true)
  {
    float quatI = myIMU.getQuatI();
    float quatJ = myIMU.getQuatJ();
    float quatK = myIMU.getQuatK();
    float quatReal = myIMU.getQuatReal();
    float quatRadianAccuracy = myIMU.getQuatRadianAccuracy();

    Serial.print(quatI, 2);
    Serial.print(F(","));
    Serial.print(quatJ, 2);
    Serial.print(F(","));
    Serial.print(quatK, 2);
    Serial.print(F(","));
    Serial.print(quatReal, 2);
    Serial.print(F(","));
    Serial.print(quatRadianAccuracy, 2);
    Serial.print(F(","));

    Serial.println();
  }
}

pert

You do need the BNO080 connected to run that sketch. This thread is about the WiFi on your MKR WiFi 1010 not working and that sketch has absolutely nothing to do with WiFi so I don't know why you're running it. Let's stick to the problem you're having with WiFi for now. If you're also having a problem with BNO080 then we can work on that too, but we should do it separately.

What happens if you run File > Examples > WiFiNINA > ScanNetworks on the MKR WiFi 1010 that doesn't have a BNO080 connected to it?

PaulCollett

I'm sorry, I have multiple threads open on different forums and I mistook one thread for another I apologize for the confusion. I did end up getting the WiFi to work finally, but only with the BNO080 detached. I'm also having separate issues getting the Mkr WiFi 1010 to work with my BNO080. Seems like the shared pins are part of the problem. I may need to seek a different board, because the two primary things I need to do is take readings from the BNO080 and send them through either WiFi or bluetooth to a computer. If both operations require the same pins then that's going to be problematic.

So the WiFi works without the BNO080, but not with. Sorry for that confusion.
The Mkr WiFi seems to have a problem communicating with the BNO080 any way. I suspect the Wire.h library has issues communicating through I2C on the Mkr WiFi 1010 which is causing the board to freeze. But that's a different topic from this thread.

pert

I'm glad to hear you got WiFi working. I guess I wasn't crazy to suspect the BNO080 might be the culprit.

If both operations require the same pins then that's going to be problematic.
Not necessarily so. The I2C bus is designed to support many devices all connected to the same 2 pins. The I2C bus on your MKR WiFi 1010 is already being shared between the ATECC508 crypto chip and the BQ24195L battery charge controller chip. Each I2C has an address, which is used to determine which device the the microcontroller is communicating with over the I2C bus. So as long as each device has a unique address you can have many devices on the bus. This does require that all the devices are playing nicely with each other.

If you can't get it working on the existing I2C interface, a workaround could be to create a separate I2C interface on your MKR WiFi 1010 dedicated to the BNO080, then leave the existing one for the use of the crypto chip and battery charge controller. You can find a tutorial for how to do this here:
https://www.arduino.cc/en/Tutorial/SamdSercom

Go Up