cancel
Showing results for 
Search instead for 
Did you mean: 

Using stm32f4 on website

Bob Cameroon
Associate II
Posted on January 11, 2018 at 13:52

Hello

I'm using stm32f411 and I have my server written in node.js.

I want to make that my stm32 would send random string to my web server so it will be like a kind of a captcha when logging in.

Is this even possible to make, or what is the easiest way to achieve it?

Thanks in addition.

#stm32-f4 #web-page #stm32f411 #websocket

Note: this post was migrated and contained many threaded conversations, some content may be missing.
1 ACCEPTED SOLUTION

Accepted Solutions
9 REPLIES 9
Posted on January 11, 2018 at 14:25

I used node serial module to be able to read UART data generated by the STM32 directly by nodejs

Posted on January 11, 2018 at 14:52

https://www.npmjs.com/package/serialport

 
Posted on January 11, 2018 at 14:53

I used to use ESP8266 to air the IP packets and receive them on a web server (separate process - tcp server)

MAny ways. It depands on your needs.

Posted on January 11, 2018 at 17:26

Thank you for your answer

Golab.Bogdan

.It is actualy a localhost server for now, so nothing ******** yet.

I would simply like to have array, with few different random strings inside. Then on each attempt to login stm32f4 should send randomly one of those saved strings to server.

I don't know what would be the easiest way to do this?

Thank you.

Posted on January 11, 2018 at 18:08

if you use nodejs just use it for reading the UART data using the mentioned modules. I used it several times. So the STM32 should send the data you need through the UART. Enable RNG on STM32 and read generated numbers then send them through UART. Not sure what you need. It's really simple.

Bob Cameroon
Associate II
Posted on January 11, 2018 at 19:39

Golab.Bogdan

‌ Oh damn, that's bad. Since I can't use UART than, I guess I'm gonna use USB OTG. Am I still able to communicate with my server via serialport?

Or what is the easiest way to communicate with server now?

Thank you a lot!

EDIT: Looks like you tried to upload file, but something went wrong.

Posted on January 11, 2018 at 18:42

Golab.Bogdan

‌ thank you for your answers again!

Is it possible to achieve that via USB, or how could I send/recieve data? Notice that I'm just beginner and my STM32F4 is just a default board. I was using I2C and SPI but don't know much about UART, so thats why I'm asking for help up here.

Thanks!

Posted on January 11, 2018 at 18:52

UART is even simpler than I2C and SPI. If use CubeMX just look into the examples. Enable the UART in CubeMX, and call HAL_UART_Transmit() function to send data through the UART.

If you use a boards with ST-LINK 2.1 you can use USB as virtual serial port. So from the connectivity perspective you do not need extra UART/USB converter. You need only USB cable.

It's difficult to suggests something if you do not know exact boards model to verify its capabilities....

Posted on January 11, 2018 at 19:06

Thank you

Golab.Bogdan

‌, that is really helpful. Actualy I'm using STM32F411VET6, and also CubeMX, Keil and RealTerm if these informations help you.

So I could use UART's Transmit function and than send for example one string to my node.js server via USB?