Feather M0, "WiFi shield" not detected

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jules999999
 
Posts: 58
Joined: Sun Mar 13, 2016 6:13 am

Feather M0, "WiFi shield" not detected

Post by jules999999 »

Hi
I am having trouble with the Feather M0 WiFi with ATWINC1500 when programmed with the Arduino IDE (1.8.5) running on both a Raspberry Pi 3 and a Raspberry Pi 3 B+. Initially, I had no problems but as I developed my sketches, things suddenly started to go awry. The problem is that following upload, the “WiFi shield” is not detected. When the USB programming lead is removed, powering down the Feather, then replaced, the WiFi shield is detected and the Feather connects to the network. The same thing happens on another Feather M0 (but does not happen when they are programmed from a PC.)
On the face of it, it would seem to be a problem with the Raspberry Pi but I wondered if anybody in the Feather community had also experienced a similar problem. The Feathers have firmware version 19.5.2 , Libraries on the IDE are up to date as far as I am aware and everything is up to date on both the Raspberry PIs as far as I can tell.
This is a problem for me as the Feather and the Pi live in a box 100 yards from my house and the intention is to communicate with them remotely without having to disconnect and reconnect the USB. By the way, initiating a reset does not help. I feel I must be missing something obvious!
Thanks, Julian Rogers.

User avatar
jules999999
 
Posts: 58
Joined: Sun Mar 13, 2016 6:13 am

Re: Feather M0, "WiFi shield" not detected

Post by jules999999 »

PS. Rebooting the Pi remotely will enable the WiFi to be detected (with the pre-loaded sketch on the Feather) but subsequent uploads again lead to the problem described above. Interestingly (possibly), rebooting only works if the LiPoly battery on the Feather is disconnected. Otherwise the pre-loaded program does not run at all and needs to be uploaded again (then the original WiFi detection problem reoccurs, of course).
Julian Rogers

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather M0, "WiFi shield" not detected

Post by adafruit_support_mike »

That sounds more like a power issue than an OS problem. The WiFi radio uses bursts of current when it transmits, and it sounds like the supply voltage is dropping at that point.

What are you using as a power source to the Feather?

User avatar
jules999999
 
Posts: 58
Joined: Sun Mar 13, 2016 6:13 am

Re: Feather M0, "WiFi shield" not detected

Post by jules999999 »

Hi
Thanks for your reply. The Feather is getting its power over USB from the Raspberry Pi but a LiPoly battery is also connected to the Feather.
As I say, after uploading my sketch, WiFi.status() returns WL_NO_SHIELD. However, if the USB lead is removed, the LiPoly disconnected then the USB lead is replaced, the WiFi Shield is detected and the connection to the network can take place. Then everything works as it should until I try to upload again.
Julian Rogers

User avatar
jules999999
 
Posts: 58
Joined: Sun Mar 13, 2016 6:13 am

Re: Feather M0, "WiFi shield" not detected

Post by jules999999 »

As (nearly) always, there is a work round for this. I spent some time breadboarding a circuit to enable power to the USB sockets to be interrupted, controlled from a GPIO pin on the Pi. This was a waste of time as there is program called hub-ctrl (https://github.com/codazoda/hub-ctrl.c) which does the job from software. Then you can write a script to turn off the USB power, wait for a second, then turn it on again. This solves my problem of being able to get the Feather to recognize its own WiFi in a reasonably elegant way but still does not explain what is causing the problem in the first place.
Julian Rogers

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather M0, "WiFi shield" not detected

Post by adafruit_support_mike »

The WINC1500 is a separate device from the microcontroller, and rebooting the microcontroller by a software connection doesn't necessarily reboot the WINC1500.

If the WINC1500 thinks its in an established connection after the microcontroller reboots, it could cause connection problems.

The WINC1500 has a reset pin though, connected to pin 4 of the microcontroller. The microcontroller should toggle that pin before trying to make first contact with the WINC1500 to force the WINC1500 into a known state.

Check your code to see if it, or the WiFi library, does that reset.

User avatar
jules999999
 
Posts: 58
Joined: Sun Mar 13, 2016 6:13 am

Re: Feather M0, "WiFi shield" not detected

Post by jules999999 »

Hi, thanks for your reply.
As indicated on your site I am using Arduino WiFi101 library. I assumed the call WiFi.setPins(8,7,4,2) which I include before the call to WiFi.status(), suitably initialises the pins?
Anyway, I have tried toggling pin 4 low to high (and high to low) and put this code before and after WiFi.setPins (and initialised pin 4 as an output) but the problem remains.
(I have not had this trouble with two other Feather M0s which I incorporated into projects almost two years ago but then I was using the Adafruit_WINC1500 library and the Arduino IDE was running on a PC.)
Julian Rogers

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather M0, "WiFi shield" not detected

Post by adafruit_support_mike »

I haven't drilled far enough into the WiFi101 lirary to know if it toggles the reset pin or not.

Are you giving the WINC1500 time to reboot after toggling pin 4 in your own code?

User avatar
jules999999
 
Posts: 58
Joined: Sun Mar 13, 2016 6:13 am

Re: Feather M0, "WiFi shield" not detected

Post by jules999999 »

Hi
I gave it half a second to reset.
Julian Rogers.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather M0, "WiFi shield" not detected

Post by adafruit_support_mike »

That should be plenty.

Post a photo showing your hardware and connections please. Let's see if those have any clues. 800x600 images usually work best.

User avatar
jules999999
 
Posts: 58
Joined: Sun Mar 13, 2016 6:13 am

Re: Feather M0, "WiFi shield" not detected

Post by jules999999 »

Hi. Thanks for you reply.
You possibly won't get any clues from the project but it's the same with just the Pi and the Feather and a USB lead (controlling the Pi over VNC). This does not happen uploading from a PC.
It would be nice to know what is going wrong but with the work round I have discovered, I can program the project remotely with not too much bother. So don't worry if you have more pressing problems to sort!
Thanks again for your help,
Julian Rogers
Attachments
pi and feather.jpg
pi and feather.jpg (236.92 KiB) Viewed 258 times
pi and feather2.jpg
pi and feather2.jpg (336.55 KiB) Viewed 258 times

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather M0, "WiFi shield" not detected

Post by adafruit_support_mike »

I'm afraid I'm stumped. Toggling the WINC1500's reset pin should make it behave under all circumstances. I don't know why it would need to be power cycled.

User avatar
jules999999
 
Posts: 58
Joined: Sun Mar 13, 2016 6:13 am

Re: Feather M0, "WiFi shield" not detected

Post by jules999999 »

As you say, this is a baffling problem but for practical purposes, power-off reset is a solution.

Here's another weird thing. When the Feather is connected to a Raspberry Pi (which is all the time in my setup) unless the WiFi module is regularly called into action (by say, reporting the SSID, BSSID and signal strength every minute) the connection permanently drops out after as little as half an hour of inactivity. It only comes back if the Feather is reset. I have not experienced this with two other Feather M0s I have had running continuously for the best part of two years but these are not connected to Raspberry Pis. Is the Raspberry Pi the problem here (or the way I am using it)?

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather M0, "WiFi shield" not detected

Post by adafruit_support_mike »

Having a Wifi connection fail is normal. The question isn't, "will the link drop?" but "when will the link drop?"

Any program that needs a long-term connection should check the connection every minute or so and reconnect if necessary.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”