This sketch is set up to use a pre-defined stream –
DJjNowwjgxFR9ogvr45Q. Feel free to use that for testing, but don’t abuse it
or rely on it too much (it’s very possible our powers combined will exceed
the post limit). This example gathers the Arduino’s analog pin values and
posts all six of them to the stream.
To run the sketch, open the serial monitor and send any character to start a
post.
Any response from the HTTP server will be routed back out to the serial
monitor. Look for “HTTP/1.1 200 OK” to verify that the post was successful.
You should also see an updated set of numbers on the stream page.
As the sketch continues to run, you can send another character over serial
to initiate a new post. Just take care to only send one character at a time –
and don’t abuse the strem!
Memory Limitations
The MG2639 library can really test the limits of the Arduino’s memory.
You’ll notice that in most of these examples we put large, constant strings
in flash (e.g.
Serial.println(F("Hello, world"));
). In this example we’re
also storing the Phant field strings in flash.
You’ll notice that most of these examples sacrifice flash storage space for
as much SRAM as we can get. If your sketch mysteriously resets, or isn’t
working as you’d expect, you may be running out of memory. It can be a
diabolically hard problem to diagnose and fix, but start with trying to
eliminate big strings and large arrays.
Resources & Going Further
We hope you’ll enjoy creating with the MG2639 Cellular Shield. If you have
any questions about the board itself, these resources may be helpful:
• MG2639 Cellular Shield GitHub Repository
• MG2639 AT Command Manual
• MG2639 Hardware Design Manual
Page 21 of 22