ESP8266 already in flash mode, still getting "timed out waiting for packet header" error message

  • Thread starter Deleted member 750607
  • Start date

Thread Starter

Deleted member 750607

Joined Dec 31, 1969
0
It's really not that hard. You just have to one step at a time. You need to figure out how the program flow works. If I "fix it" for you, you aren't going to be able to fix the next thing. I am happy to answer questions about your attempts to make it work differently, but keep in mind, it's not broken. The code is running as it was written.

You need to think about changing the program flow to act the way you want. If there is an error condition you can fix that, if the code is written to do something different than you want, you need to rewrite it.
I don't understand this line and can't find its meaning on the internet... what is pad/padDigits
Code:
String padDigits(int digit)
this is more context...

Code:
String padDigits(int digit)
{
  String str = String("0") + digit; //put a zero in front of digit
  return str.substring(str.length() - 2);
}
 
Last edited by a moderator:

Ya’akov

Joined Jan 27, 2019
10,263
I don't understand this line and can't find its meaning on the internet... what is pad/padDigits
Code:
String padDigits(int digit)
It is just what it says in the code it contains. It is being defined there. That’s a function, defined there and used elsewhere in the program. Look what the code inside it does and look where in the program it is called. (Up above)
 

ericgibbs

Joined Jan 29, 2010
21,487
hi h91,
Simplified version of that code block.
E
C++:
String test ="";
int digit1=12;
int digit2=345;

void setup() {
Serial.begin(9600);
}
void loop() {
  Serial.print(digit1);
  String str1 = String("0") + digit1;
  Serial.print("  ");
  Serial.println(str1);
 
  Serial.print(digit2);
    Serial.print("  ");
  String str2 = String("+00") + digit2; 
  Serial.println(str2);

 digit1= digit1+1;
 digit2= digit2+1;
 delay(5000);
}
 

Attachments

Top