为什么 MKR1000 使用电池供电时无法连接 WiFi?
我有一个连接到我的 WiFi 网络的 MKR1000 项目。当通过 USB 端口供电时,MKR1000 连接到我的 WiFi,但当通过 3.7V LiPo 供电时则无法连接。使用电池供电时是否有最低功率要求不允许 WiFi 功能,或者是否有其他原因导致其无法工作?
这是我用来测试的简单草图;插入 USB 时可以连接,但拔出 USB 时则无法连接。
#include <WiFi101.h>
#include "Mkr.h"
int wifiStatus = WL_IDLE_STATUS;
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
IPAddress localip;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
//Serial.println();
ConnectToWifi();
//Serial.println(wifiStatus);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
void ConnectToWifi() {
wifiStatus = WiFi.status();
int retrys = 10;
while (wifiStatus != WL_CONNECTED) {
wifiStatus = WiFi.begin(ssid, pass);
delay(1000);
if (wifiStatus != WL_CONNECTED) {
retrys--;
if (retrys < 0)
{
retrys = 10;
delay(3600000);
}
delay(9000);
}
}
localip = WiFi.localIP();
//Serial.print("Connected: ");
//Serial.println(localip);
}
I have a MKR1000 project that connects to my WiFi network. The MKR1000 connects to my WiFi when powered via the USB port, but not when powered by the 3.7V LiPo. Is there a minimum power requirement that disallows the WiFi function when on battery power, or is there some other reason it's not working?
Here is a simple sketch I'm using to test; it connects when plugged in to the USB, but not when unplugged.
#include <WiFi101.h>
#include "Mkr.h"
int wifiStatus = WL_IDLE_STATUS;
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
IPAddress localip;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
//Serial.println();
ConnectToWifi();
//Serial.println(wifiStatus);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
void ConnectToWifi() {
wifiStatus = WiFi.status();
int retrys = 10;
while (wifiStatus != WL_CONNECTED) {
wifiStatus = WiFi.begin(ssid, pass);
delay(1000);
if (wifiStatus != WL_CONNECTED) {
retrys--;
if (retrys < 0)
{
retrys = 10;
delay(3600000);
}
delay(9000);
}
}
localip = WiFi.localIP();
//Serial.print("Connected: ");
//Serial.println(localip);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到答案了!
MKR1000 使用 Amtel WINC 1500 A 型模块连接到 802.11 b/g/n WiFi。该模块的出厂固件为 19.6.1。显然 Amtel 停止支持 Model A,固件 19.4.4 是最后一个可用更新。
加载 19.4.4 后,MKR1000 现在可以在使用电池供电时连接到我的 WiFi 网络。
有关更新固件的信息可在此处找到:WiFi101 指南
Found the answer!
The MKR1000 uses the Amtel WINC 1500 Model A module to connect to 802.11 b/g/n WiFi. The firmware that comes from the factory for that module is 19.6.1. Apparently Amtel stopped supporting the Model A, and firmware 19.4.4 was the last update available.
After loading 19.4.4, the MKR1000 is now able to connect to my WiFi network when on battery power.
Information on updating the firmware is available here: Guide To WiFi101