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.

modbus 485 error ! :(
#2
Disable RTU in Modbus settings and run this script once. Post what you get in Logs.
You might need to change the serial settings in the script. It is currently set to 9600 baud, no parity (N) and 1 stop bit.
Code:
require('luamodbus')
mb = luamodbus.rtu()

mb:open('/dev/RS485-1', 9600, 'N', 8, 1, 'H')
mb:connect()

buffer = {}

mb:setdebug(function(msg)
  buffer[ #buffer + 1 ] = msg
end)

mb:setslave(1)

res, err = mb:readregisters(0)
log(res, err)

mb:close()

log(table.concat(buffer))
Reply


Messages In This Thread
modbus 485 error ! :( - by phongvucba - 16.04.2022, 06:39
RE: modbus 485 error ! :( - by admin - 19.04.2022, 07:43
RE: modbus 485 error ! :( - by phongvucba - 19.04.2022, 09:28
RE: modbus 485 error ! :( - by admin - 19.04.2022, 11:22
RE: modbus 485 error ! :( - by CristianAgata - 19.07.2022, 19:57
RE: modbus 485 error ! :( - by phongvucba - 20.04.2022, 03:17
RE: modbus 485 error ! :( - by Dré - 19.07.2022, 09:31
RE: modbus 485 error ! :( - by Daniel - 19.07.2022, 09:33
RE: modbus 485 error ! :( - by Dré - 19.07.2022, 09:39
RE: modbus 485 error ! :( - by Daniel - 19.07.2022, 09:40
RE: modbus 485 error ! :( - by Dré - 19.07.2022, 09:42
RE: modbus 485 error ! :( - by Daniel - 19.07.2022, 09:44
RE: modbus 485 error ! :( - by Dré - 19.07.2022, 10:09
RE: modbus 485 error ! :( - by Daniel - 19.07.2022, 10:17
RE: modbus 485 error ! :( - by Dré - 19.07.2022, 10:26
RE: modbus 485 error ! :( - by admin - 19.07.2022, 10:17
RE: modbus 485 error ! :( - by Daniel - 19.07.2022, 10:29
RE: modbus 485 error ! :( - by Dré - 19.07.2022, 10:33
RE: modbus 485 error ! :( - by Dré - 19.07.2022, 18:09
RE: modbus 485 error ! :( - by admin - 20.07.2022, 08:28
RE: modbus 485 error ! :( - by CristianAgata - 20.07.2022, 11:22
RE: modbus 485 error ! :( - by Dré - 20.07.2022, 09:52
RE: modbus 485 error ! :( - by admin - 20.07.2022, 10:13
RE: modbus 485 error ! :( - by Dré - 20.07.2022, 13:13
RE: modbus 485 error ! :( - by Kilogica - 20.07.2022, 10:59
RE: modbus 485 error ! :( - by admin - 20.07.2022, 11:25
RE: modbus 485 error ! :( - by CristianAgata - 20.07.2022, 11:39
RE: modbus 485 error ! :( - by CristianAgata - 21.07.2022, 10:42
RE: modbus 485 error ! :( - by admin - 20.07.2022, 13:29
RE: modbus 485 error ! :( - by Dré - 20.07.2022, 15:04

Forum Jump: