Impee-Kelly Reference Design

Trying to read serial text that is
\r terminated. I am able to read the text coming from my test unit using the Impee-Kelly reference design, however all the text lines run together. I was hoping to use
\r to start a new line of text.

Any code examples or ideas on how to use
\r to get individual lines of text. Thanks.

Try this:

`// Buffer for incoming line
line <- “”;

function rx() {
local d =;
while(d >= 0) {
if (d>=’ ‘) line += d.tochar();
if (d==’\r’) {

// set up uart on pins 8/9, with an RX handler
uart <- hardware.uart1289;
uart.configure(9600, 8, PARITY_NONE, 1, NO_CTSRTS, rx);

Yes this works very well.

Thanks for the help.

I have the code shown below running using the Impee-Kelly reference design.
When running agent code Xively does not updated with each \r
. I suspect its running to fast for Xivley to keep up?

I get the “Messages trottled” message on the IDE.

Is there a good way to slow things down. Or do I have something else hosed.
Device code:

imp.configure(“Cloud Serial Cable”,[],[]);

line <- “”;

function rx() {
local d =;

while (d >= 0) {
    if (d >= ' ') line += d.tochar();
    if (d =='\\r') {
       // server.log("UDA message: " + line);
        agent.send("Xively", line); //send string to agent
    d =;


// Configure UART

uart <- hardware.uart1289;
uart.configure(57600, 8, PARITY_NONE, 1, NO_CTSRTS ,rx);

Agent code is from reference design using MAX31855.

Xively doesn’t like being sent data more than (from memory) once every 5 seconds on a free account. How often are you sending?

If it’s bursty, you can always queue the data in the agent and dribble it out to xively?