jeelabs / esp-link

esp8266 wifi-serial bridge, outbound TCP, and arduino/AVR/LPC/NXP programmer
Other
2.82k stars 720 forks source link

SLIP-syslog command to send debug message from µC #433

Open wolfgangr opened 5 years ago

wolfgangr commented 5 years ago

https://github.com/jeelabs/esp-link/blob/fe4f565fe83f05e402cc8d8ca3ceefbc39692a1f/README.md#esp-link-goals says

rather it implements mostly higher-level functionality to offload the attached uC

I think writing a debug message to the syslog server might be an obvious candidate to offload.

In a IoT environment, like in any IT system, there may hidden problems build up before something really badly fails. A logfile is the natural central point of maintenance to watch any complex installation for such accrueing problems.

So it was a good idea to report pains of ESP-Link there. But giving the main processor the chance to do so as well, imho would be a consequent expansion along this line.

Probably, as a workaround, it were possible to send syslog messages using the slip UDP / TCP facility. But then the µC had to assemble the message, requiring ram-hungry string operations, managing the address of the server which is configured on ESP-Link anyway. And all that maybe in a situation of trouble, where debug messages are usually desired at most.

I don't find a syslog command in cmd.h.

I see an event queue and functions to compose and add entries in syslog.c

So may be the implementation could be quite straighforward for somebody familiar with ESP-link's codebase ;-)

uzi18 commented 5 years ago

nice idea :)