Main Content

Results for

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
Harel
Harel
Last activity on 25 Aug 2025 at 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..
Hey cody fellows :-) !
I recently created two problem groups, but as you can see I struggle to set their cover images :
What is weird given :
  • I already did it successfully twice in the past for my previous groups ;
  • If you take one problem specifically, Problem 60984. Mesh the icosahedron for instance, you can normally see the icon of the cover image in the top right hand corner, can't you ?
  • I always manage to set cover images to my contributions (mostly in the filexchange).
I already tried several image formats, included .png 4/3 ratio, but still the cover images don't set.
Could you please help me to correctly set my cover images ?
Thank you.
Nicolas
Is there a hardware support package available for the MP series?
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!
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 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?
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!
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?
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()
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?
Md Arif
Md Arif
Last activity on 14 May 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?
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?
I like this problem by James and have solved it in several ways. A solution by Natalie impressed me and introduced me to a new function conv2. However, it occured to me that the numerous test for the problem only cover cases of square matrices. My original solutions, and Natalie's, did niot work on rectangular matrices. I have now produced a solution which works on rectangular matrices. Thanks for this thought provoking problem James.
Christos
Christos
Last activity on 1 May 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
I have written, tested, and prepared a function with four subsunctions on my computer for solving one of the problems in the list of Cody problems in MathWorks in three days. Today, when I wanted to upload or copy paste the codes of the function and its subfunctions to the specified place of the problem of Cody page, I do not see a place to upload it, and the ability to copy past the codes. The total of the entire codes and their documentations is about 600 lines, which means that I cannot and it is not worth it to retype all of them in the relevent Cody environment after spending a few days. I would appreciate your guidance on how to enter the prepared codes to the desired environment in Cody.
Hello ThingSpeak Community,
I have an energy meter sending data of energy consumed in 4 rooms in hexadecimal values to Sigfox and I was trying to decode the payload and route it to ThingSpeak.
All the datas are sent at the same time.
But ThingSpeak only receives 1 of them and plots them.
However, the rest 3 are missing. Is this because I am trying the free version ?
Would the payed version be capable of receiving all the 4 messages ?
I've been trying this problem a lot of time and i don't understand why my solution doesnt't work.
In 4 tests i get the error Assertion failed but when i run the code myself i get the diag and antidiag correctly.
function [diag_elements, antidg_elements] = your_fcn_name(x)
[m, n] = size(x);
% Inicializar los vectores de la diagonal y la anti-diagonal
diag_elements = zeros(1, min(m, n));
antidg_elements = zeros(1, min(m, n));
% Extraer los elementos de la diagonal
for i = 1:min(m, n)
diag_elements(i) = x(i, i);
end
% Extraer los elementos de la anti-diagonal
for i = 1:min(m, n)
antidg_elements(i) = x(m-i+1, i);
end
end

I noticed recently that my data is no longer updating on thingspeak again. Is there a connectivity issues with thingspeak

