Skip to main content

This code looks wrong:

  command = malloc(26);
  command = "AT+CIPSSEND";
  strcat(command, number);
  strcat(command, ",");
  strcat(command, length_of_payload);
  send_wlan_chip_command(command);

First you allocate 26 bytes, thanthen a new string is created, which you strcat to it. This happens in memory that is not allocated (or overwrites other data).

Instead of

  command = "AT+CIPSSEND";

use

  strcpy(command, "AT+CIPSSEND";"AT+CIPSSEND");

Also check ifthat 26 bytes is enough, makechange it to 128 bytes to be sure (later checkcheck the correct amount you need later).

This code looks wrong:

  command = malloc(26);
  command = "AT+CIPSSEND";
  strcat(command, number);
  strcat(command, ",");
  strcat(command, length_of_payload);
  send_wlan_chip_command(command);

First you allocate 26 bytes, than a new string is created, which you strcat to it. This happens in memory that is not allocated (or overwrites other data).

Instead of

  command = "AT+CIPSSEND";

use

  strcpy(command, "AT+CIPSSEND";

Also check if 26 bytes is enough, make it 128 to be sure (later check the correct amount you need).

This code looks wrong:

  command = malloc(26);
  command = "AT+CIPSSEND";
  strcat(command, number);
  strcat(command, ",");
  strcat(command, length_of_payload);
  send_wlan_chip_command(command);

First you allocate 26 bytes, then a new string is created, which you strcat to it. This happens in memory that is not allocated (or overwrites other data).

Instead of

  command = "AT+CIPSSEND";

use

  strcpy(command, "AT+CIPSSEND");

Also check that 26 bytes is enough, change it to 128 bytes to be sure (check the correct amount you need later).

deleted 5 characters in body
Source Link
Michel Keijzers
  • 13k
  • 7
  • 42
  • 59

This code looks suspiciouswrong:

  command = malloc(26);
  command = "AT+CIPSSEND";
  strcat(command, number);
  strcat(command, ",");
  strcat(command, length_of_payload);
  send_wlan_chip_command(command);

First you allocate 26 bytes, than a new string is created, which you strcat to it. This happens in memory that is not allocated (or overwrites other data).

Instead of

  command = "AT+CIPSSEND";

use

  strcatstrcpy(command, "AT+CIPSSEND";

Also check if 26 bytes is enough, make it 128 to be sure (later check the correct amount you need).

This code looks suspicious:

  command = malloc(26);
  command = "AT+CIPSSEND";
  strcat(command, number);
  strcat(command, ",");
  strcat(command, length_of_payload);
  send_wlan_chip_command(command);

First you allocate 26 bytes, than a new string is created, which you strcat to it. This happens in memory that is not allocated (or overwrites other data).

Instead of

  command = "AT+CIPSSEND";

use

  strcat(command, "AT+CIPSSEND";

Also check if 26 bytes is enough, make it 128 to be sure (later check the correct amount you need).

This code looks wrong:

  command = malloc(26);
  command = "AT+CIPSSEND";
  strcat(command, number);
  strcat(command, ",");
  strcat(command, length_of_payload);
  send_wlan_chip_command(command);

First you allocate 26 bytes, than a new string is created, which you strcat to it. This happens in memory that is not allocated (or overwrites other data).

Instead of

  command = "AT+CIPSSEND";

use

  strcpy(command, "AT+CIPSSEND";

Also check if 26 bytes is enough, make it 128 to be sure (later check the correct amount you need).

Source Link
Michel Keijzers
  • 13k
  • 7
  • 42
  • 59

This code looks suspicious:

  command = malloc(26);
  command = "AT+CIPSSEND";
  strcat(command, number);
  strcat(command, ",");
  strcat(command, length_of_payload);
  send_wlan_chip_command(command);

First you allocate 26 bytes, than a new string is created, which you strcat to it. This happens in memory that is not allocated (or overwrites other data).

Instead of

  command = "AT+CIPSSEND";

use

  strcat(command, "AT+CIPSSEND";

Also check if 26 bytes is enough, make it 128 to be sure (later check the correct amount you need).