Arduino Zero with WiFi101 Shield Only Sends Two Updates | Arduino | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
Arduino Zero with WiFi101 Shield Only Sends Two Updates
Avatar
wjpavalko
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
1
September 6, 2017 - 8:55 pm
sp_Permalink sp_Print

I have an Arduino Zero with WiFi 101 Shield.  Connected to WiFi and successfully sent data to my channel.  Problem is it only sends two updates, then stops updating. If I reset the Zero, it will send another two (with delay set in sketch).  WiFi light is on and network light glows periodically, so I know the Zero is trying to send the updates, but they don't show up in the channel.

Any ideas?

Avatar
cstapels

Gold
Forum Posts: 54
sp_UserOfflineSmall Offline
2
September 7, 2017 - 10:12 am
sp_Permalink sp_Print

Can you connect the serial monitor and see what responses are being returned by ThingSpeak when you send the data?

Avatar
wjpavalko
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
3
September 7, 2017 - 8:22 pm
sp_Permalink sp_Print

I'm an admitted amateur at this, but can you advise how to print out communications between the Arduino and Thingspeak?  The example WriteVoltage code has no Serial connection. I assume I need to do more than just initialize a serial connection, e.g. add Serial.begin(9600). 

Avatar
wjpavalko
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
4
September 14, 2017 - 9:58 pm
sp_Permalink sp_Print

Any help from anyone else out there?  I tried an MKR1000 board and the same problem occurs.  I get two (not one, not three) updates each time the Arduino is rebooted, and then nothing.  Can't find out how to show communications with either of these boards.

Avatar
cstapels

Gold
Forum Posts: 54
sp_UserOfflineSmall Offline
5
September 15, 2017 - 3:27 pm
sp_Permalink sp_Print

Your ISP connection may be bad.  Try adding a connectWiFi() function and calling it each main loop if there is no connection: 

<put this in loop>

if(WiFi.status() != WL_CONNECTED)
{ connectWifi(); } // Make sure we have an internet connection

 

<put this after the end of your program>

int connectWifi()
{
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(2500);
Serial.println("Connecting to WiFi"); // Inform the serial output
}
Serial.println("Connected");
ThingSpeak.begin(client);
}

 

You will need Serial.begin(9600) in your setup().

For the thingspeak commands, you can at least test for success:

int success=ThingSpeak.writeField(myChannelNumber, 1, voltage, myWriteAPIKey);

Serial.println("success "+String(success));

You can see the serial monitor by pressing ctrl shift m or hitting the plus/curcle icon on the right top of the IDE window.

 

Do you see the number of entries in your channel growing - even if you see no data in your plot?

Avatar
wjpavalko
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
6
September 15, 2017 - 5:16 pm
sp_Permalink sp_Print sp_EditHistory

Thanks.  I put in the code to reconnect the wifi, but it is not executed, so WiFi is connected.

Still, after two updates, I get:

Error code is: -301:ERR_CONNECT_FAILED

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online: alexparrado
16 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 250

Vinod: 142

piajola: 73

vespapierre: 63

Adarsh_Murthy: 59

cstapels: 54

Newest Members:

chrissaxon

getty

l3inbin

ossan

gbalychik

wul

Forum Stats:

Groups: 4

Forums: 17

Topics: 1242

Posts: 4315

 

Member Stats:

Guest Posters: 1

Members: 5546

Moderators: 0

Admins: 2

Administrators: Hans, lee