2025-02-13 03:34 AM
Hello STM32 Community,
I am working with an STM32 project using NanoEdge AI Studio, where I’ve trained models based on data from several sensors and deployed them to my STWINBX1 for anomaly detection. The models have been successfully integrated into the STM32 code, and I’m looking to send notifications or real-time data regarding whether the behavior is "normal" or "abnormal."
My question is: how can I communicate this data (such as "normal" or "abnormal") via Bluetooth? Specifically, I’d like to use the Android ST BLE Sensor app to monitor and receive notifications from the STM32 device. Is this feasible? If Bluetooth is not the best option, I am also open to alternatives like Wi-Fi. How would Wi-Fi work in this scenario, and what steps should I take to implement it?
Any help or guidance would be greatly appreciated!
Best regards,
Solved! Go to Solution.
2025-02-13 07:37 AM
Hello @Mahdouch ,
As NanoEdge we don't have example code with any sort of wireless communication. But there is not really any link with NanoEdge. Now that you can get the prediction of the model, it transmission is unrelated, meaning that you just need to learn how to work with wireless communication.
It seems that the STWINBOX has On-board Bluetooth® Low Energy v5.0 wireless technology (BlueNRG-M2), Wi-Fi (EMW3080), and NFC (ST25DV64K).
I advice you to ask the wireless forum where you can find example of application that uses wireless. As you've probably seen, adding a NanoEdge library is pretty easy.
So I would start from a wireless example application and add the NanoEdge functionality. I would not do it the other way around.
STM32 MCU wireless forum board: https://community.st.com/t5/stm32-mcus-wireless/bd-p/mcu-wireless-forum
Have a good day,
Julian
2025-02-13 07:37 AM
Hello @Mahdouch ,
As NanoEdge we don't have example code with any sort of wireless communication. But there is not really any link with NanoEdge. Now that you can get the prediction of the model, it transmission is unrelated, meaning that you just need to learn how to work with wireless communication.
It seems that the STWINBOX has On-board Bluetooth® Low Energy v5.0 wireless technology (BlueNRG-M2), Wi-Fi (EMW3080), and NFC (ST25DV64K).
I advice you to ask the wireless forum where you can find example of application that uses wireless. As you've probably seen, adding a NanoEdge library is pretty easy.
So I would start from a wireless example application and add the NanoEdge functionality. I would not do it the other way around.
STM32 MCU wireless forum board: https://community.st.com/t5/stm32-mcus-wireless/bd-p/mcu-wireless-forum
Have a good day,
Julian
2025-02-13 07:45 AM
@Mahdouch wrote:how can I communicate this data (such as "normal" or "abnormal") via Bluetooth?
Just like you'd communicate any data via Bluetooth !
As @Julian E. said, the fact that the data happened to come from NanoEdge AI is entirely immaterial to the Bluetooth - as far as the Bluetooth is concerned, it's all just data.
2025-02-13 10:19 AM - last edited on 2025-02-13 10:22 AM by Andrew Neil
Hello @Julian E. ,
Thank you for your reply and guidance! I understand that NanoEdge AI is independent of the transmission process. I’ll look into existing wireless communication examples and start from there.
I’ll also post my question in the STM32 MCU Wireless section for further assistance.
Appreciate your help!
Best regards,
Mahdouch
Follow-up post here: https://community.st.com/t5/stm32-mcus-wireless/real-time-wireless-notification-for-anomaly-detection-on/td-p/772640
2025-02-14 12:56 AM - edited 2025-02-14 12:57 AM
Hello @Mahdouch
Are you aware about FP-IND-DATALOGMC? This function pack provides a NanoEdgeAI-based demo for STEVAL-STWINBX1.
The DATALOGMC_AI implements a motor fault classification based on a machine learning solution developed through NanoEdgeAIStudio. The machine learning model allows an accurate classification of motor behavior into two states: good and faulty. The output of the classifier is sent via BLE to the BLESensor app or via USB thanks to a Python-based SDK that we're providing.
You can also have a look into FP-SNS-STBOX1 that provides different firmware examples related to BLE communication with BLESensor app.
Those examples can guide you in developing your firmware.
Hope those hints can help.
Best regards,
Simone
2025-02-14 01:34 AM
Hello @SimonePradolini
Yes, I have used FP-SNS-DATALOG2, specifically the HS-DATALOG GUI, to collect real-time data, which I then uploaded to NanoEdge AI Studio for anomaly detection. After training the model, I deployed it in my STM32IDE project.
However, I am facing an issue where I cannot see the output of the classified real-time data in PuTTY. My main goal is to send this output wirelessly and locally, which is the focus of my current work.
I am exploring options to send the data wirelessly (via Bluetooth or another method) and locally, so if you have any advice on how to achieve this, I would really appreciate it!
Best regards,
Mahdouch
2025-02-14 01:41 AM
@Mahdouch wrote:I am facing an issue where I cannot see the output of the classified real-time data in PuTTY. h
So maybe start a separate thread on that, and get that working first?
@Mahdouch wrote:My main goal is to send this output wirelessly
Surely, a first step to that is to get the wired transmission working?
If you can't even get wired transmission working, then doing it wirelessly is an order of magnitude more complex...
2025-02-14 02:10 AM
yeah you're right i need to see something on my putty after i debug the code on stm32ide