String::format will not format strings correctly for Publish data

You need to use (const char*)b or c.c_str() since sprintf() (which is used for formatting) will not accept String objects but only const char* for the %s place holder.

When stating something like this it's always also advisable to quote the actual compile error to see why it wouldn't.

2 Likes