Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{ "code": 400, "message": "Payload contains invalid json" } #14

Open
KoRba88 opened this issue Jul 11, 2018 · 3 comments
Open

{ "code": 400, "message": "Payload contains invalid json" } #14

KoRba88 opened this issue Jul 11, 2018 · 3 comments

Comments

@KoRba88
Copy link

KoRba88 commented Jul 11, 2018

Hi

When my ESP32 want to Publish message: Hello world, In the activity tab on my thing I only see this messege

{
"code": 400,
"message": "Payload contains invalid json"
}

@copercini
Copy link
Owner

probably your message has a problem with json formatting

@KoRba88
Copy link
Author

KoRba88 commented Jul 15, 2018

Yes, I know it but why? I didn't made any changes in the provided example sketch so it should work.

Also using MQTT.fx client i see this messege and i can publish nothing.

@copercini
Copy link
Owner

copercini commented Dec 3, 2018

Sorry for the late answer, it's sending Hello world 1 as message that isn't JSON formatted

you can fix it changing this line to snprintf (msg, 75, "{\"Hello world\":\"#%ld\"}", value);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants