Arduino acting strange after seme data send to the board

Hello,

I started to code a OBD simulator at gibhub.
https://github.com/thopiekar/OBDX-SIM

In the second revision requesting PID 01 MODE 0C worked great, but when I added some lines and tested it with my desktop application..
After a while the LED 13 turns on and the board is not responding anymore. The LED is not HIGH, but like sending DigitalWrite(125); to it.

Could you take a look at the code and tell me what's going wrong?

Here the comparison and the latest code: https://github.com/thopiekar/OBDX-SIM/commit/8d9ee9e00717d19defaa7ce84dc64500d21a19c8

You are using the String library which is known to cause lots of problems, in particular a sketch will suddenly lose its mind and then "After a while the LED 13 turns on and the board is not responding anymore".
Rewrite your code so that it does not use the String library. You might also have to move more of your constant data into PROGMEM but fix up the String problem first.

Pete

Many thanks! I wasn't using "String" from the beginning, but when I got into problems returning strings I searched the web and decided to make a use of "String"..

Are there maybe already patches online to fix "String"? It works great in my case, except of this problem :roll_eyes:

There was a recent thread on that very subject but I forget what the title was. Try searching the forums for "string free bug" or something similar.

Pete

Are there maybe already patches online to fix "String"? It works great in my case, except of this problem

Sure. Highlight all String uses in your program, and hit the delete key. I presume that "this problem" is memory exhaustion/corruption. Stop using the String class, and that will stop happening.

Nothing that the String class does can not be done using strings.

Hoped for another answer, but thanks! It seems that I'll need to invest more time in it ]:slight_smile: