SIM800 TTGO TCALL pppos_client

oliverbru
Posts: 14
Joined: Thu Sep 26, 2019 8:52 am

SIM800 TTGO TCALL pppos_client

Postby oliverbru » Mon Oct 28, 2019 1:43 pm

Hello,

Does anybody know what is the configuration for TTGO TCALL to run pppos_client example ?
Currently I put :
CONFIG_MODEM_TX_PIN=26
CONFIG_MODEM_RX_PIN=27

But I do not find the values for these ones and the example does not work :
CONFIG_MODEM_RTS_PIN=
CONFIG_MODEM_CTS_PIN=

I took info from :https://github.com/Xinyuan-LilyGO/TTGO- ... pinout.jpg
Regards,

genedyne
Posts: 18
Joined: Wed Jun 06, 2018 12:47 pm

Re: SIM800 TTGO TCALL pppos_client

Postby genedyne » Mon Oct 28, 2019 3:36 pm

From the diagram you linked, only Rx & Tx are connected (RTS & CTS are not used).
Are you toggling the PWKEY signal?

From the manual:
PWRKEY should be pulled low at least 1 second and then released to power on/down the module.

oliverbru
Posts: 14
Joined: Thu Sep 26, 2019 8:52 am

Re: SIM800 TTGO TCALL pppos_client

Postby oliverbru » Thu Oct 31, 2019 7:35 am

Hello,

Thanks for your answer.
I will test it and give you a feedback.

oliverbru
Posts: 14
Joined: Thu Sep 26, 2019 8:52 am

Re: SIM800 TTGO TCALL pppos_client

Postby oliverbru » Thu Oct 31, 2019 2:46 pm

It is not working.
I still have crash.

Code: Select all

 (297) boot: Loaded app from partition at offset 0x10000
I (297) boot: Disabling RNG early entropy source...
I (298) cpu_start: Pro cpu up.
I (301) cpu_start: Application information:
I (306) cpu_start: Project name:     esp-idf
I (311) cpu_start: App version:      v3.3
I (316) cpu_start: Compile time:     Oct 31 2019 15:06:55
I (322) cpu_start: ELF file SHA256:  1f5f0b574ec01900...
I (328) cpu_start: ESP-IDF:          v3.3
I (332) cpu_start: Starting app cpu, entry point is 0x4008107c
0x4008107c: call_start_cpu1 at D:/esp/esp-idf/components/esp32/cpu_start.c:270

I (0) cpu_start: App cpu up.
I (343) heap_init: Initializing. RAM available for dynamic allocation:
I (350) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (356) heap_init: At 3FFB4148 len 0002BEB8 (175 KiB): DRAM
I (362) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (368) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (375) heap_init: At 400896AC len 00016954 (90 KiB): IRAM
I (381) cpu_start: Pro cpu start user code
I (175) cpu_start: Chip Revision: 1
I (176) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (22282) uart: queue free spaces: 30
E (22782) esp-modem: esp_modem_dte_send_cmd(215): process command timeout
E (22782) dce_service: esp_modem_dce_sync(48): send command failed
E (22782) sim800: sim800_init(460): sync failed
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:

oliverbru
Posts: 14
Joined: Thu Sep 26, 2019 8:52 am

Re: SIM800 TTGO TCALL pppos_client

Postby oliverbru » Fri Nov 01, 2019 8:17 am

Hello,

I debugged and I found where is the problem but I do not know how to solve it.

In esp_modem.c, line 215

Code: Select all

/* Send command via UART */
    ESP_LOGI("TAG", "UART WRITE RESULT : %d",uart_write_bytes(esp_dte->uart_port, command, strlen(command)));
    /* Check timeout */
    MODEM_CHECK(xSemaphoreTake(esp_dte->process_sem, pdMS_TO_TICKS(timeout)) == pdTRUE, "process command timeout", err);
The command is sent to UART because the log shows the result >=0.
The next line xSemaphoreTake has an error and then, it crashes the program.

Does somebody know what is happening and how to solve ?

Regards,

gleiva
Posts: 3
Joined: Fri Nov 22, 2019 6:57 pm

Re: SIM800 TTGO TCALL pppos_client

Postby gleiva » Mon Dec 02, 2019 12:55 pm

Hi! The TX pin shoud be 27 and RX pin 26. RTS and CTS doesn't matter. Don't forget that you should turn on the sim800 module before call sim800_init().

gleiva
Posts: 3
Joined: Fri Nov 22, 2019 6:57 pm

Re: SIM800 TTGO TCALL pppos_client

Postby gleiva » Mon Dec 02, 2019 1:10 pm

oliverbru wrote:
Mon Oct 28, 2019 1:43 pm
Hello,

Does anybody know what is the configuration for TTGO TCALL to run pppos_client example ?
Currently I put :
CONFIG_MODEM_TX_PIN=26
CONFIG_MODEM_RX_PIN=27

But I do not find the values for these ones and the example does not work :
CONFIG_MODEM_RTS_PIN=
CONFIG_MODEM_CTS_PIN=

I took info from :https://github.com/Xinyuan-LilyGO/TTGO- ... pinout.jpg
Regards,
Hi! You should configure as follow:
CONFIG_MODEM_TX_PIN=27
CONFIG_MODEM_RX_PIN=26
CONFIG_MODEM_RTS_PIN= doesn't matter
CONFIG_MODEM_CTS_PIN= doesn't matter

Don't forget that you should turn on the sim800 module before call sim800_init(dte) function.

somothing like this:


#define SIM800_PWKEY 4
#define set_sim800_pwkey() gpio_set_level(SIM800_PWKEY,1)
#define clear_sim800_pwkey() gpio_set_level(SIM800_PWKEY,0)

#define SIM800_RST 5
#define set_sim800_rst() gpio_set_level(SIM800_RST,1)
#define clear_sim800_rst() gpio_set_level(SIM800_RST,0)

#define SIM800_POWER 23
#define set_sim800_pwrsrc() gpio_set_level(SIM800_POWER,1)
#define clear_sim800_pwrsrc() gpio_set_level(SIM800_POWER,0)


void sim800_turnon(void)
{
gpio_config_t io_conf;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1<<SIM800_PWKEY)+(1<<SIM800_RST)+(1<<SIM800_POWER);
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
gpio_config(& io_conf);

ESP_LOGI(TAG, "Apagando...");
set_sim800_pwkey();
set_sim800_rst();
clear_sim800_pwrsrc();
vTaskDelay(1000/portTICK_PERIOD_MS);
set_sim800_pwrsrc();

ESP_LOGI(TAG, "Iniciando...");
vTaskDelay(1000/portTICK_PERIOD_MS);

clear_sim800_pwkey();
vTaskDelay(1000/portTICK_PERIOD_MS);
set_sim800_pwkey();

set_sim800_rst();
vTaskDelay(1000/portTICK_PERIOD_MS);
clear_sim800_rst();
vTaskDelay(1000/portTICK_PERIOD_MS);
set_sim800_rst();
vTaskDelay(3000/portTICK_PERIOD_MS);
}

bharath
Posts: 1
Joined: Wed Jan 08, 2020 11:02 am

Re: SIM800 TTGO TCALL pppos_client

Postby bharath » Wed Jan 08, 2020 8:17 pm

CONFIG_MODEM_TX_PIN=27
CONFIG_MODEM_RX_PIN=26

Power up sequence that works for me ...
gpio_set_direction(MODEM_PWKEY, GPIO_MODE_OUTPUT);
gpio_set_direction(MODEM_RST, GPIO_MODE_OUTPUT);
gpio_set_direction(MODEM_POWER_ON, GPIO_MODE_OUTPUT);

gpio_set_level(MODEM_PWKEY, LOW);
gpio_set_level(MODEM_RST, HIGH);
gpio_set_level(MODEM_POWER_ON, HIGH);
vTaskDelay(1500/portTICK_RATE_MS);
gpio_set_level(MODEM_PWKEY, HIGH);
vTaskDelay(15000/portTICK_RATE_MS);

As per the datasheet PWKEY must be pulled high after 1-2 sec

The 15 second delay in my case was to ensure the SIM card is ready (+CPIN=READY comes very late in my T-CALL module, without which IMSI will fail)

leenowell
Posts: 92
Joined: Tue Jan 15, 2019 1:50 pm

Re: SIM800 TTGO TCALL pppos_client

Postby leenowell » Sat Jan 18, 2020 8:55 pm

Hi Both,

Any chance you can post the full code that you used to get this working? I have tried both of your suggestions by modifying the esp example code and still can't get it working.

@gleiva when I did your suggestion, I got a core dump when calling clear_sim800_pwkey
@bharath when I did your suggestion, fails with the following errors

(17479) esp-modem: esp_modem_dte_send_cmd(215): process command timeout
(17479) dce_service: esp_modem_dce_sync(48): send command failed
(17479) sim800: sim800_init(460): sync failed

I have tried all sorts to try and get this example working but am now at a loss.

thanks

Lee.

kluverp
Posts: 26
Joined: Mon Jun 18, 2018 7:08 am

Re: SIM800 TTGO TCALL pppos_client

Postby kluverp » Tue Jul 14, 2020 2:30 pm

Same problem here.

Does anyone have an example of this working?

Who is online

Users browsing this forum: david_hambo and 113 guests