Can't send data via mobile data | ESP8266 Wi-Fi Module | 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
Can't send data via mobile data
Avatar
Atex
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
1
January 21, 2018 - 11:33 am
sp_Permalink sp_Print

Hello,
I've ESP 8266 12-E on Nodemcu board. I've programmed it via Arduino IDE to send data to two channels (8+7 fields) on Thingspeak every minute. When ESP is connected to my home WiFi it takes approximately 6-8 seconds (3-4s per channel) to send a data.

I want to have more portable device so I programmed it to send data via my phone tethering (access point) by changing SSID and password to my phone. ESP12-E connected to it (1 connected client on statusbar), sending data took almost 12 seconds - probably because of weaker range.

Unfortunately it wasn't sent (or received?). I tried to use second (older and worse) phone. Sending took almost 20 seconds but the result was the same.

It works only on my home WiFi (didn't test other routers). Should I change something or ThingSpeak isn't compatible with phones? Or it takes too long? What could be a reason?

Avatar
cstapels
Moderator
Forum Posts: 158
sp_UserOfflineSmall Offline
2
January 21, 2018 - 6:59 pm
sp_Permalink sp_Print

Do you still have the serial monitor connected on your NODE MCU when you are sending?  Are you parsing the response from the server?  Can you share what the server is returning?

Avatar
Atex
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
3
January 22, 2018 - 10:47 am
sp_Permalink sp_Print

Yes... and no. At the beginning I had tried it with serial monito. Later I tried resetting ESP, using it without serial monitor and without connecting it to my PC. My ESP is plugged to my PCB and has external power supply. With it and without connecting to PC it works on my home wifi, but h

On serial monitor I wrote Serial.printlns under calling the following function. They contained sending times thanks to millis() function.

 

Sending is divided into 2 parts because only in that way I am able to send data to 2 channels at once. I've commented one but result was the same.

void sendDataToCloud()
{
      for(a=0; a<8; a++)
      {
           ThingSpeak.setField(a+1, power[a]);
      }
      ThingSpeak.writeFields(channelNumber1, writeAPIKey1);

      ESP.wdtFeed(); //optional to prevent watchdog triggering

      for(a=8; a<15; a++)
      {
      ThingSpeak.setField(a-7, power[a]);
      }
      ThingSpeak.writeFields(channelNumber2, writeAPIKey2);
}

 

I don't parse any data on server. ON ESP I'm deleting min/max values only, then solving few equations and then writing them using ThingSpeak.setField. Even ESP is connected to my phone, the data doesn't leave it. Phone isn't on sleep mode and has all permissions.

 

My sending code is based on these two from Mathworks examples:

https://www.mathworks.com/help/thingspeak/read-and-post-temperature-data.html

https://www.mathworks.com/help/thingspeak/continuously-collect-data-and-bulk-update-a-thingspeak-channel-using-an-arduino-mkr1000-board-or-an-esp8266-board.html

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
33 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

ibgedubo

aogomaeqaza

ureomug

itixuwidouzuv

eilimir

memozupi

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee