ThingSpeak - MATLAB Central Discussions
Accedi per partecipare

stefano in Discussions
Ultima attività il 7 Ago 2025 alle 1:39

Sending temperature and humidity values to a thingSpeak channel using a NodeMCU(esp8266) and the ThingSpeak library. The problem is that the graphs do not update dynamically even if values are sent and received regularly. To update the graphs I have to refresh the page every time. The numeric displays and other widgets update regularly. How can I solve the problem? Graphs do not update dynamically I just did a quick scan this morning, the public view of the channel seems to udate with data for the field charts.Im not sure about the private view, it does seem to be lagging. I was able to observe this effect in an old channel I have, but not with a new channel. The recent bug that makes it impossible to change the chart settings may be at play here. If you chart was set to a slower refresh time, or had included longer averaging, the data might not refesh as you expect. When I created a brand new channel, I did not observe the same effect. So there are several temporary workarounds. I'm not sure if creating new field charts in your old channel will work, but certainly creating a completely new channel worked for me. If you do try creating new field charts in your channel, can you let us know how it goes here? The bug that is causing the effect will be removed in an upcomming release, so the need for a workaround is temporary. Thank you for your answer. At this moment the problem only affects private view. I deleted and then recreated the two graphs in private view, now it seems to work in private view too I have the same issues as the others. A channel last updated 2021-06-20 03:20 still works correctly ie charts and widgets. Another channel updated today 2024-01-22 03:14 has the issues with charts and widgets described by others. Two questions. If I delete the channel and then recreate it will I my Write and Read API Keys change? When will the update be released? From the post below, it seems you can simply delete the field plots and reinstate them to fix the problem. (I didnt try that yet) If you delete the channel, the API keys will definitely change. If I delete the charts and widgets and then recreate them it does not display as the original display. I am using MacOS 12.7.2 on a Mac Mini 2018 3 GHz 6-Core Intel Core i5 The browser is Chrome Version 120.0.6099.234 (Official Build) (x86_64) Charts do not update dynamically. Gauge widget now works correctly! The data is being uploaded each 30 sec from 2 x MKR 1010 WIFI with very similar software but different R/W API keys Attached are 3 images 1 and 2 A channel last edited/updated 2021-06-20 03:20 still receiving data uploads and displaying correctly. 2 the same channel showing the widgets correctly. 3 Another channel edited today after deleting all charts and widgets and recreating 5 of them. Previously the charts and widgets were similar to 1 and 2 (I have not edited the colours) No numeric display with the Gauge. (It displays correctly! but not in this screen shot) Yes,this make it work. Thanks. I did some try,and I find that ,if you want dynamically data view in the chart,you should set the "timescale" to "blank"(select the white space bar) and "dynamic" to "true".Otherwise ,it will not refresh the chart data. as this pic red frame indicated : You do not need to collect data for sufficient time before you set those parameters. Setting those parameters to non-null values may result in the plots only showing up once sufficient data is collected.
Trident Pneumatics in Discussions
Ultima attività il 4 Ago 2025 alle 6:15

Hi, I am sending data from my device to the thingspeak server using HTTP and I'm trying to attach a timestamp with my uploads. I am using the created_at field in the request to set the time zone. A sample request looks like this http://api.thingspeak.com/update?api_key=xxxyyyzzz&field1=3407.866699&field2=0.000000&field3=0.000000&field4=0.000000&field5=0.000000&field6=0.000000&field7=0.000000&field8=0.000000&created_at=2021-02-17T15:34:00+05:30 I live in India and my timezone offset is 5 hours 30 min. When I specify it like as shown above, I can see in the private view of my channel that it is adding 5 hours 30 min to the given time zone. So this time stamp becomes 21:04. How do I fix this? Am I making some mistake in my time zone offset in created_at? Or is there some time zone setting that is not set properly in my channel? Thanks, Ashwin N Setting Time zone using "created_at" field Your channel uses your profile settings to change the UTC timestamps saved in ThingSpeak into your local settings. If you want the data to show up in your local time, you can write UTC timestamps without the +5:30 and your channel will show them properly. Is this the effect you are trying to achieve? I did the same. But not changing in the data displayed in my private channel. Please help Can you describe specifically your problem? I think we resolved the OPs problem by removing the offset. Does that work for you? I have same problem.Change the profile timezone have nothing to do with it .
wang in Discussions
Ultima attività il 3 Ago 2025 alle 3:08

Is there a hardware support package available for the MP series? Hardware Support Package for the MP Series
Veerasai in Discussions
Ultima attività il 23 Lug 2025 alle 14:25

I'm facing an issue where my Thinkspeak graph is not displaying, even though I'm using exactly the same code as my friend. The code works perfectly in their Thinkspeak account, but not on mine. I've checked the API keys, channel settings, and data formats, but everything seems similar. Has anyone else faced this problem, or do you have tips on what to check next? Suggestions are welcome! Thinkspeak Graph Not Displaying While Same Code Works for Friend I would focus on the data formats. Perhaps try to read thier data instead of yours and then operate on it. Often times, spaces or weird characters in just one entry can muck up a whole read when MATLAB tries to figure out if something is a string or a number for example. The ThingSpeak platform is deterministic though, if everything is truly exactly the same, the output will be the same. Feel free to share some examples here, we can look at your stuff and see if we spot the issue. thinkspeak troubleshooting iot
Ernesto in Discussions
Ultima attività il 19 Lug 2025 alle 16:04

Hi! I'm having trouble sending data to a channel using MQTT. I'm using a program that was working perfectly until just a few days ago, but after making some minor changes yesterday, it stopped working. I’ve also tested it manually using the MQTTX client. If I send data using CURL and GET, it works fine. It’s a bit strange... Thankfully, Ernesto. Is the MQTT server experiencing any problems? same here, publish via mqtt stopped working 11 hours ago.. thanks Also having issues. Have different location and devices. All stopped working basically about 24 hours ago. It is only those that publish on the mqtt server. The one that is on restful is working. Thanks Jacques Can you please try again. A subset of MQTT devices seems to have seen an issue publishing. We've restarted nodes in the system and can confirm things are back to 100% from our dashboards. Now is working for me Working again. Thank you. Can you explain how this problem occurred? Unplanned updates on the server instances fronting ThingSpeak's MQTT API caused some nodes in ThingSpeak's high-availability MQTT cluster to get into a bad state. These changes were unrelated to ThingSpeak application code, as evidenced by the REST API working faultlessly in @Ernesto's post. We worked with the platform provider to address the issue and have confirmed things are working correctly again for all clients of the MQTT API. This issue has occurred again and has lasted for 30 minutes. not for me, all ok after they restarted nodes yea thx The additional monitoring we put in place didn't see any issues on any nodes. Did you see any effects on multiple devices? If so, can you please send me an email with the channel numbers? mqtt
Roger in MATLAB Answers
Ultima attività il 15 Lug 2025 alle 13:31

Hello, I am new to ThinkSpeak so thought I would try your example code for ESP8266 -- ThinkSpeak Channel. Have spent much time making sure all is installed and seems to compile, load and run on ESP8266 Node MCU. Channel is set up and have ID and Author ID I can see the channel but nothing noted. I am getting the above return on serial monitor. Any help very gratefully recieved, please.
Jerry in Discussions
Ultima attività il 11 Lug 2025

Is it possible to create a Simulink model that is independent of specific microcontrollers? For example, in the model, the STM32 block is used for CAN transmission. But if I want to deploy the same model to an Arduino, I have to replace the STM32 block with an Arduino-compatible one. So, is it possible to create a custom block or abstraction that works across multiple microcontrollers like STM32, PIC32, and Arduino without changing the hardware-specific block each time? Model based Embedded development with Microcontrollers I believe you can use the Arduino Support Package, without needing to develop custom blocks. See this example.
M. Franco in Discussions
Ultima attività il 9 Lug 2025

Sto tentando inutilmente di salvare il valore dell'enegia che consumo ogni giorno nel field5 di questo canale: https://thingspeak.mathworks.com/channels/2851490 , ma inutilemte in quanto vengono visualizzati sempre e solo 2 dati anche se ho impostato days=30. Ho provato ad aumentare a 365 ma senza variazioni. Come mai? Registrare un solo dato ogni giorno I believe fields 1,2,3,4 and 6 of the channel are being updated every 15 seconds. Field 5 appears to be only be updated much less frequently. When the charts are drawn, they pull up to the last 8000 feeds from the channel and plot them. Note that this is NOT the same as pulling up to 8000 points per field and then doing the plot. If you want to see field5 values also on a per 15s basis, ensure that field 5 is also updated at the same rate as other fields in the channel. NO, essendo un dato che varia solo ogni 24 ore, vorrei che venisse visualizzato 1 dato ogni 24 ore non un dato ogni 15 secondi come gli altri feed. E' possibile fare questo ? It appears that perhaps you have multiple sources updating the same channel at different frequencies. I would recommend you set up a separate channel for the data that is only updated daily. The view on that channel will show the graph you are looking for.
Johan Vervaet in MATLAB Answers
Ultima attività il 7 Lug 2025

I simply want to regenerate my password which I am forgotten of one of my MQTT devices.
치욱 in Discussions
Ultima attività il 4 Lug 2025

Hello, I've successfully tested the Processor-in-the-Loop (PIL) workflow in Simulink using a TI F28069M LaunchPad, following the standard examples provided by MathWorks. The PIL block, code generation, and communication all worked without issues. Now, I’d like to run a similar PIL setup using the Infineon TLE9879 EVALKIT (based on an ARM Cortex-M0), which is not officially supported by Simulink as a target. I’m wondering if it’s possible to configure PIL manually or via custom workflows. For example: Can I create a custom PIL target using Embedded Coder? Would I need to port rtiostream manually for communication over UART? Could I somehow integrate with Keil µVision (which I use for TLE9879) to build and run the generated code? Is there a workaround to simulate PIL behavior using a non-supported board? My setup: Simulink R2024b Infineon TLE9879 EVALKIT Keil µVision 5 + Infineon Config Wizard UART and JTAG interfaces available The main purpose is to validate control algorithms and measure execution time, not to implement a full HIL system. Has anyone attempted PIL with a custom or unsupported microcontroller before? Any tips or resources would be greatly appreciated. Thanks in advance! Is it possible to run PIL in Simulink with a non-supported microcontroller like Infineon TLE9879? simulink pil
Innosens in MATLAB Answers
Ultima attività il 3 Lug 2025

Hi, my channel upated time showed current time and date, but data did not appear in channe and last entry was 5 hours ago
FLO in Discussions
Ultima attività il 28 Giu 2025

Hello, i want to write the power data from my Tasmota IR Device to my channels, but it does not work. I have created 3 channels and i use the correct write API in the script. I use the following script: >D >B =>sensor53 r >S if upsecs%20==0 then =>WebSend [api.thingspeak.com] /update.json? api_key=SZFFJSLVS0SFJ6FL&field1=%sml[1]%&field2=%sml[2]%&field3=%sml[3]% endif >M 1 +1,3,s,0,9600, 1,77070100010800ff@1000,Total consumption,kWh,total_in,2 1,77070100020800ff@1000,Total feed-in,kWh,total_out,2 1,77070100100700ff@1,Power,W,power_curr,0 # I get the messages in the console that the data was send but my channels stay empty. What do i miss ? Thanks for help Writing to ThingSpeak channels with Tasmota IR Power Reader try hard coding a value in this line WebSend [api.thingspeak.com] /update.json? api_key=xxxxxxxxxxxxxxxx&field1=%sml[1]%&field2=%sml[2]%&field3=%sml[3]% like this WebSend [api.thingspeak.com] /update.json? api_key=xxxxxxxxxxxxxxxx&field1=10 then after you have confirmed that, you can test to be sure the numbers from the power meter are being printed right. Also test writing to your channel via the browser address window just to be sure you have the syntax correct. You cen get the format from the API keys tab of you channel, on the right hand side, I do have the same issue ;( Hardcoding values from the browser work in the following format: https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxx&field1=4104.08&field2=401.95&field3=350.00 My tasmota device sends the following corresponding data: 22:39:33.360 SCR: performs "WebSend [api.thingspeak.com] /update.json? api_key=xxxxxxxxxxxxxxxx&field1=4104.08&field2=401.95&field3=350.00" What do i miss in the my script? Hi, I run in the same error. In my case ist was a blank ( ) after the update.json? in front of the api-key. I saw that in a capture and also in the tamota-console 00:33:39.242 SCR: performs "WebSend [api.thingspeak.com] /update.json? api_key=key&field1=7.05&field2=88.18" ==> WebSend [api.thingspeak.com] /update.json? api_key I delete the blank in the script and now it works. regards Niels tasmota script channel writing
M Ramzan in MATLAB Answers
Ultima attività il 18 Giu 2025

