Go Down

Topic: ESP8266 - ESP13 "Cannot initialize ESP module" from "BasicTest.ino" (Read 9390 times) previous topic - next topic

Smithford

Note:  with the dip switches to ON, nothing at all comes from Serial1 and in fact the "Serial1.available()" test returns false.

This sketch:
Code: [Select]

int x;

void setup() {
  // initialize both serial ports:
  Serial.begin(9600);
  Serial1.begin(9600);
  x=0;
}

void loop() {
  x++;
  // read from port 1, send to port 0:
  Serial1.write("hello\n");
  if (Serial1.available()) {
    int inByte = Serial1.read();
    Serial.write(inByte);
  }
  Serial1.flush();
  if(x>200){
    while(true);
  }
}


Gives:
Code: [Select]

⸮⸮⸮鱱⸮)hel⸮hell⸮)h⸮⸮)he⸮⸮⸮鱱⸮)hel⸮hell⸮)h⸮⸮)he⸮⸮⸮⸮⸮⸮⸮)⸮⸮⸮hell⸮)h⸮⸮)he⸮⸮˱⸮⸮)⸮⸮⸮hell⸮K⸮h⸮!⸮h⸮h⸮!⸮h⸮hY⸮!⸮h⸮hY⸮!⸮h⸮Y⸮
hl⸮e⸮
hl⸮e


Should that be the case?  Looks like a bunch of garbage.

pert

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code] // your code is here [/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Change the line:
Code: [Select]
  Serial1.begin(9600);
to:
Code: [Select]
  Serial1.begin(115200);
the AT firmware is set for communication at 115200 by default so unless you've used an AT command to change the baud rate that's probably the cause of your problem using the WiFiEsp library.

Smithford

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code] // your code is here [/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Change the line:
Code: [Select]
  Serial1.begin(9600);
to:
Code: [Select]
  Serial1.begin(115200);
the AT firmware is set for communication at 115200 by default so unless you've used an AT command to change the baud rate that's probably the cause of your problem using the WiFiEsp library.
This I have already tried.  But I am glad trying it was a viable attempt.  Maybe I am not flailing about aimlessly as much as I thought.


Smithford

And what happened?
Not as much garbage...

Code: [Select]

hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
hello
helhhh⸮⸮⸮⸮)hello
helhhhhhhhhhhhhhhhhh
hello
hello
hhhhhhh}⸮hhhhhhhh⸮)hello
hello
hhhhhhh⸮hehhhhhhhh⸮⸮K⸮⸮⸮⸮)hellohhhhhh⸮hehhhh

Smithford

And I have tried this

Code: [Select]

  Serial1.begin(9600);

  pinMode(19, INPUT); 
  digitalWrite(19, HIGH);


as suggested for a GPS shield at
stackoverflow : arduino-mega-receiving-correct-data-through-serial-0-but-not-serial-1-3


Smithford

And I have tried this

Code: [Select]

  Serial1.begin(9600);

  pinMode(19, INPUT); 
  digitalWrite(19, HIGH);


as suggested for a GPS shield at
stackoverflow : arduino-mega-receiving-correct-data-through-serial-0-but-not-serial-1-3


And, this also did not work...

Juraj

again, you can't use USB (COM, Serial Monitor) and something connected to serial at the same time. pins 0/1 RX/TX are 'Serial' and it is connected to USB 

Go Up