diff --git a/config.sample.json b/config.sample.json index 3733310..6448561 100644 --- a/config.sample.json +++ b/config.sample.json @@ -12,6 +12,8 @@ "http_command_server": { "apikey": "PLEASE_CHANGE_ME", "listen_port": "2110" - } + }, + + "disable_delete_inbox_on_startup": false } \ No newline at end of file diff --git a/lib/modem.js b/lib/modem.js index 3be3937..01e026c 100644 --- a/lib/modem.js +++ b/lib/modem.js @@ -224,14 +224,16 @@ function init() { logger.info('Querying signal strength'); await writeToPortAndWaitForOK('AT+CSQ\r'); - logger.info('Deleting existing messages'); - // await writeToPortAndWaitForOK('AT+CMGD=0,4\r'); - await readManufacturer(); await readModel(); await readIMEI(); await readIMSI(); + if (!config.disable_delete_inbox_on_startup) { + logger.info('Deleting existing messages'); + await writeToPortAndWaitForOK('AT+CMGD=0,4\r'); + } + port.unpipe(parserWaitForOK); registerSignalStrengthBackgroundQuery();