Report Bugs Here

Moderator: Mmiscool

User avatar
By Electroguard
#57891
...when this connection is made the ESP sends a lot of data (nonsense) and the pic sometimes hangs. When it does not crash I can send data to it to treat it the way I want.
My question, why does ESPbasic send "stuff" to the serial without me asking?

I don't know how to fix your problem, I only know what steps I might take myself, based on what you have said:

First, I have previously discovered (and posted) that if the gpio01 led is addressed in the script it will mess up the serial port. A GPIO1RESET() command was added way back in V2 to deal with the problem, but when I tried using it recently it didn't prevent my serial port from continuing to send unwanted characters.

If this is the cause of your problem it can be easily confirmed by commenting out any reference to the gpio01 led, powering the ESP off/on for a clean reboot, then checking for serial rubbish again.

If the serial port is still generating spurious characters, and you can rule out it being pushed too fast, then that leaves the possibility of either a serial fault or a hardware fault.

I assume you have more than 1 ESP device and are in a position to try a different ESP... it doesn't need to be an exact replacement for the purposes of substitution, merely something to run your script on an alternative serial port.

If the unwanted characters still persist on a different device, then either there is a script problem, or an environmental problem (garbage being induced into serial cables by high EMF).

If the unwanted characters have stopped, then the script must be ok and the problem must be with the original ESP device.

Rule out corrupted flash or interpreter by reformatting then reflashing the device.

If the unwanted characters still persist, there must be something wrong with the ESP hardware.


If I suspected I had found the problem during any of the steps above, I would confirm it by using a second ESP as a serial monitor to the first and have it flag an alert if receiving any 'unplanned' characters, and only after gaining confidence would I continue with the 'blind' pic again.
User avatar
By rodrigocirilo
#57892
Electroguard wrote:
...when this connection is made the ESP sends a lot of data (nonsense) and the pic sometimes hangs. When it does not crash I can send data to it to treat it the way I want.
My question, why does ESPbasic send "stuff" to the serial without me asking?

I don't know how to fix your problem, I only know what steps I might take myself, based on what you have said:

First, I have previously discovered (and posted) that if the gpio01 led is addressed in the script it will mess up the serial port. A GPIO1RESET() command was added way back in V2 to deal with the problem, but when I tried using it recently it didn't prevent my serial port from continuing to send unwanted characters.

If this is the cause of your problem it can be easily confirmed by commenting out any reference to the gpio01 led, powering the ESP off/on for a clean reboot, then checking for serial rubbish again.

If the serial port is still generating spurious characters, and you can rule out it being pushed too fast, then that leaves the possibility of either a serial fault or a hardware fault.

I assume you have more than 1 ESP device and are in a position to try a different ESP... it doesn't need to be an exact replacement for the purposes of substitution, merely something to run your script on an alternative serial port.

If the unwanted characters still persist on a different device, then either there is a script problem, or an environmental problem (garbage being induced into serial cables by high EMF).

If the unwanted characters have stopped, then the script must be ok and the problem must be with the original ESP device.

Rule out corrupted flash or interpreter by reformatting then reflashing the device.

If the unwanted characters still persist, there must be something wrong with the ESP hardware.


If I suspected I had found the problem during any of the steps above, I would confirm it by using a second ESP as a serial monitor to the first and have it flag an alert if receiving any 'unplanned' characters, and only after gaining confidence would I continue with the 'blind' pic again.



Thanks for answering..

I have nothing in the code related to gpio01.

I will re-record the esp and see what happens ..
User avatar
By Electroguard
#57894 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.