Skip to content

Sending floating point and integer data through MQTT #336

Open
@mitra42

Description

I've got some sensors generating floating point and integer data. I'd like to send this over MQTT, and ideally without converting back and forth to the Ascii.

The docs have bool publish(const char topic[], const String &payload);
bool publish(const char topic[], const char payload[]);

I'm wondering if there is an accepted method of sending numbers (floating or int) over MQTT, and if so what it is.... I've tried searching for the answer in all the usual places, but I'm not finding it.

I also think it would be useful to have this in at least one of the examples.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions