Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how many files and how much work it will need to adapt library to support SIM7600 #63

Open
sushant-ht opened this issue Jul 23, 2021 · 8 comments

Comments

@sushant-ht
Copy link

Hi, Tilen Majerle

Nice work really liked your work, I just want to know how much change i have to make to adapt this library to support sim7600. i believe lwgsm_input.c is the file that has the main send and receives AT command parsing. just to know is there any other file that needs to be changed?

Thanks for Library and support
Sushant

@MaJerle
Copy link
Owner

MaJerle commented Jul 24, 2021

Most work is to be done in lwgsm_int and lwgsm_parser files

@sushant-ht
Copy link
Author

Is there a way to debug the process? to actually know how stepwise data is been handled?

also I couldn't locate lwgsm_buff_write function in any file

@MaJerle
Copy link
Owner

MaJerle commented Aug 26, 2021

You can step into process function that parses each and every received character.

lwgsm_buff_write is available here: https://github.com/MaJerle/lwgsm/blob/develop/lwgsm/src/lwgsm/lwgsm_buff.c

@sushant-ht
Copy link
Author

sushant-ht commented Sep 8, 2021

Why I am unable to read SMS, I am trying to debug this library with lpc1768 & sim800c, but I am getting problems reading,

I have added the log below

edit: 10:48 AM 09-09-2021

implies outgoing command, last ',' implies the size of the command
< implies incoming message over UART, last ',' & size is added for debugging

Starting GSM application!
Library initialized!
< 
+CMTI: "ME",42
,18

> AT,2                             /*[AT]cmd, [2]size */
> +CFUN=1,1,9              /*[+CFUN=1,1]cmd, [9]size */             
> ,2

< AT+CFUN=1,1

OK
,18

> AT,2
> E1,2
> 
,2

< ATE1

OK
,11

> AT,2
> +CFUN=,6
> 1,1
> 
,2

< AT+CFUN=1

OK
,16

> AT,2
> +CMEE=1,7
> 
,2

< AT+CMEE=1

OK
,16

> AT,2
> +CGMI,5
> 
,2

< AT+CGMI

SIMCOM_Ltd

OK
,28

> AT,2
> +CGMM,5
> 
,2

< AT+CGMM

SIMCOM_SIM800C

OK
,32

> AT,2
> +CGSN,5
> 
,2

< AT+CGSN

867157040500092

OK
,33

> AT,2

> +CGMR,5
> 
,2

< AT+CGMR

Revision:1418B06SIM800C24

OK
,43

> AT,2
> +CREG=1,7
> 
,2

< AT+CREG=1

OK
,16

> AT,2
> +CLCC=1,7
> 
,2

< AT+CLCC=1

OK
,16

> AT,2
> +CPIN?,6
> 
,2

< AT+CPIN?

+CPIN: READY

OK
,31

> AT,2
> +CNUM,5
> 
,2

< 
Call Ready

AT+CNUM

OK
,30

> AT,2
> +CPMS=?,7
> 
,2

< AT+CPMS=?

+CPMS: ("SM","ME","SM_P","ME_P","MT"),("SM","ME","SM_P","ME_P","MT"),("SM","ME","SM_P","ME_P","MT")

OK
,119


> AT,2
> +CPMS?,6
> 
,2

< AT+CPMS?

+CPMS: "ME",22,50,"SM_P",20,20,"SM_P",20,20

OK
,62


SMS enabled. Send new SMS from your phone to device.
Start by sending first SMS to device...


< 
+CMTI: "ME",43
,18New SMS received!
Cannot read SMS!

< 
+CMTI: "ME",44
,18

New SMS received!

Cannot read SMS!
< 
+CMTI: "ME",45,16

Uploading esp32.log…

@sushant-ht
Copy link
Author

This is a bug, in the below function you need to check for NULL condition,
else following snippet fails and it invoke fault handler
/* Create SMS thread */
lwgsm_sys_thread_create(NULL, "lwgsm_sms", (lwgsm_sys_thread_fn)sms_send_receive_thread, NULL, 1024, LWGSM_SYS_THREAD_PRIO);

uint8_t
lwgsm_sys_thread_create(lwgsm_sys_thread_t* t, const char* name, lwgsm_sys_thread_fn thread_func,
void* const arg, size_t stack_size, lwgsm_sys_thread_prio_t prio) {
lwgsm_sys_thread_t id = NULL;
if (xTaskCreate(thread_func,
name,
1024,
//stack_size/sizeof(portSTACK_TYPE)*2,
arg,
prio,
id) == pdPASS) {
if(t != NULL)
*t = id;
return 1;
}
return 0;
}

@MaJerle
Copy link
Owner

MaJerle commented Sep 8, 2021

Can you please format data to be well readable?

What sms read fubction returns?

@sushant-ht
Copy link
Author

sushant-ht commented Sep 9, 2021

i have currently disabled CHECK_READY(); in fun lwgsm_sms_send & lwgsm_sms_read, i dont always receive SMS Ready from sim800c. same thing for sim7600e

@MaJerle
Copy link
Owner

MaJerle commented Sep 9, 2021

You should not remove check ready step. How your send SMS API looks like? Complete one please.

Did you check this one? https://github.com/MaJerle/lwgsm/blob/develop/snippets/sms_send_receive.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants