JAY in MATLAB Answers
上次活动时间: 2025-9-1,2:14

Hi, I'm working on a solar coupled PEM electrolyser, I imported MPPT solar charge controller model and PEM electrolysis system from Matlab add-on library. I've applied gas properties and all other variables required by MEA and all initial conditions have been set to low priority. The below is the exact error state: Error: An error occurred during simulation and the simulation was terminated Caused by: ['charmaine_solar_electrolyser/Solver Configuration']: Initial conditions solve failed to converge. When trying to advance one time step, nonlinear solver failed to converge due to Linear Algebra error. Workspace script: % =================================================================== % MASTER SETUP SCRIPT (SELF-CONTAINED WITH CUSTOM UNITS) % =================================================================== % --- Step 1: Start with a clean slate --- clear all; clc; disp('Workspace cleared. Starting master setup script...'); % --- Step 2: Define Gas Properties Directly --- disp('Defining gas properties...'); % Data for Nitrogen (N2) N2_T = [-73.15; -23.15; 26.85; 76.85; 126.85; 176.85; 226.85]; % Temperature (degC) N2_h = [200.9; 251.0; 301.2; 351.5; 402.0; 452.7; 503.6]; % Enthalpy (kJ/kg) N2_mu = [13.3; 16.0; 18.5; 20.8; 22.9; 24.9; 26.9]; % Viscosity (uPa*s) N2_k = [18.1; 22.3; 26.2; 30.0; 33.7; 37.1; 40.5]; % Conductivity (mW/(m*K)) N2_R = 296.8; % Specific gas constant (J/kg*K) % Data for Oxygen (O2) O2_T = [-73.15; -23.15; 26.85; 76.85; 126.85; 176.85; 226.85]; % Temperature (degC) O2_h = [184.5; 230.0; 276.0; 322.5; 369.5; 417.0; 465.0]; % Enthalpy (kJ/kg) O2_mu = [14.8; 17.8; 20.6; 23.2; 25.6; 27.9; 30.1]; % Viscosity (uPa*s) O2_k = [18.3; 22.3; 26.6; 30.8; 34.9; 38.9; 42.8]; % Conductivity (mW/(m*K)) O2_R = 259.8; % Specific gas constant (J/kg*K) O2_D = 20600; % Mass diffusivity (mm^2/s) % Data for Hydrogen (H2) H2_T = [-73.15; -23.15; 26.85; 76.85; 126.85; 176.85; 226.85]; % Temperature (degC) H2_h = [2770; 3440; 4110; 4790; 5470; 6150; 6830]; % Enthalpy (kJ/kg) H2_mu = [6.13; 7.42; 8.65; 9.81; 10.92; 11.98; 13.01]; % Viscosity (uPa*s) H2_k = [129; 155; 181; 205; 228; 250; 272]; % Conductivity (mW/(m*K)) H2_R = 4124.2; % Specific gas constant (J/kg*K) H2_D = 70000; % Mass diffusivity (mm^2/s) % Data for Water Vapor (H2O) H2O_h = [2360; 2440; 2550; 2650; 2745; 2840; 2940]; % Specific Enthalpy (kJ/kg) H2O_mu = [7.0; 9.0; 11.2; 13.4; 15.5; 17.6; 19.6]; % Dynamic Viscosity (uPa*s) H2O_h_vap = [2838; 2650; 2438; 2316; 2182; 2031; 1850]; % Enthalpy of Vaporization (kJ/kg) H2O_k = [12.2; 15.8; 19.5; 23.5; 27.8; 32.5; 37.5]; % Thermal Conductivity (mW/(m*K)) H2O_p_sat = [1.0e-7; 7.75e-5; 0.0035; 0.0416; 0.246; 0.933; 2.64]; % Saturation Pressure (MPa) H2O_D = 25; % Mass diffusivity of water vapor in air (mm^2/s) % --- Step 3: Create Solar and Load Profiles --- solar_profile_time = (0:60:86400)'; drive_cycle_time = solar_profile_time; sunrise = 6 * 3600; sunset = 18 * 3600; daylight_duration = sunset - sunrise; solar_irradiance = zeros(size(solar_profile_time)); daylight_indices = solar_profile_time >= sunrise & solar_profile_time <= sunset; daylight_time_elapsed = solar_profile_time(daylight_indices) - sunrise; solar_irradiance(daylight_indices) = 1000 * sin(pi * daylight_time_elapsed / daylight_duration); solar_profile = [solar_profile_time, solar_irradiance]; % Create a time vector from 0 to 10 seconds time = (0:0.1:10)'; % Create an irradiance data vector (e.g., a ramp up and down) irradiance_vals = [linspace(500,1000,51), linspace(1000,500,50)]'; % Prepend a ramp from 0 to the starting value over the first 0.01s time = [0; 0.01; time+0.01]; % Add starting points to time irradiance_vals = [0; 500; irradiance_vals]; % Add starting points to data % Combine them into a two-column matrix for Simulink irradiance_profile = [time, irradiance_vals]; % --- Step 4: Define Main System Parameters --- P_PV_rated = 5000; V_PV_mpp = 250; I_PV_mpp = P_PV_rated/V_PV_mpp; V_PV_oc = 300; I_PV_sc = 22; T_ref = 25; G_ref = 1000; P_Elec_rated = 4000; P_fc_rated = 3000; V_dc = 400; % --- Step 5: Calculate Power Profile from Irradiance --- effective_area_efficiency = P_PV_rated / G_ref; solar_power_watts = solar_irradiance * effective_area_efficiency; solar_power_kw = solar_power_watts / 1000; solar_profile_power = [solar_profile_time, solar_power_kw]; % Load Power Profile drive_cycle_power_kw = 2 * ones(size(drive_cycle_time)); % Creates a constant 2 kW load drive_cycle_power = [drive_cycle_time, drive_cycle_power_kw]; % --- Step 6: Define Physical and Environmental Parameters --- stack_num_cells = 50; stack_area = 0.1; stack_w_channels = 0.001; stack_num_channels = 50; water_pipe_D = 0.02; gas_pipe_D = 0.02; env_p = 101325 + 1e-6; % Initial environmental pressure (Pa), with a small offset env_T = 25; % Initial environmental temperature (degC) env_RH = 0.5; % Environmental relative humidity (0 to 1) env_yO2 = 0.21; % Mole fraction of O2 in the environment cathode_tube_D = 0.02; anode_tube_D = 0.02; tank_yH2 = 0; tank_V = 0.1; tank_p = 1; stack_iL = 10; % Stack current limit or reference (A) % --- Step 7: Define Heat Exchanger and Radiator Parameters --- exchanger_air_area_primary = 1; exchanger_eta_fin = 0.9; exchanger_air_area_fins = 5; exchanger_L = 0.5; exchanger_W = 0.2; exchanger_tube_Leq = 0.1; exchanger_tube_H = 0.01; exchanger_N_tubes = 20; % --- Step 8: Define Cooling System and Radiator Parameters --- coolant_num_layers = 2; coolant_num_passes = 4; coolant_tube_D = 0.01; coolant_w_channels = 0.002; radiator_air_area_primary = 1; radiator_air_area_fins = 5; radiator_cp = 900; radiator_eta_fin = 0.9; radiator_L = 0.6; radiator_W = 0.4; radiator_tube_H = 0.01; radiator_tube_Leq = 0.2; radiator_N_tubes = 40; radiator_t_wall = 0.001; radiator_rho = 2700; % --- Step 9: Define Compressor Map Parameters (Placeholders) --- comp_rpm_TLU = [1000, 2000, 3000]; comp_p_ratio_TLU = [1.0, 1.5, 2.0]; comp_mdot_corr_TLU = [ 0.01, 0.009, 0.008; ... 0.02, 0.018, 0.016; ... 0.03, 0.027, 0.024 ]; disp('All parameters successfully loaded.'); Import: Rodney Tan (2025). MPPT Solar Charge Controller Model (https://www.mathworks.com/matlabcentral/fileexchange/73115-mppt-solar-charge-controller-model), MATLAB Central File Exchange. Retrieved September 1, 2025. PEM Electrolysis System > openExample('simscape/PEMElectrolysisSystemExample') Link > PEM Electrolysis System I've tried changing linear algebra setting in solver configuration to full/sparse/auto and using ode23t (mod. stiff/Trapezoidal) solver - Matlab 2024b. Any tips/ideas/clues?
Harel in Discussions
上次活动时间: 2025-8-25,13:11

