2018-03-20 04:43 AM
hi i'm trying to set up a gsm sim800 module with stm32f103c8 .i want to switch a led on and off with sms . i used
stm32cubemx for usart settings and i generated a code for that.. now i want to recieve sms with at commands but i don't know how to write the code .in at command help file it is only wrote the rules .and i have seen some educational videos about at commands but they are all using usb to serial connection and are operating at commands by pc so they are not helpfull for me i attached the code below can anyone help me ?
#stm32f103 #sim8002018-03-20 07:13 AM
AT Commands are simply text strings:
The way to approach this is to start by getting familiar with the commands & responses by typing & observing manually at a terminal.
Then design your code to send those same commands (which, remember, are just text strings) and receive the modem's responses (again, text strings).
The biggest mistake people make is to ignore the responses from the modem. Do not do this!
Your code
must
wait for & handle the complete response (or set of responses) after each command before proceeding to the next command.Note that none of this is new; people have been controlling modems with microcontrollers for decades - there are plenty of examples to be found on the interwebs!
2018-03-20 08:36 AM
Perhaps start by learning C, reviewing the other HAL USART examples, see how to send and receive characters, and then automate the key strokes you'd send from a PC terminal, and then receiving and acting upon the responses.
If you're out of your depth start with simpler things first.
2018-03-20 09:01 AM
SIM800 is a widely used module for cellular, so it won't be difficult to find AT commands for that also, SIMCOM has given out good amount of documentation on their website. Use HAL_UART_Transmit and HAL_UART_Receive as a start and later on move the ladder. You can send AT command for reading the SMS and store it in a buffer on receive. Parse this buffer and make your code act accordingly.
Time synchronization/usage is very important in this case.
2018-03-20 03:05 PM
I'm not at home, so I can't confirm positively, but here goes anyway:
In the STM32Cube repository for the F7, in the Drivers/BSP directory, there's components for the 769 Eval board. One of those is an ESP8266 driver, which is an example of how to send AT commands over USART.
2018-03-20 04:50 PM
Also, there's a number of cellular Discovery kits:
2018-03-20 10:31 PM
You seem new to Send/Receive strings (commands) over UART. So first step should be to setup UART correctly and send and receive Text strings over UART. For this you need to connect your UART to PC, for this you can use USB to serial converter if your PC don't have a serial port or you can use MAX232. After this install and open a terminal application in PC like TeraTerm and select the COM port of your USB to serial converter and connect. And try sending strings using HAL UART transmit function. You should see the transmitted text strings on PC, if not then debug. If yes then proceed receiving strings from UART. For that you need to again use HAL functions like UART Receive IT etc check the HAL driver manual. Once you are successfully receiving strings then you can proceed with GSM interfacing.