- Thu Nov 10, 2016 3:51 pm
#57945
You can't stop the ESP_Basic interpreters serial port startup and connection information, so obviously anything connected to the serial port is going to receive that diagnostic information irrespective of whether it's a serial terminal or a pic.
Using serial2 would definitely avoid that problem, because the serial2 port does not even exist at startup - it only exists when defined in software by the running program, and no diagnostics info is ever directed out through it, only any info that your script is programmed to send out.
But you say you've already tried serial2 without it making any difference, so there are now too many contradictions for me to know what are the actual symptoms anymore, and perhaps your own assessment is being swayed by entrenched suspicions... for instance, you say you have been using a relay to connect up your serial data line, but contact bounce is highly likely to appear as spurious data corruption on re-connection anyway, so even if the original problem had been fixed it may have gone un-noticed.
I can only suggest that you start again with an open mind to pinpoint whether the problem is actually caused by unwanted data being sent from the ESP - and if so, WHEN - or is the pic possibly misinterpreting data.
The easy way of knowing for sure is to use the serial monitor in place of the pic to see what's being sent, and also to emulate whatever pic responses should be returned.
Either you will find evidence of unwanted data being transmitted by the ESP, or not.
If so, then you will also know when, which should offer a better clue to how and why.
Getting rid of the relay (use some sort of pic Enable if necessary), and using serial2 instead of the hardware serial port, would eliminate potential causes of trouble.