gsm_v5 icon indicating copy to clipboard operation
gsm_v5 copied to clipboard

SIM800L interfacing with STM32F4

Open JBFourierous opened this issue 5 years ago • 10 comments

Hello, sorry for my question that is not exactly an issue about your repo, but it seems like you're the only man on the web able to interface SIM800L with STM boards directly in HAL. I have a fairly simple project in which I need to make some HTTP operations via GPRS. My troubles come when I try to send AT commands to the GSM module because apparently I cannot get any response, after HAL_UART_Transmit(...) both polling for the answer and waiting for an interrupt HAL_UART_Receive_IT(...) don't produce any result, the module seems dead. I am sure that it is fine because if I "play" with it using an Arduino UNO there are no issues, everything is working. It is supplied via lithium battery and I also put a voltage divider for the RX input from the board as the datasheets suggests. My UART is set to send 8bit messages with no parity and one stop bit. Sorry again for my inappropriate question, hope you can give me some piece of advice.

JBFourierous avatar Jul 21 '19 12:07 JBFourierous

Hello. Do you enable interrupt on cubemx? Enable debug and see whats happenOn Jul 21, 2019 4:39 PM, JBFourierous [email protected] wrote:Hello, sorry for my question that is not exactly an issue about your repo, but it seems like you're the only man on the web able to interface SIM800L with STM boards directly in HAL. I have a fairly simple project in which I need to make some HTTP operations via GPRS. My troubles come when I try to send AT commands to the GSM module because apparently I cannot get any response, after HAL_UART_Transmit(...) both polling for the answer and waiting for an interrupt HAL_UART_Receive_IT(...) don't produce any result, the module seems dead. I am sure that it is fine because if I "play" with it using an Arduino UNO there are no issues, everything is working. It is supplied via lithium battery and I also put a voltage divider for the RX input from the board as the datasheets suggests. My UART is set to send 8bit messages with no parity and one stop bit. Sorry again for my inappropriate question, hope you can give me some piece of advice.

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.

nimaltd avatar Jul 21 '19 12:07 nimaltd

Sorry for my late reply. I enabled interrupts on CubeMX, and the strange fact is that in debugging if a put a breakpoint in the callback I never get there. So the callback function never really gets executed. My code is really silly, something like this, in main HAL_UART_Transmit(&huart2, (uint8_t*)"AT\r\n", sizeof("AT\r\n"),1000); HAL_UART_Receive_IT(&huart2,RX,sizeof(RX)); and then the callback really does nothing void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { HAL_UART_Receive_IT(&huart2,RX,sizeof(RX)); }

JBFourierous avatar Jul 22 '19 09:07 JBFourierous

Did you put sim80x_rxcallback() on your usart routinOn Jul 22, 2019 2:05 PM, JBFourierous [email protected] wrote:Sorry for my late reply. I enabled interrupts on CubeMX, and the strange fact is that in debugging if a put a breakpoint in the callback I never get there. So the callback function never really gets executed. My code is really silly, something like this, in main HAL_UART_Transmit(&huart2, (uint8_t*)"AT\r\n", sizeof("AT\r\n"),1000); HAL_UART_Receive_IT(&huart2,RX,sizeof(RX)); and then the callback really does nothing void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { HAL_UART_Receive_IT(&huart2,RX,sizeof(RX)); }

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.

nimaltd avatar Jul 22 '19 09:07 nimaltd

سلام وقت بخیر . از این کتابخانه برای ارسال و دریافت پیامک استفاده کردم . کتابخانه بسیار خوش ساختی هست . ساختار بسیار خوبی داره ازش استفاده کردم و کارم راه افتاد سپاس. یک پیشنهاد دارم . توابع مربوط به کاربر رو به صورت تعریف کنید . weak اینطوری استفاده ازش راحت تره . این کتابخانه را از صفر خودتان نوشتید یا کتابخانه ی دیگه ای را ویرایش کردید.؟

hossein620830 avatar Jun 05 '20 22:06 hossein620830

سلام. مال خودم هست. ورژن جدیدشو نوشتم. اونو تست کنید

nimaltd avatar Jun 06 '20 04:06 nimaltd

از نسخه v2.0 master استفاده کردم . 3 روز پیش دانلود کردم . آخرین نسخه هست؟

hossein620830 avatar Jun 06 '20 15:06 hossein620830

Gsm خالی اسمشه نسخه آزمایشی هست .

nimaltd avatar Jun 06 '20 16:06 nimaltd

میشه لطفا لینکش رو اینجا برای من کامنت کنید ؟ سپاس.

hossein620830 avatar Jun 06 '20 17:06 hossein620830

آخرین نسخه منظورمه . سپاس

hossein620830 avatar Jun 06 '20 17:06 hossein620830

سلام وقتتون به خیر برای ارسال دستورات at از چه روشی استفاده میکنین؟ مثلا برای دریافت لوکیشن از دکل مخابراتی به چه صورت باید دستور at رو ارسال کنم؟

Drworkstation avatar Mar 13 '23 16:03 Drworkstation