I'm using an ESP32 to collect data from an MPU6050 sensor. The ESP32 buffers 170 samples at a time and uploads them to ThingSpeak using the bulk update API. However, the data entries received on ThingSpeak are inconsistent. Here's the pattern of total entries I see on the channel after each upload: After 1st upload: 170 entries (correct) After 2nd upload: 338 entries (should be 340) After 3rd upload: 499 entries (should be 510) After 4th upload: 657 entries (should be 680) After 5th upload: 818 entries (should be 850) As you can see, the expected total should increase by 170 each time, but it's losing a few samples in each batch, and the number of missing entries increases over time. The losses are not consistent — it seems like 1 or 2 samples get dropped randomly in each interval. Some things I’ve considered: The ESP32 is collecting and sending the full buffer (verified via serial debug). Could it be a payload size limit, HTTP timeout, or formatting issue? Maybe ThingSpeak is silently dropping malformed lines from the bulk update? Has anyone else run into this with buffered uploads to ThingSpeak? Any tips for debugging the exact cause of dropped samples? Thanks for any help!
sravani kandi in MATLAB Answers
Ultima attività il 18 Giu 2025

how to post matlab output to a website by not using thingspeak?
Joselito in Discussions
Ultima attività il 16 Giu 2025

Bom dia se alguém puder me ajudar, meu código abaixo, não estou conseguintdo conectar o meu Esp8266 ao ThingSpeak, o erro tá na conexão. Estou usando o MicroPython e NodeMCU na plataforma Pytohn o sistema operacional Ubuntu 20 # DHT11 -> ESP8266/ESP32 # 1(Vcc) -> 3v3 # 2(Data) -> GPIO12 # 4(Gnd) -> Gnd import time, network, machine from dht import DHT11 from machine import Pin from umqtt.simple import MQTTClient print("Iniciando...") dht = DHT11(Pin(12, Pin.IN, Pin.PULL_UP)) estacao = network.WLAN(network.STA_IF) estacao.active(True) estacao.connect('xxxxxxx', 'xxxxxxxxx') while estacao.isconnected() == False: machine.idle() print('Conexao realizada.') print(estacao.ifconfig()) SERVIDOR = "mqtt.thingspeak.com" CHANNEL_ID = "XXXXXXXXXXXXXXXXX" WRITE_API_KEY = "XXXXXXXXXXXXXXXXXXXXX" topico = "channels/" + CHANNEL_ID + "/publish/" + WRITE_API_KEY cliente = MQTTClient("umqtt_client", SERVIDOR) try: while True: dht.measure() temp = dht.temperature() umid = dht.humidity() print('Temperatura: %3.1f °C' %temp) print('Umidade: %3.1f %%' %umid) conteudo = "field1=" + str(temp) + "&field2=" + str(umid) print ('Conectando a ThingSpeak...') cliente.connect() cliente.publish(topico, conteudo) cliente.disconnect() print ('Envio realizado.') time.sleep(600.0) except KeyboardInterrupt: estacao.disconnect() estacao.active(False) print("Fim.") ***************************************************************************************************** No shell aparece como resposta: MPY: soft reboot Iniciando... Conexao realizada. ('192.168.0.23', '255.255.255.0', '192.168.0.1', '8.8.8.8') Temperatura: 29.0 °C Umidade: 63.0 % Conectando a ThingSpeak... Traceback (most recent call last): File "<stdin>", line 38, in <module> File "umqtt/simple.py", line 67, in connect OSError: -2 linha 38 é cliente.connect() Erro ao conectar: cliente.connect() It appears you're connecting to an incorrect server, mqtt.thingspeak.com instead of mqtt3.thingspeak.com. Start by modifying this example. python ubuntu
Klaus in MATLAB Answers
Ultima attività il 29 Maggio 2025

