Report Bugs Here

Moderator: Mmiscool

User avatar
By rodrigocirilo
#57895
Electroguard wrote:When I said gpio01 I was referring to the onboard blue TX led, so as you are using a nodeMCU you need to translate that to its TX led equivalent (D10?).

You could try testing using serial2 instead of serial port - if the unwanted characters still come out on serial port rather than switching to serial2 it could help pinpoint the source of the problem.



I switched to serial2, but the same thing happened.
Now I updated my nodemcu with 3.0 60 and is no longer opening a wifi network for me to connect and change the IP :(

The blue LED is on the gpio 02 on the nodemcu.
User avatar
By Electroguard
#57897 Well, if unwanted characters were coming out on serial2, that shows they are either somehow being sent in error by the script, or else picked up as noise.

And don't be fooled by the apparent consistency of the end linefeed character - cos if you think about it, all serial characters are only sent by a linefeed character anyway, so it aint no coincidence there's always a LF at the end... even if it was just a result of random noise!

What would be a better indicator is how often the unwanted characters occur, how many characters come together, and how long the gap (if any) between transmissions... bearing in mind that if it was noise, the serial characters might be slowly acruing one by one until a random linefeed character caused them all to be transmitted together.

Check in VARS that all your variables are what you'd expect them to be, it's easy to
expect you're dealing with a number for instance, and find that somehow the var was incorrectly defined as text or vice versa. It's also easy to mis-spell a var and end up with 2 that are completely different, one the expected number and the other a text error.

There's still clues to be found yet, if you look in the right directions.
User avatar
By rodrigocirilo
#57918 Watch the video of the link.

https://www.youtube.com/watch?v=vsTsmD38oAk


Note that when connecting to the terminal it automatically sends information data. I think it's these data that I'm receiving unduly and it's messing me up.

MMiscool could help us here if this happens, because in my case when the ESP "sees" the pic in the serial it sends data and I'm suspecting that it is equal to 2:35 of the video.
User avatar
By Electroguard
#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.