So I have a simple application that involves reading the input over terminal via UART, and then responding accordingly, be it toggling an LED or outputting a sensor reading over I2C. As a step up, I have been thinking about incorporating some wireless capability so the data could be sent/read over the air i.e WiFi or Bluetooth.

I personally think for this simple application, Bluetooth would be more than enough considering even the max standard the baud rate (0.256Mbps) is lesser than what bit rate you could achieve with Bluetooth (~2Mbps) but from a learning standpoint, what would be the suggested approach?

A simple use case that I thought of with BLE was to connect to a mobile app, and send/receive data over the air and UART from the module to the MCU.

For WiFi, I haven't done much research but I'd have to set up a local server first, connect the module to wifi internet, set up get/post requests and some backend processing I guess.

I have an STM32F4 MCU. Also, would there be a need of RTOS?

  • Any reason to stick with the stm32? A ESP32 has both WiFi & Bluetooth and multiple UART/I2C for reading/outputting data.
    – hardillb
    May 18 '20 at 22:02
  • I already have drivers written for uart/i2c and want to use them.
    – xyf
    May 18 '20 at 22:03
  • If you want to send "to the cloud" (and from there, to any local or remote devices), then WiFi. If you want to send to a local smartphone, then BLE. But of course YMMV based on many many other parameters.
    – jcaron
    May 18 '20 at 22:43

If your application is running from battery, you should probably choose BLE. Any other requirements could be fulfilled with both WiFi or Bluetooth. You could connect to a mobile app either via WiFi or Bluetooth as well.

As for the STM32 there are very convenient Bluetooth and WiFi modules out there that you could hook up on an UART to the STM32 and control it via AT commands or some other way.

For WiFi for example you could use an ESP01 in AT mode (ESP8266) connected via UART. I have run Paho MQTT C library on an STM32 with an ESP01 for WiFi connection. You can set up a Mosquitto MQTT Broker as a server on a PC or RPi and there are ready to use mobile apps to visualize the data.

Also there are Bluetooth modules that you could connect to your PC as a Virtual COM port and read serial output. I think these would be the fastest to prototype, then you could move on with mobile apps, etc.

As for RTOS you are better without any for first and once the details of your wireless connectivity and your applications become more solid, you could decide on bringing in an RTOS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.