my code is as below:
#include "DHT.h"
#define DHTPIN 15 // what pin we're connected to
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
#define THINGSPEAK_API_KEY "1P4RY69D3YMP9R5W"
#include <SoftwareSerial.h>
#include <OneWire.h>
#include <DallasTemperature.h>
//-----------------------------
#include <ArduinoJson.h>
StaticJsonDocument<200>JsonDocument;
SoftwareSerialmyserial(10, 11);
//-------------------------
float voltage;
unsignedintfrac;
//---------------------
#define ONE_WIRE_BUS 5
OneWireoneWire(ONE_WIRE_BUS);
DallasTemperaturesensors(&oneWire);
floatCelcius = 0;
float Fahrenheit = 0;
//==========================================================================================================
bytesensorInterrupt = 0; // 0 = digital pin 2
bytesensorPin = 2;
// The hall-effect flow sensor outputs approximately 4.5 pulses per second per
// litre/minute of flow.
floatcalibrationFactor = 5.5; //==========================================================we change cal factor 4.5 to 5.5 if not work chnage again(4.5)
//========== 5.5 calibration factor is working efficent then 4.5 , 7.5 ,and 6.5
volatile byte pulseCount;
floatflowRate;
unsignedintflowMilliLitres;
unsigned long totalMilliLitres, tempTotal = -1;
unsigned long oldTime;
//-------------------------------------------------------
intpH_Value;
float Voltage;
//----------------------------------------------------------------------------------------------
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
myserial.begin(9600);
//--------------------------------
pinMode(sensorPin, INPUT);
digitalWrite(sensorPin, HIGH);
pulseCount = 0;
flowRate = 0.0;
flowMilliLitres = 0;
totalMilliLitres = 0; // ============================================================
oldTime = 0;
attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
sensors.begin();
//------------------------------------------------
/********************GSM Communication Starts********************/
if (myserial.available())
Serial.write(myserial.read());
myserial.println("AT");
delay(1000);
myserial.println("AT+SAPBR=3,1,\"Contype\",\"GPRS\"");
delay(1000);
ShowSerialData();
myserial.println("AT+SAPBR=3,1,\"APN\",\"www\"");//APN
delay(1000);
ShowSerialData();
myserial.println("AT+SAPBR=1,1");
delay(1000);
ShowSerialData();
myserial.println("AT+SAPBR=2,1");
delay(1000);
ShowSerialData();
//---------------------------------
}
void loop() {
// put your main code here, to run repeatedly:
inti;
for (i = 0; i< 20; i++)
{
flow_meter();
}
temperature();
turbidity();
delay(1000);
gsm();
}
voidflow_meter()
{
if ((millis() - oldTime) > 1000) // Only process counters once per second
{
// Disable the interrupt while calculating flow rate and sending the value to
// the host
detachInterrupt(sensorInterrupt);
// Because this loop may not complete in exactly 1 second intervals we calculate
// the number of milliseconds that have passed since the last execution and use
// that to scale the output. We also apply the calibrationFactor to scale the output
// based on the number of pulses per second per units of measure (litres/minute in
// this case) coming from the sensor.
flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / calibrationFactor;
// Note the time this processing pass was executed. Note that because we've
// disabled interrupts the millis() function won't actually be incrementing right
// at this point, but it will still return the value it was set to just before
// interrupts went away.
oldTime = millis();
// Divide the flow rate in litres/minute by 60 to determine how many litres have
// passed through the sensor in this 1 second interval, then multiply by 1000 to
// convert to millilitres.
flowMilliLitres = (flowRate / 60) * 1000;
// Add the millilitres passed in this second to the cumulative total
totalMilliLitres += flowMilliLitres;
// Print the flow rate for this second in litres / minute
/* Serial.print("Flow rate: ");
Serial.print(int(flowRate)); // Print the integer part of the variable
Serial.print("."); // Print the decimal point */
// Determine the fractional part. The 10 multiplier gives us 1 decimal place.
frac = (flowRate - int(flowRate)) * 10;
Serial.print(frac, DEC) ; // Print the fractional part of the variable
Serial.println("L/min");
/* // Print the number of litres flowed in this second
Serial.print(" Current Liquid Flowing: "); // Output separator
Serial.print(flowMilliLitres);
Serial.print("mL/Sec");
// Print the cumulative total of litres flowed since starting
Serial.print(" Output Liquid Quantity: "); // Output separator
Serial.print(totalMilliLitres);
Serial.println("mL"); */
if ( tempTotal != totalMilliLitres ) {
tempTotal = totalMilliLitres;
// displayVolumeOfWater(totalMilliLitres );
}
// Reset the pulse counter so we can start incrementing again
pulseCount = 0;
// Enable the interrupt again now that we've finished sending output
attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
}
//=========================================================================================================================
}
voidpulseCounter()
{
// Increment the pulse counter
pulseCount++;
}
//-------------------------------------------------------------------------
void temperature()
{
sensors.requestTemperatures();
Celcius = sensors.getTempCByIndex(0);
Fahrenheit = sensors.toFahrenheit(Celcius);
Serial.print(" C ");
Serial.print(Celcius);
// Serial.print(" F ");
// Serial.println(Fahrenheit);
delay(1000);
}
//------------------------------------------------------------
void turbidity()
{
intsensorValue = analogRead(A0);
voltage = sensorValue * (5.0 / 1024.0);
// Serial.println ("Sensor Output (V):");
Serial.println (voltage);
// Serial.println();
delay(1000);
}
//------------------------------------------------------------
voidgsm()
{
myserial.println("AT+HTTPINIT");
delay(1000);
ShowSerialData();
myserial.println("AT+HTTPPARA=\"CID\",1");
delay(1000);
ShowSerialData();
StaticJsonDocument<200>JsonDocument;
JsonObject& object = JsonDocument.createObject();
object.set("TE", Celcius);
object.set("TU", voltage);
object.set("WF", frac);
delay(1000);
object.printTo(Serial);
Serial.println(" ");
String sendtoserver;
object.prettyPrintTo(sendtoserver);
delay(1000);
//myserial.println("AT+HTTPPARA=\"URL\",\"https://api.thingspeak.com/update?api_key=\""); //Server address
myserial.println("AT+HTTPPARA=\"URL\",\"https://api.thingspeak.com/update?api_key=\""); //Server address
delay(1000);
ShowSerialData();
myserial.println("AT+HTTPPARA=\"CONTENT\",\"application/json\"");
delay(1000);
ShowSerialData();
myserial.println("AT+HTTPDATA=" + String(sendtoserver.length()) + ",100000");
Serial.println(sendtoserver);
delay(1000);
ShowSerialData();
myserial.println(sendtoserver);
delay(2000);
ShowSerialData;
myserial.println("AT+HTTPACTION=1");
delay(1000);
ShowSerialData();
myserial.println("AT+HTTPREAD");
delay(1000);
ShowSerialData();
myserial.println("AT+HTTPTERM");
delay(1000);
ShowSerialData;
}
voidShowSerialData()
{
while (myserial.available() != 0)
Serial.write(myserial.read());
delay(1000);
}