Hello, you guys might think I'm highjacking this forum, but this is not my goal
I want to use an ESP32 to publish data to Thinkspeak.
I have an API key to write and read.
The URL is: api.thingspeak.com according to the site.
I have an channel ID....
What else do I need?
From the examples I found on the FC8.. forum, I found out I need to use the MQTT component.
This component has mqtt.thingspeak.com as standard value for the host, I think I must change this one into the above.
But where do I need to enter the write key? The "topic"?
The setup I have right now is this:
So I guess that now it's as simple as publishing a topic and payload?
Does anyone have a working example for me to investigate?.
Thanks again.
MQTT with Thingspeak
-
- Posts: 285
- http://meble-kuchenne.info.pl
- Joined: Tue Dec 08, 2020 5:11 pm
- Has thanked: 81 times
- Been thanked: 60 times
Re: MQTT with Thingspeak
After reading this: https://nl.mathworks.com/help/thingspea ... annel.html
And using these settings:
I still don't see the data I send appear on Thingspeak..
Am I using the right credentials?
Any help is welcome..
And using these settings:
I still don't see the data I send appear on Thingspeak..
Am I using the right credentials?
Any help is welcome..
-
- Matrix Staff
- Posts: 1384
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 184 times
- Been thanked: 322 times
Re: MQTT with Thingspeak
Personally I haven't, sorry. But also bear in mind a lot of people don't work over the Xmas holidays and so you might not get a quick answer.
Re: MQTT with Thingspeak
And I really hope that they enjoy their holidays!Steve-Matrix wrote: ↑Thu Dec 30, 2021 11:33 amPersonally I haven't, sorry. But also bear in mind a lot of people don't work over the Xmas holidays and so you might not get a quick answer.
I know what you mean Steve, I have a small vacation too and that's why I started playing with FC again.
I really hoped that there would grow a community around Flowcode (like in the good old days ).
But besides a few brilliant people on this forum things keep quiet sometimes.
The Wiki is great for many purposes, but for some projects I would be nice to have a little more examples.
My hope is that (like I did in the past), that people would share their knowledge and projects here for everybody to investigate.
So I would really want to ask again: has anyone used Thingspeak with Flowcode and wants to share its knowledge with others?
Maybe a good new year resolution?
-
- Valued Contributor
- Posts: 411
- Joined: Mon Dec 07, 2020 1:00 pm
- Has thanked: 76 times
- Been thanked: 226 times
Re: MQTT with Thingspeak
There were some demo examples done some time (years?) ago. Some can be found with a search of the forums.
Since then I think Thinkspeak have limited connections to secure ones, I don't know if this applies to the MQTT service. If it does then the Flowcode component would only work on hardware with secure network support, such as Raspberry pi.
I don't think you have mentioned what you are running on?
I would suggest adding some debug code and check the return values from the various MQTT component macro/functions. Hence determine if it is the initial connection or the publish that is failing.
Sorry can't offer any more detailed help at the moment.
Since then I think Thinkspeak have limited connections to secure ones, I don't know if this applies to the MQTT service. If it does then the Flowcode component would only work on hardware with secure network support, such as Raspberry pi.
I don't think you have mentioned what you are running on?
I would suggest adding some debug code and check the return values from the various MQTT component macro/functions. Hence determine if it is the initial connection or the publish that is failing.
Sorry can't offer any more detailed help at the moment.
Re: MQTT with Thingspeak
Thanks Leigh and Steve,
First of all I want to wish you a happy new year!
I'm using a ESP32wroom32 module with only a temp sensor attached in the hope I could get started without extra hardware (displays and stuff).
I thought that I would start without hiccups with Flowcode9, but there are still unexplored pieces to this new version.
I hoped that the community would have grown (like Alfie is trying), and that there would be much more reply's on the forum.
But ok..
I have a FC8 file that I used to get data from a website with the ClientConnect macro.
I think I will be able to post data with the GET command. I've tried it by entering a URL in a browser like this:
And this is accepted by Thinkspeak.
So what's the way to send this GET command (the whole string) in Flowcode 9?
I have tried the Network Comms "connect" macro with this address "https://api.thingspeak.com/update?api_k ... &field1=17"
But again it isn't received..
So the whole data and address is contained in the URL and I only have to send this request to the URL and Thingspeak usese the value for field1 to process.
First of all I want to wish you a happy new year!
I'm using a ESP32wroom32 module with only a temp sensor attached in the hope I could get started without extra hardware (displays and stuff).
I thought that I would start without hiccups with Flowcode9, but there are still unexplored pieces to this new version.
I hoped that the community would have grown (like Alfie is trying), and that there would be much more reply's on the forum.
But ok..
I have a FC8 file that I used to get data from a website with the ClientConnect macro.
I think I will be able to post data with the GET command. I've tried it by entering a URL in a browser like this:
Code: Select all
https://api.thingspeak.com/update?api_key=CUSFQINNUhgefeUZ&field1=17
So what's the way to send this GET command (the whole string) in Flowcode 9?
I have tried the Network Comms "connect" macro with this address "https://api.thingspeak.com/update?api_k ... &field1=17"
But again it isn't received..
So the whole data and address is contained in the URL and I only have to send this request to the URL and Thingspeak usese the value for field1 to process.
-
- Matrix Staff
- Posts: 1895
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 491 times
- Been thanked: 664 times
Re: MQTT with Thingspeak
Hello,
The clue here is the https in your URL.
https://api.thingspeak.com/update?api_k ... &field1=17
The data is being encrypted and as such Flowcode is currently not very capable of dealing with this. It's on our to do list and we have taken some steps towards it but it's not currently up and running.
Please can you try the http equivalent and see if this works?
http://api.thingspeak.com/update?api_ke ... &field1=17
The clue here is the https in your URL.
https://api.thingspeak.com/update?api_k ... &field1=17
The data is being encrypted and as such Flowcode is currently not very capable of dealing with this. It's on our to do list and we have taken some steps towards it but it's not currently up and running.
Please can you try the http equivalent and see if this works?
http://api.thingspeak.com/update?api_ke ... &field1=17
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: MQTT with Thingspeak
Thanks guys,
Better yet, I tamed Thingspeak
I will share my working project one of these days with this forum.
Then other people can learn and improve it.
Thanks for your input.
BTW: if I use this code in a browser, it works. But I couldn't get it to work in FC.
Maybe someone else could investigate this.
Now I will start working on a description of how I got Thingspeak working with FC9 MQTT..
Better yet, I tamed Thingspeak
I will share my working project one of these days with this forum.
Then other people can learn and improve it.
Thanks for your input.
BTW: if I use this code in a browser, it works. But I couldn't get it to work in FC.
Code: Select all
https://api.thingspeak.com/update?api_key=CUSFQINNUhgefeUZ&field1=17
Now I will start working on a description of how I got Thingspeak working with FC9 MQTT..