Hi, I have some problem, I want to upload my data that sample rate at 500HZ, every sevral seconds. My data include 12 bytes, and it measure 500HZ, for example for 15 seconds I coolect 15*500*12 = 84KB. Can I upload this data to ThingSpeak? It is possible to use with Free acount (I am student and this is my project) How can help me.. Sampling rate and uploading, It may be possible to upload this data to Thingspeak, even with the free account, but Im not sure its the right workflow. ThingSpeak is generally not optimized for high data rate applications. The data is live and sharable, but the database can be eventually cosistant, not immedeiately in some cases, especially with high data rate. The bulk update endpoing allows up to 960 messages per post approximentally every 15-20 seconds. Each field has 256 characters, for 8 fields and locations and status, you can get about 4kB in a single post. For 960 messages, you can do about 192 kB per second, so your data rate may be possible, depending on your network and device. However, as I said above, this may be difficulat to achieve. I would reccomend you do some proocessing on the edge device and reduce the data in your stream.
Jerry in Discussions
上次活动时间: 2025-8-22,10:45

Im using stm32h735g-dk and i was thinking to start model based development using simulink in matlab. I already done a cluster prototype using touchgfx and stm32cube ide now i need to shift from cube ide to simulink using same gui is it possible?? If its posssible how will i integrate with simulink i have already licenced version and stm embedded packages on simulink and embedded coder can anyone help me with a guidance how to integrate without using cube ide Touchgfx integration with Simulink in matlab simulink stm32 touchgfx gui cluster
stefano in Discussions
上次活动时间: 2025-8-7,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
上次活动时间: 2025-8-4,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
上次活动时间: 2025-8-3,3:08

Is there a hardware support package available for the MP series? Hardware Support Package for the MP Series
Veerasai in Discussions
上次活动时间: 2025-7-23

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
上次活动时间: 2025-7-19

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
上次活动时间: 2025-7-15

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
上次活动时间: 2025-7-11

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
上次活动时间: 2025-7-9

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
上次活动时间: 2025-7-7

I simply want to regenerate my password which I am forgotten of one of my MQTT devices.
치욱 in Discussions
上次活动时间: 2025-7-4

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
上次活动时间: 2025-7-3

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
上次活动时间: 2025-6-28

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
上次活动时间: 2025-6-18

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
上次活动时间: 2025-6-18

how to post matlab output to a website by not using thingspeak?
Joselito in Discussions
上次活动时间: 2025-6-16

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
上次活动时间: 2025-5-29

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
上次活动时间: 2025-5-29

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
上次活动时间: 2025-5-18

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
上次活动时间: 2025-5-14

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
上次活动时间: 2025-5-14

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
上次活动时间: 2025-5-12

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
上次活动时间: 2025-5-11

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?

关于 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.