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 whether you accept or reject these cookies being set.

Mbus script LM bug
#1
Hi!

 I have a script for reading Mbus, i works for å while then the LM is "stuck".
When it happen i cant log into it. If i take the power off, it works fine after that.
Then it works for somewhile and then the same thing happens.

I tried to deactivate the script for some days, and then the LM works fine.



I am using Tecbase Mbus 10 RS-232 Mbus gateway.

its a Sheduled script that runs every day at 07.30.

Is there something wrong in my script?
Is there someway to close the Mbus reading, so it only reads Mbus when the script runs?
Someone who has had the same experiance?



Here is my script:



-------------------------------Step 1: LM script (search for Mbus ID):

--[[
-- load mbus library
require('mbus')
-- use /dev/ttyUSB0 serial port with 2400 baud rate

mbus.init('/dev/RS232', 2400)

-- scan from range 0 to 5 (inclusive)
res = mbus.scan(0, 100)
-- save result to Logs tab
log(res)

]]--


--------------------------------Step 2: LM script (read values):(Deactivate step 1 before going to step 2)

--load mbus library
require('mbus')
-- use /dev/ttyUSB0 serial port with 2400 baud rate
mbus.init('/dev/RS232', 2400)
-- new address to write
addr = 71
-- read all data
res, err = mbus.getdata(addr)

-- read ok
if res then
  --log(res)----------------reading all the Mbus data, sort afterwards the values you want
 
 
  --log(res.data[0].value)
 
 
 
  value1 = res.data[1].value
  value2 = res.data[4].value
  value3 = res.data[5].value
 
  value10 = value1:sub(1, -3) -------remove decimal
  value20 = value2:sub(1, -3) -------remove decimal
  value30 = value3:sub(1, -3) -------remove decimal
 
 
  num1 = tonumber(value10)
  num2 = tonumber(value20)
  num3 = tonumber(value30)
  log(num1)
 
 
  grp.update('32/1/19', num1)----write value to grp.
  grp.update('32/1/20', num2)----write value to grp.
  grp.update('32/1/21', num3)----write value to grp.
-- read failed
else
  alert('[mbus] failed to read data from short address ' .. addr .. ' ' .. tostring(err)) 
end
Reply
#2
What you are describing might be a hardware issue and the script might have nothing to do with it. How old is the LM that you are using?
Reply
#3
ARMv7 Processor rev 5 (v7l)
Version: 20180822
Reply
#4
(30.06.2021, 09:33)admin Wrote: What you are describing might be a hardware issue and the script might have nothing to do with it. How old is the LM that you are using?

ARMv7 Processor rev 5 (v7l)
Version: 20180822

would it help if i upgraded firmware?
Reply
#5
You can certainly try installing 2021 RC1.
Reply


Forum Jump: