This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

problem with 4g modem
#29
Modify AT:run() function in the user library as follows and post what you get in LM Logs tab.
Code:
function AT:run()
  local res, err, cmd, pos, sms

  res, err = self:read()
  if err then
    if err ~= 'timeout' then
      log('run error', err)
    end

    return err == 'timeout'
  end

  -- check for incoming command
  if res:sub(1, 1) ~= '+' then
    return true
  end

  pos = res:find(':', 1, true)

  if not pos then
    return true
  end

  -- get command type
  cmd = res:sub(2, pos - 1)

  -- check only for incoming sms
  if cmd ~= 'CMTI' then
    log('run cmd', cmd)

    return
  end

  -- read from sim
  sms = self:incsms(res)

  -- sms seems to be valid, pass to handler if specified
  if sms and self.smshandler then
    self.smshandler(sms)
  end

  return true
end
Reply


Messages In This Thread
problem with 4g modem - by Frank68 - 31.01.2022, 14:03
RE: problem with 4g modem - by admin - 31.01.2022, 15:30
RE: problem with 4g modem - by Frank68 - 31.01.2022, 16:05
RE: problem with 4g modem - by admin - 01.02.2022, 08:20
RE: problem with 4g modem - by Frank68 - 01.02.2022, 12:12
RE: problem with 4g modem - by admin - 01.02.2022, 12:18
RE: problem with 4g modem - by Frank68 - 01.02.2022, 12:24
RE: problem with 4g modem - by admin - 01.02.2022, 13:35
RE: problem with 4g modem - by Frank68 - 01.02.2022, 14:54
RE: problem with 4g modem - by admin - 01.02.2022, 14:56
RE: problem with 4g modem - by Frank68 - 01.02.2022, 15:08
RE: problem with 4g modem - by admin - 02.02.2022, 09:13
RE: problem with 4g modem - by Frank68 - 02.02.2022, 09:23
RE: problem with 4g modem - by admin - 02.02.2022, 09:24
RE: problem with 4g modem - by admin - 02.02.2022, 09:53
RE: problem with 4g modem - by Frank68 - 02.02.2022, 09:54
RE: problem with 4g modem - by Frank68 - 02.02.2022, 14:06
RE: problem with 4g modem - by admin - 03.02.2022, 07:27
RE: problem with 4g modem - by Frank68 - 03.02.2022, 07:32
RE: problem with 4g modem - by admin - 01.07.2024, 09:01
RE: problem with 4g modem - by admin - 01.07.2024, 09:34
RE: problem with 4g modem - by admin - 01.07.2024, 09:48
RE: problem with 4g modem - by admin - 01.07.2024, 10:22
RE: problem with 4g modem - by admin - 01.07.2024, 12:22
RE: problem with 4g modem - by admin - 01.07.2024, 14:08

Forum Jump: