Lower memory use for updating channel | Arduino | 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
Lower memory use for updating channel
No permission to create posts
May 8, 2019
10:44 pm
Avatar
PEU
New Member
Members
Forum Posts: 1
Member Since:
May 8, 2019
sp_UserOfflineSmall Offline

Hi, I want to know if its possible to lower the memory usage of the library, I just want to update two fields, Im using arduino uno + esp01 board, the write multiple fields via AT example file, it works as expected but eats " 21358 bytes (66%) of program storage space. Maximum is 32256 bytes."
Is it possible to disable functions, such as reading from thingspeak and others to save memory?

Thanks

May 10, 2019
9:14 am
Avatar
JasonW

MathWorks
Members
Forum Posts: 54
Member Since:
October 21, 2016
sp_UserOfflineSmall Offline

Disabling functions in the ThingSpeak library code won't reduce the compile size. The compiler is very efficient already. If a function isn't used by the application, then it leaves it out completely.

The writeFields (with an "s") function is particularly large because it handles any possible field you might want to update. Using writeField (without an "s") instead can save you a few kilobytes. Of course this becomes a challenge when updating 2 fields. If you want to try that, I would suggest putting field1 in one channel and field2 in a second channel. Then you can update them at approximately the same time without hitting the update rate limit imposed on a single channel.

May 10, 2019
9:24 am
Avatar
cstapels
Moderator
Members


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

While we definitely recommend using the library as much as possible, you can communicate with ThingSpeak without the library if you need to. The moisture monitor example shows how to create a POST and get the response without using the library.
https://www.mathworks.com/help/thingspeak/MoistureMonitor.html

There is not yet an AT command example however, so that will make the coding without the library slightly harder too. You may also be able to consider using the ESP-01 directly without the uno. It has several I/o but no ADC available without serious soldering. You can program it directly from the arduino IDE using the UNO as a programmer.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
32 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

Fathima22, jefflam1994, harrydawson, markpaul7931, sgarsvk2rdx, Win Win

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457