Hi, I tried to delete a channel data using POSTMAN as described here https://www.mathworks.com/help/thingspeak/clearchannel.html in Examples section: Use POSTMAN to Clear Channel The channel ID is correct, the write API key is correct, and the answer of postman after sending request is: { "status": "401", "error": { "error_code": "error_auth_required", "message": "Authorization Required", "details": "Please provide proper authentication details." } } I already tried to authorize me in Authorization tab using Basic Auth (username and password), but the result is the same. I already tried to use api_key in the request command directly: https://api.thingspeak.com/channels/1234567/feeds.json?api_key=XXXXXXXXXXXXXXXX The result is the same. 🙁 Does this channel deletion method work at all on ThingSpeak?
健 李 in Discussions
Ultima attività il 29 Maggio 2025

I want to use Simulink for model-based development of the TC3XX series development board, but I am not sure about the development process and toolchain? Is there a free toolchain available for me to use? Do you have a detailed development tutorial? How to use Simulink for model-based development of TC3XX series development boards infineon;simulink;mbd
Mi He2 in MATLAB Answers
Ultima attività il 18 Maggio 2025

Over the past few days, I’ve observed that MATLAB visualizations on ThingSpeak are not rendering correctly when accessed via the public URL. When I run the MATLAB Visualization script manually within ThingSpeak, the resulting image has the correct resolution and aspect ratios. However, accessing the same visualization through the public URL generates a much smaller image with distorted proportions. The script itself hasn’t been modified for a long time, and this issue has only started occurring recently. Could this be related to a recent change in the rendering engine or visualization settings on ThingSpeak? I would appreciate any guidance or insight into what might be causing this discrepancy. Thank you!
Martin Exner in MATLAB Answers
Ultima attività il 14 Maggio 2025

Hi. I have issues getting live data in ThingSpeak working with Elecfreaks IoT-kit. Is this a known issue? I have had it working before, so its not my code thats the problem :) Regards Martin
Md Arif in Discussions
Ultima attività il 14 Maggio 2025

FFT

I have a pressure vs. time plot resulting from the input of an elastic wave, which I obtained from an Abaqus simulation. So, I have access to all the data. Now, I want to convert this time-domain graph into a frequency-domain graph using FFT in MATLAB. I came across a code through ChatGPT, but I’m not fully confident in relying on it. Could anyone kindly clarify whether the formulas used for FFT in MATLAB are universal for all types of signals? Or is there a more effective and reliable method I should consider for this purpose? FFT
Ray Berkelmans in MATLAB Answers
Ultima attività il 12 Maggio 2025

