Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

TelnetSpy interferes with EMS bus communication on the ESP8266 #63

Closed
nomis opened this issue Feb 27, 2019 · 5 comments
Closed

TelnetSpy interferes with EMS bus communication on the ESP8266 #63

nomis opened this issue Feb 27, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@nomis
Copy link

nomis commented Feb 27, 2019

After much debugging the UART interrupt handler, I've discovered I need to initialise usedSer to NULL in lib/TelnetSpy/TelnetSpy.cpp otherwise the hardware Serial functions will overwrite the RX interrupt handler (as well as output messages over serial) and no messages will ever be received.

@nomis nomis added the bug Something isn't working label Feb 27, 2019
@proddy
Copy link
Collaborator

proddy commented Feb 27, 2019

that's correct. the hardware Serial uses the same UART0. This is why I built in the 'set serial' command which disables the EMS when Serial is enabled and had to use Telnet instead. Serial is only really used for debugging as you don't plug one end of the circuit into the EMS line and the other end into a PC. I also describe this in the documentation.

@proddy proddy closed this as completed Feb 27, 2019
@nomis
Copy link
Author

nomis commented Feb 27, 2019

Serial is set to off and it doesn't work properly. There is no interaction between the serial on/off setting and the TelnetSpy code.

@proddy
Copy link
Collaborator

proddy commented Feb 27, 2019

Check if you're using the latest version. This shouldn't happen. Line 146 of MyEsp.cpp should say:

        // finally if we don't want Serial anymore, turn it off
        if (!_use_serial) {
            Serial.println("Disabling serial port");
            Serial.flush();
            Serial.end();
            SerialAndTelnet.setSerial(NULL);
        } else {
            Serial.println("Using serial port output");
        }

If it still happens, create a case so I can reproduce it. Or try and fix it in the code.

@nomis
Copy link
Author

nomis commented Feb 28, 2019

Immediately above that code is the call to _wifi_callback which calls emsuart_init(). It's still using the serial output after it has been reconfigured.

@proddy
Copy link
Collaborator

proddy commented Feb 28, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants