-
Notifications
You must be signed in to change notification settings - Fork 150
Description
As promised:
I'm happy to look at any feature PRs, and your feature sounds useful. I certainly think the ability to view the serial output remotely, including in the UI would be a nice feature to have for debugging and monitoring. Others have expressed an interest in taking this further with "remote terminals" too.
In fact, I've attempted to do this in the past with limited success and there's some work in various branches which never made it's way into master. This thread has details of some of my attempts:
I know that @proddy's project has developed a unified remote terminal over telnet/serial successfully, see project:
https://github.com/proddy/EMS-ESP
And I also know of projects such as the following which aim to support capture and transmission of Serial over TCP and/or WebSockets:
https://github.com/ayushsharma82/WebSerial
https://github.com/jeelabs/esp-link
https://github.com/JoaoLopesF/RemoteDebugThe second example (ESP-LINK) probably does the closest thing to what I was hoping to achieve.
I never reached an ideal solution, especially on the esp8266 which has such limited RAM. Failures such as dropped messages and buffer overflows were all too common for me, especially over WebSockets which always seems to have a very low transmission rate with the ESPAsyncWebServer. It worked much better on esp32 where there's more RAM.
I'm admittedly a C++ developer of only intermediate skill, and someone with more experience may be able to have a better crack at it, or at very least make code which fails more gracefully. I know what I wanted out of this feature, and I wonder how that fits in with what you are attempting to do. For me the key points were:
- Abstraction for logging - so logging can be redirected as required (freeing the Serial for use as a terminal if required).
- Persistent rolling logging to the FS - so a limited amount (configurable) of logs may be viewed later
- Secure - No insecure open ports
Perhaps this is too much of a wish list to be sensible... what are your thoughts/goals for this feature?
Many thanks for all the pointers. Some stuff I've already seen, some looks very interesting. I will definetly look into it
Unfortunately, I would class myself as a C++ developer with just enough knowledge to know what not to start on. Anyhow, my goals are somewhat similar to esp-link. As in create a simple serial to tcp bridge (and back). My ideas were:
- create a serialservice that opens a Serial.begin on a (configurable for esp32) pin.
- Allow for clients to be registered, returning a buffered stream object .
- create a stream_server that takes a stream object and transmits it over tcp
In my final application I want to utilize an m5stickc to read out my dutch utilities smart meter. All these smart meters come with a serial port which can be used to feed data into a smarthome application. I already have some working prototypes at friend's and family's houses.
The reason for requiring a serialservice is that I eventually also want to create an MQTT service for automatically logging the data as sensors to home assistant using autoconfigure. More,over include some internal sensors such as battery level. The reason for this is that some meters only supply 100ma from their ports so they need some efficiency tweaking.