10:44 pm

May 8, 2019

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
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.
9:24 am


Moderators
March 7, 2017

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.
Most Users Ever Online: 166
Currently Online:
18 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:
estebanmateo93, mikewrite, onlinebusiness, winzy99, Zark_zeugan, StefanWiModerators: cstapels: 460
Administrators: Hans: 405, lee: 457