cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-G491RE communication with SIMCom SIM800A - Problems

abhishek1991
Associate II

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions

@abhishek1991 wrote:

communication with GSM 800A - Steps Needed


Simple:

  1. Send valid AT command to the SIM800A;
  2. Receive reply from the SIM800A;
  3. Determine success/failure from the response, and proceed as appropriate.

 


@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.

 

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

5 REPLIES 5

@abhishek1991 wrote:

communication with GSM 800A - Steps Needed


Simple:

  1. Send valid AT command to the SIM800A;
  2. Receive reply from the SIM800A;
  3. Determine success/failure from the response, and proceed as appropriate.

 


@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.

 

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
abhishek1991
Associate II

Hi, 

My main code goes like this and below that is my usart code. I just want to transmit "AT" string get back OK from SIM800A. Can you please help me how to proceed further ? 

 

 

You've marked my previous post as The Solution - but it seems this is not solved yet?

https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256#:~:text=If%20you%20accidentally%20chose%20the%20wrong%20post%20as%20solution%2C%20you%20can%20always%20revert%20this%20action%20by%20clicking%20%22Not%20the%20Solution%22

You still haven't said what were the "errors" you mentioned:

  • compiler errors in your code ?
  • "ERROR" replies from the SIM800A ?
  • other ?

 


@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?

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Hi Andrew,

No, Not yet, I am working on it after usart is accomplished. Appreciate it. Thank you.

 

 


@abhishek1991 wrote:

No, Not yet


You mean not solved yet?

Then please un-mark the solution:

https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256#:~:text=If%20you%20accidentally%20chose%20the%20wrong%20post%20as%20solution%2C%20you%20can%20always%20revert%20this%20action%20by%20clicking%20%22Not%20the%20Solution%22

 

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);

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.