2018-01-11 04:52 AM
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.Solved! Go to Solution.
2018-01-11 06:52 AM
2018-01-11 05:25 AM
I used node serial module to be able to read UART data generated by the STM32 directly by nodejs
2018-01-11 06:52 AM
2018-01-11 06:53 AM
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.
2018-01-11 09:26 AM
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.2018-01-11 10:08 AM
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.
2018-01-11 10:39 AM
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.2018-01-11 10:42 AM
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!2018-01-11 10:52 AM
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....
2018-01-11 11:06 AM
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?