MATLAB Answers

Thingspeak broker address not working

16 views (last 30 days)
JUDITH NJOKU
JUDITH NJOKU on 15 Feb 2021 at 12:31
Answered: Christopher Stapels on 16 Feb 2021 at 0:42
is it just me or is the broker address https://api.thingspeak.com/ not working?

  0 Comments

Sign in to comment.

Accepted Answer

Christopher Stapels
Christopher Stapels on 16 Feb 2021 at 0:42
The mqtt broker gives really limited messages. If you had parts of the format wrong for the subscribe method, it will probably just fail silently.
Read the documentation for MQTT closely to make sure the format is correct. I havent dont the simulink example, so I would reccomend you try mqttfx or the MATLAB based MQTT client (on FEX). Once you get the syntax correct using MQTTFX or MATLAB, its usually easier to make sure you enter the correct settings in blocks in simulink.
Sadly the RPI example in the thingSpeak doc has an outdated library (to do list), but it might give you a different starting point if the simulink version wont work.

  0 Comments

Sign in to comment.

More Answers (1)

Christopher Stapels
Christopher Stapels on 15 Feb 2021 at 13:52
It is working great across all of my many channels, I did not see a break near the time you posted this. What command did you try to send to the server?

  3 Comments

JUDITH NJOKU
JUDITH NJOKU on 16 Feb 2021 at 0:24
I have to input the broker address in the configuration settings. I replaced the already outdated mqtt.thingspeak.com with api.thingspeak.com and followed all the steps accordingly to no avail. meanwhile i was able to write to the thingspeak channel from the MATLAB command window.
Christopher Stapels
Christopher Stapels on 16 Feb 2021 at 0:28
api.thingspeak.com is the RESTful service. mqtt.thingspeak.com is the correct address for the mqtt broker. If you try that address in the config settings, what do you get?
JUDITH NJOKU
JUDITH NJOKU on 16 Feb 2021 at 0:32
I tried mqtt.thingspeak.com first. I only decided to change it when I could not receive any message on the Thingspeak channel.

Sign in to comment.

Tags

Communities

More Answers in the  ThingSpeak Community

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!