I am trying to calculate the daily median across a range of channels and write the result to a new field for each channel. The code seems to run sometimes, but runs into rate limitation other times. I'm not sure why since I am only writing once and to different channels? Error using Median calcs (line 39) Requests are too frequent. For further information, see Limitations in the documentation. My code is: % Sensor/channel configuration sensors = [ struct('name', 'McKinley','channelID', 28xxxx, 'writeKey', 'G3WPJ586M55Gxxxx') struct('name', 'DPI', 'channelID', 80xxxx, 'writeKey', 'S0E0LB45GQLMxxxx') struct('name', 'Bryony','channelID', 29xxxx, 'writeKey', '2BPCI0IOAINPxxxx') ]; % Define date range (last 24 hours to midnight) endTime = dateshift(datetime('now'), 'start', 'day'); startTime = endTime - hours(24); % Preallocate a results array results = []; % Step 1: Read and calculate all medians for i = 1:length(sensors) s = sensors(i); % Read Field 1 for the past 24 hours [weight, ~] = thingSpeakRead(s.channelID, 'DateRange', [startTime, endTime], 'Fields', 1); % Compute median, ignoring NaNs medianWeight = round(median(weight, 'omitnan'),2); % Store in results results(i).name = s.name; results(i).channelID = s.channelID; results(i).writeKey = s.writeKey; results(i).value = medianWeight; end % Step 2: Display results for i = 1:length(results) r = results(i); fprintf('%s (Channel %d) → 24hr Median: %.2f\n', r.name, r.channelID, r.value); end % Step 3: Write results thingSpeakWrite(results(1).channelID, 'Fields', 6, 'Values', {results(1).value}, 'WriteKey', results(1).writeKey); thingSpeakWrite(results(2).channelID, 'Fields', 6, 'Values', {results(2).value}, 'WriteKey', results(2).writeKey); thingSpeakWrite(results(3).channelID, 'Fields', 6, 'Values', {results(3).value}, 'WriteKey', results(3).writeKey);
Ajay Kumar in MATLAB Answers
Ultima attività il 11 Maggio 2025

Basically, I am getting temperature values and trying to send an email alert whenever the temperature exceeds a specific point. But however the code runs but yet I am facing an error that says Error using matlab.internal.webservices.HTTPConnector/copyContentToByteArray (line 373) The server returned the status 429 with message "Too Many Requests" in response to the request to URL https://api.thingspeak.com/alerts/send. Error in readContentFromWebService (line 46) byteArray = copyContentToByteArray(connection); Error in webwrite (line 139) [varargout{1:nargout}] = readContentFromWebService(connection, options); Error in Customer Temperature Email Trigger (line 10) webwrite(alertUrl , "body", alertBody, "subject", alertSubject, options); I am also attaching the code. channelID = 1614947; alertApiKey = 'PRIVATE_ALERT_API_KEY'; alertUrl="https://api.thingspeak.com/alerts/send"; options = weboptions("HeaderFields", ["ThingSpeak-Alerts-API-Key", alertApiKey ]); temperature = thingSpeakRead(channelID,'NumDays',30,'Fields',1); recentvalue = temperature(end) alertSubject = sprintf("Temperature Alert"); alertBody = sprintf(" The temperature of the customer entering the store is high : ",recentvalue); if recentvalue > 32 webwrite(alertUrl , "body", alertBody, "subject", alertSubject, options); end Basically the other articles tell me that I have to enter a delay or a pause because the free version of thingspeak has limitations. Any idea on what I could do to make sure the code runs with minimal amount of delay?
Chris in MATLAB Answers
Ultima attività il 9 Maggio 2025

I am currently running a ThingSpeak Maltlab analysis that reads the latest channel status and acts on it. I am using this code, which works fine: url='https://api.thingspeak.com/channels/mychan/feeds/last.json?api_key=mykey&status=true'; lastData=webread(url); status = [lastData.status]; I am trying to figure out how to change this to read the last 3 channel statuses and put them into an array like status(i) where i goes from 1-3? This url returns the 3 statuses I want: url = https:'//api.thingspeak.com/channels/mychan/status.json?api_key=mykey&results=3' But I can't figure out how to get them into an array to work with. Does anyone know how to do this? Thanks.
Goncalo in Discussions
Ultima attività il 7 Maggio 2025

Hi guys! Im doing a project where i need to simulate a ship connected to the grid. I have a grid->converter AC-DC-AC -> dynamic load. My converter has to keep the voltage consistent and what changes is the current. Can somebody help me? Need help in Power electronics ops grid power eletronics power electronics converter dynamic loads onshore power supply controller pi controller rectifier inverter shore power
Christos in Discussions
Ultima attività il 1 Maggio 2025

I have a SG F1 Starter Kit and I would like some help in order to upload my data (Temp and Humidy) to my channel SG F1 Starter Kit f1 starter kit

Informazioni su ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.