Closed Teddyz closed 1 year ago
Is it possible to use __FlashStringHelper with publish function?
I Wish I knew. I still haven't found why the MQTT library happily accept F()encoded arguments but I cannot make this mqpub() work. There is information about this here https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html, but I still do not understand how to do it.
Closing as stale, please reopen if issue persists.
I would like to know if publishing fails. My .publish() are all over the code, so I thought I should centralize them to one or a few places called mqpub() where I can publish and also check for errors. ( I plan to later use mqpub() to save important failed messages to files, so they can be sent when connection to broker is restored. )
My problem comes when I want to publish anything that is stored in Flash:
The first line works, but the second will not compile with error: cannot convert 'const __FlashStringHelper' to 'const char' for argument '1' to 'void mqpub(const char, const char)'.
Is there a simple work-around for this?