nimaltd / gsm_v5

gsm module library for STM32 LL
GNU General Public License v3.0
231 stars 85 forks source link

SIM800L interfacing with STM32F4 #10

Open JBFourierous opened 4 years ago

JBFourierous commented 4 years ago

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.

nimaltd commented 4 years ago

Hello. Do you enable interrupt on cubemx? Enable debug and see whats happenOn Jul 21, 2019 4:39 PM, JBFourierous notifications@github.com 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.

JBFourierous commented 4 years ago

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

nimaltd commented 4 years ago

Did you put sim80x_rxcallback() on your usart routinOn Jul 22, 2019 2:05 PM, JBFourierous notifications@github.com 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.

hossein620830 commented 4 years ago

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

nimaltd commented 4 years ago

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

hossein620830 commented 4 years ago

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

nimaltd commented 4 years ago

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

hossein620830 commented 4 years ago

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

hossein620830 commented 4 years ago

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

Drworkstation commented 1 year ago

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