Logic Machine Forum
problem with 4g modem - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Hardware (https://forum.logicmachine.net/forumdisplay.php?fid=12)
+--- Thread: problem with 4g modem (/showthread.php?tid=3839)

Pages: 1 2


RE: problem with 4g modem - admin - 01.07.2024

Post what you have in System config > Status > System log.


RE: problem with 4g modem - andrepneves@gmail.com - 01.07.2024

Hi,

Thank for the quick reply.
Here it goes.


RE: problem with 4g modem - admin - 01.07.2024

What LM hardware model are you using?


RE: problem with 4g modem - andrepneves@gmail.com - 01.07.2024

LM5p2-RIO3LTE

LM5M3CV15xA23010267


RE: problem with 4g modem - admin - 01.07.2024

Do you have 3G/4G connection enabled? If it's disabled then the on-board modem won't be initialized.


RE: problem with 4g modem - andrepneves@gmail.com - 01.07.2024

It was disabled. When we try to enable it the LM stops responding.


RE: problem with 4g modem - admin - 01.07.2024

This most likely caused by LM using mobile connection gateway instead of Ethernet.
Follow this guide if you only need SMS without 3G/4G: https://forum.logicmachine.net/showthread.php?tid=5123&pid=33127#pid33127


RE: problem with 4g modem - andrepneves@gmail.com - 01.07.2024

It worked. Thanks!

I still have a strange situation. In the alert I still get "SMS handler lost connection" but the SMS are getting through. I only happens with a card from one provider. Using a card from a different provider it doesn't happen.


RE: problem with 4g modem - admin - 01.07.2024

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



RE: problem with 4g modem - andrepneves@gmail.com - 01.07.2024

Here goes the log.


RE: problem with 4g modem - admin - 01.07.2024

Change the same function as follows and see if it helps.
Code:
function AT:run()
  local res, err, cmd, pos, sms

  res, err = self:read()
  if err then
    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
    -- 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
  end

  return true
end