String data disappears?

Hi everyone. Having a slit issue here. When I download and write to a string data in Sram, I can serial.print the data that is added to the String. Once I close out of the terminal program and reopen the string data is gone. I am hoping that I do not have to save it to EEPROM as that limits the amount I can write. Is there a way to keep the String data in tact until I at least shut off the arduino device?

Once I close out of the terminal program and reopen the string data is gone.

What does this mean? Gone from the terminal display, gone from the Arduino (not likely)? Gone from where? If you closed the terminal you will have reprint the string.

So please explain better what is happening.


Rob

That is exactly right. When I close any terminal program I have to reprint the string. I was under the assumption the string stays in place until the system is shut off and loses power. So my question is, if I send data through serial.read() to the Arduino and it writes a string, how can I keep that information after i disconnect it from a serial connection?

Also, to explain the application, Arduino connects to computer, Recieves a list like this ( 123456789865432, 12B, Garage Door ) quite a few of them. And I wanted it to save. Once it saves, I can pull from that string anytime I use a 1 wire iButton reader, it matches the S/N and will print on an LCD the "Unit 12B Garage Door".

Is this the easiest way to download the data without having to flash it? I just started reading about aJson... but I dont know much about it.

JSON on an Arduino?, time to get real :slight_smile:

When I close any terminal program I have to reprint the string

Why would you expect a program (the terminal prog) to remember what was on the screen last time it was used?

I was under the assumption the string stays in place until the system is shut off and loses power.

Correct, and that place is the internal RAM of the Arduino, not the terminal program window.

Your strings are quite safe in RAM until you power off, just use them as you see fit. The presence or absence of the serial connection has no bearing on the matter.


Rob

So I was given the answer. Everytime you restart a terminal program it trips the DTR pin, and that resets the device thus loosing my string. I added a 220ohm resistor from 3.3 to rst pin and bypassed the DTR trip. Now everytime I open a serial window, I am seeing the values.

This was the only info I had on json

it trips the DTR pin, and that resets the device thus loosing my string

Ah yes there is that, sorry I forgot, I usually disable auto reset.


Rob