Logic Machine Forum
gateway on reactor - 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: gateway on reactor (/showthread.php?tid=5403)



gateway on reactor - Frank68 - 02.05.2024

Greetings
even with the latest firmware if I use GSM/LTE don't I have to put gateway in the network configuration?
I have a reactor with GW that sends emails but then doesn't send me text messages.
I have other reactors that even if they have the gw send SMS, the difference depends on what, the scripts and configurations are the same.

Thank you


RE: gateway on reactor - admin - 02.05.2024

When a mobile connection is established the default gateway is replaced with the one provided via the mobile connection. But this does not affect sending SMS as it does not require mobile Internet connection.


RE: gateway on reactor - Frank68 - 02.05.2024

(02.05.2024, 12:14)admin Wrote: When a mobile connection is established the default gateway is replaced with the one provided via the mobile connection. But this does not affect sending SMS as it does not require mobile Internet connection.

So what could the failure to send SMS depend on? The SIM is loaded and active.
the GSM signal is present.


RE: gateway on reactor - admin - 02.05.2024

Check Error log for any errors from the SMS script. Make sure that the correct port is set, it depends on the modem model. It should be either /dev/ttyACM3 or /dev/ttyUSB2


RE: gateway on reactor - Frank68 - 02.05.2024

(02.05.2024, 12:23)admin Wrote: Check Error log for any errors from the SMS script. Make sure that the correct port is set, it depends on the modem model. It should be either /dev/ttyACM3 or /dev/ttyUSB2

I have check the port is /dev/ttyACM3


RE: gateway on reactor - admin - 02.05.2024

What about the Error log?


RE: gateway on reactor - Frank68 - 02.05.2024

(02.05.2024, 12:34)admin Wrote: What about the Error log?

nothing


RE: gateway on reactor - Frank68 - 06.05.2024

(02.05.2024, 12:34)admin Wrote: What about the Error log?

I have no error on log


RE: gateway on reactor - admin - 07.05.2024

Can you send ZeroTier access via PM?


RE: gateway on reactor - Frank68 - 07.05.2024

(07.05.2024, 07:49)admin Wrote: Can you send ZeroTier access via PM?

Yes tomorrow I return in office and I send You the access.

tank's


RE: gateway on reactor - Frank68 - 08.05.2024

(07.05.2024, 10:58)Frank68 Wrote:
(07.05.2024, 07:49)admin Wrote: Can you send ZeroTier access via PM?

Yes tomorrow I return in office and I send You the access.

tank's

I have send you PM

tank's


RE: gateway on reactor - lamgia99 - 12.02.2025

Hello, I have a problem. My SMS is sent normally, but after about half a month or a month, my SMS cannot be sent anymore until I turn off the Lm and restart it. Can you give me a solution? Thank you.

(07.05.2024, 07:49)admin Wrote: Can you send ZeroTier access via PM?

Hello, I have a problem. My SMS is sent normally, but after about half a month or a month, my SMS cannot be sent anymore until I turn off the Lm and restart it. Can you give me a solution? Thank you.


RE: gateway on reactor - admin - 12.02.2025

1. Replace AT:read() function in user.sms with the following code.
2. Restart the SMS script.
3. Post what you have in Logs when this issue happens again.

Code:
function AT:read(timeout)
  local char, err, timeout, deftimeout, line

  -- default timeout is 1 second, converted to 0.1 sec ticks
  timeout = tonumber(timeout) or 1
  timeout = timeout * 10

  deftimeout = timeout

  -- read until got one line or timeout occured
  while timeout > 0 do
    -- read 1 char
    char, err = self.port:read(1, 0.1)

    -- got data
    if char then
      -- got LF, end of line
      if char == '\n' then
        -- convert to string and empty buffer
        line = table.concat(self.buffer)
        self.buffer = {}
        line = line:trim()

        -- return only lines with data
        if #line > 0 then
          log('read line', line)
          return line
        -- reset timeout
        else
          timeout = deftimeout
        end
      -- ignore CR
      elseif char ~= '\r' then
        table.insert(self.buffer, char)
      end
    -- read timeout
    elseif err == 'timeout' then
      timeout = timeout - 1
    -- other error
    else
      break
    end
  end

  log('read timeout', self.buffer)
  return nil, err
end



RE: gateway on reactor - lamgia99 - 13.02.2025

(12.02.2025, 10:43)admin Wrote: 1. Replace AT:read() function in user.sms with the following code.
2. Restart the SMS script.
3. Post what you have in Logs when this issue happens again.

Code:
function AT:read(timeout)
  local char, err, timeout, deftimeout, line

  -- default timeout is 1 second, converted to 0.1 sec ticks
  timeout = tonumber(timeout) or 1
  timeout = timeout * 10

  deftimeout = timeout

  -- read until got one line or timeout occured
  while timeout > 0 do
    -- read 1 char
    char, err = self.port:read(1, 0.1)

    -- got data
    if char then
      -- got LF, end of line
      if char == '\n' then
        -- convert to string and empty buffer
        line = table.concat(self.buffer)
        self.buffer = {}
        line = line:trim()

        -- return only lines with data
        if #line > 0 then
          log('read line', line)
          return line
        -- reset timeout
        else
          timeout = deftimeout
        end
      -- ignore CR
      elseif char ~= '\r' then
        table.insert(self.buffer, char)
      end
    -- read timeout
    elseif err == 'timeout' then
      timeout = timeout - 1
    -- other error
    else
      break
    end
  end

  log('read timeout', self.buffer)
  return nil, err
end



RE: gateway on reactor - admin - 13.02.2025

Make sure that you are using the latest script from here: https://kb.logicmachine.net/notifications/sms/
Post what you have in LM Alerts and System config > Status > System log.