Can't send data via mobile data | ESP8266 Wi-Fi Module | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





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

sp_Feed sp_TopicIcon
Can't send data via mobile data
No permission to create posts
January 21, 2018
11:33 am
Avatar
Atex
New Member
Members
Forum Posts: 2
Member Since:
January 19, 2018
sp_UserOfflineSmall Offline

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?

January 21, 2018
6:59 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 258
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

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?

January 22, 2018
10:47 am
Avatar
Atex
New Member
Members
Forum Posts: 2
Member Since:
January 19, 2018
sp_UserOfflineSmall Offline

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:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

JamesVex, meghanfr69, raqueldk69, soniafw2, vitalijDrine, JosephAmapy

Administrators: Hans: 387, lee: 457