CMD = "SMS";
Does this make sense? Print the value in CMD, and then immediately assign it a new value. Why? Why does the old value matter?
if(CMD == "RES")
//dann Arduino schlafen legen
The address of CMD will NEVER be equal to the memory location of the string literal.
Even if this were the way to compare strings, what do you suppose the chances are that "SMS" would equal "RES"?
dateANDtime = (char*)malloc(19);
SendMeasurement(Temperatur(), "TMP", sID, dateANDtime);
It would be orders of magnitude better to declare a statically sized array ONCE than to do all this dynamic memory allocation of statically sized blocks of data.
C allows you to shoot yourself in the foot, if you want. Why you would want to is a mystery. You are NOT dynamically allocating memory for CMD, so freeing it is stupid.
//Imput am Pin A2 einlesen
int sensorValueA2 = analogRead(A2);
//Den Analogen Wert (welcher von 0 - 1023 reicht) in eine Spanung (0 - 5V) umrechnen
float Niederschlag = sensorValueA2 * (5.0 / 1023.0);
if (sensorValueA2 == 5)
Why is this function defined to return a float, but the return statements return byte values? Why is it necessary to send the 0 or 1 value, using SendMeasurement() in loop()? Seems to me like it would be far more useful to have this function return Niederschlag, and send THAT.
The magic numbers in your code should be replaced with #define names, so that there is some logical explanation for the values.
//Größe für den Sendestring
size_t mSize = 8+strlen(unit)+strlen(sID)+strlen(DandT);
char *data = (char*)malloc(mSize);
char *temp = (char*)malloc(4);
More unnecessary dynamic memory allocation. Use static arrays that are large enough to hold the longest value you are likely to encounter.
You fail to free temp later on, so you've built a memory leak into your program.