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
#21
Post what you have in System config > Status > System log.
Reply
#22
Hi,

Thank for the quick reply.
Here it goes.

Attached Files Thumbnail(s)
   
Reply
#23
What LM hardware model are you using?
Reply
#24
LM5p2-RIO3LTE

LM5M3CV15xA23010267
Reply
#25
Do you have 3G/4G connection enabled? If it's disabled then the on-board modem won't be initialized.
Reply
#26
It was disabled. When we try to enable it the LM stops responding.
Reply
#27
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/showthrea...7#pid33127
Reply
#28
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.

Attached Files Thumbnail(s)
   
Reply
#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
#30
Here goes the log.

Attached Files Thumbnail(s)
   
Reply
#31
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
Reply
#32
I have the LM with the built-in LTE modem. It has been configured, so it is only used for SMS, while the RJ45 port is used for all IP traffice.

I have created the standard scripts according to the guide, and I can send SMS without any problems. This works very stable. However, when I try to send a SMS to the LTE modem, then nothing happens. An example of SMS is "W 1//1/9 false" without the quotes to turn off something. I get no response on read. My sender phone number is allowed in the script, and I have tried both with and without country code.

I hope you can provide some temporary changes to the script, so I can find what I have missed.

Thanks.
Reply
#33
Do you have anything in LM Alerts tab? Messages from all numbers are logged there.
Reply
#34
Yes, there are messages. See screen shot with todays messages, where I tried off instead of false, but with same result.

Attached Files Thumbnail(s)
   
Reply
#35
Make sure that the number is specified in the script the same way as in the alert between [].

Modify the handler function in the resident script as follows and post what you get in Logs tab:
Code:
handler = function(sms)   -- sms from known number, call parser   if table.contains(numbers, sms.sender) then     log('incoming sms', sms.sender, sms.data)     parser(sms.data, sms.sender)   else     log('unknown number', sms.sender)   end end

For on/off use 0/1 or true/false.
Reply
#36
I saw that the + sign in front of the country code was missing in the alert log, so I tried to remove the + sign and still country code number. That worked, and I have now for the first time received a response on a read SMS.

If I reboot the LM, and I send one SMS everything works fine. Both read and write. However, the next SMS send does not appear in the Alerts. Only if I reboot LM, it works correct for one single message. After a reboot it actually picks up the previous waiting message and responds.

I am using LM reboot functionality - no power recycle.
Reply
#37
Is the resident script configured correctly with 0 sleep time?
Reply
#38
Yes, see screen shot. The Generel Timer also shown is actually your staircase example with my own add ons.

This is my normal CPU and memory stats:

Attached Files Thumbnail(s)
       
Reply
#39
In the user library add logging to the AT:run() function:
Code:
function AT:run()   local res, err, cmd, pos, sms   res, err = self:read()   log(res, err)

Then check what you get in LM Logs tab.
Reply
#40
I opened the user library and added the single line "log(res, err)" saved and tried again. Then everything worked smooth. Then I commented out that line and it still works fine with  immediate reply.

Sorry for all this - I do not know why it did not work before. But it is working fine now. And I am glad that I now know where to add a log statement to gain more info in case of future problems.

Thanks and enjoy your weekend.

Update: after a LM reboot the same faulty behavior came back with only processing one message and then it stops. I will try to get some log info.

I have now tried editing log on and off + reboot, and I cannot find a pattern in the behavior. Only thing is that it generally seems to work better when the log writing is enabled, which makes no sense to me. I cannot go with this, because the log will be flooded with messages, as it issues a timeout message every second. 

I never see any error messages in the log. Only many timeouts and now and then processing of a message. See screen shot.

Attached Files Thumbnail(s)
   
Reply


Forum Jump: