2024-07-09 04:36 AM - last edited on 2024-07-09 07:00 AM by Andrew Neil
Hi,
Hope you are doing good.
I am trying to transmit "AT" command using USART communication to SIM800A(SIM.COM).
I am facing errors, should I write a separate GSM module.
Thank you.
Solved! Go to Solution.
2024-07-09 04:49 AM - edited 2024-07-09 04:50 AM
@abhishek1991 wrote:communication with GSM 800A - Steps Needed
Simple:
@abhishek1991 wrote:I am facing errors.
What "errors", exactly?
@abhishek1991 wrote:should I write a separate GSM module.
Modular software is generally accepted as A Good Thing.
However, putting code which "has errors" into a separate module will just give you a module which "has errors" - it won't, in itself, solve your errors.
2024-07-09 04:49 AM - edited 2024-07-09 04:50 AM
@abhishek1991 wrote:communication with GSM 800A - Steps Needed
Simple:
@abhishek1991 wrote:I am facing errors.
What "errors", exactly?
@abhishek1991 wrote:should I write a separate GSM module.
Modular software is generally accepted as A Good Thing.
However, putting code which "has errors" into a separate module will just give you a module which "has errors" - it won't, in itself, solve your errors.
2024-07-09 05:58 AM
2024-07-09 06:37 AM
You've marked my previous post as The Solution - but it seems this is not solved yet?
You still haven't said what were the "errors" you mentioned:
@abhishek1991 wrote:I just want to transmit "AT" string get back OK
Forget about the SIM800A for now - just connect your UART to a terminal.
Can you see anything being sent from your STM32?
2024-07-09 09:39 AM - edited 2024-07-09 09:49 AM
Hi Andrew,
No, Not yet, I am working on it after usart is accomplished. Appreciate it. Thank you.
2024-07-09 10:00 AM
@abhishek1991 wrote:No, Not yet
You mean not solved yet?
Then please un-mark the solution:
What are you doing here:
/* USER CODE END WHILE */
HAL_UART_Transmit(&huart2, txBuffer-1, size, HAL1TIMEOUT);
Why txBuffer-1 ??
Why are you trying to transmit the character before the start of the buffer ?!?
Similarly:
rxBuffer[20]=HAL_UART_Receive(&huart2, rxBuffer-1, 20, HAL1TIMEOUT);