Notifications
Clear all

nano-33-iot-wifi-test

4 Posts
2 Users
0 Likes
904 Views
(@help-seeker)
Member
Joined: 3 years ago
Posts: 4
Topic starter  

When i try this example i get on my serial monitor:

Attempting to connect te SSID: Wifi-2.4-3518 

Connected...

Attempting to connect te SSID: Wifi-2.4-3518 

Connected...

But the IP address does not appear on the screen

Anyone an idea why?

Thanks for a suggestion

 


   
Quote
(@davee)
Member
Joined: 3 years ago
Posts: 1671
 

Hi @help-seeker,

  Generally it would be a good idea to provide a print of the code or specific reference - otherwise superhuman powers of deduction are required ... and they are a lot more expensive 😀

However, a first Google led me to https://www.okdo.com/getting-started/get-started-with-arduino-nano-33-iot/

And this bit in particular

image

This code looks flawed, as the Serial print lines of "Attempting to ..." and "Connected ...." are both called regardless of the "status" value indicating it is connected. 

I presume it hopes that it connects first time round, and hence 'escapes' the while loop.

But if you see the two lines being printed repeatedly, about once a second, it means it has failed to connect and is retrying once per second.... even though it says "Connected ...".

However, this flaw is misleading but not your 'real' problem. The 'real' problem is you have not connected.

Why is more difficult. Failing to set correct SSID or pass would certainly be enough. But there are many reasons why your nano board and router might not talk to each other, such as signal too weak (put them next to each other) or router and Nano card not on the same subnet.

Sorry, I haven't got that type of card, so I don't know what defaults are. Looking at the terminal screen shot in the reference I quoted, it looks like the local subnet is 192.168.1.0/24, as it connected at 192.168.1.117. I presume this is set in the 'hidden' Nano code somewhere. If so, your router will only 'see it' if it is set to the same subnet.

There is probably another call you can add to the code to set the subnet for the Nano. Google may be your best friend here...

Hope this helps you to satrt your investigation


   
ReplyQuote
(@help-seeker)
Member
Joined: 3 years ago
Posts: 4
Topic starter  

First I tried the example\WifiNina\ScanNetwoks
I saw on the serial monitor:

Please upgrade the firmware 
"MAC: 7C:9E:......"
**Scan Networks**
number of available networks: 1
0) Wifi-2.4-3518 Signal: -52 dm Encryption: WPA2

Problem 1: How can I update the firmware?

Problem 2:
Then I tried the nano-33-iot-wifi-test sample program
Then there was no IP address on the serial monitor

Maybe updating the frmware will solve my second problem?

void printWifiStatus() {
// Print results to serial monitor

// Network SSID
Serial.print("SSID: ");
Serial.println(WiFi.SSID());

// Device IP address
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
}

void setup() {

// Start the Serial port
Serial.begin(9600);

while (!Serial) {
; // Wait for serial port to connect.
}

// Check for the WiFi module:
if (WiFi.status() == WL_NO_MODULE) {
Serial.println("WiFi module failed!");
while (true);
}

connectToAP();

printWifiStatus();

}

void loop() {
}

 

 

 


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1671
 

Hi @help-seeker,

  Problem 1:

I am not 100% clear which board you have, and I do not have any of this group of boards, so I have no idea if what I found is suitable or works, but my first Google came up with:

https://github.com/xcape-io/ArduinoProps/blob/master/help/WifiNinaFirmware.md

which shows how to update firmware on a number of boards.

I suggest you study it carefully, to determine if it is suitable for your board. (Obviously, I haven't used this procedure, so  I cannot vouch for its suitability or quality.)

Problem 2:

As I said in my first reply, the most likely reason it doesn't show an IP address is because it hasn't connected. In general it is possible to preallocate an IP in the software of a computer ... but this assumes that no other piece of equipment in your network has been allocated the same address. The common answer in 'home' networks is to allow each piece of equipment to negotiate with the router and the router will assign a 'free' IP address as part of the auto-connection process. If the negotiation fails to complete, it will not have a IP address allocated.

Good luck and best wishes.


   
ReplyQuote