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.

RS485 signal collision
#6
Dear Daniel 

I tried this in a resident script with 0 interval like this but it seems this script does not get executed every second...
When I remove the last line "res, err = port:read(17)" it gets executed every second.
Could you tell me if I am doing anything wrong?

Code:
if not port then
  require('serial')
  port =  serial.open('/dev/RS485-1', {
  baudrate = 19200,
  databits = 8,
  stopbits = 1,
  parity = 'none',
  duplex = 'half'
})
end

log('executed')


if storage.get('coldBathAutoStartCommand') ~= nil  then
port:write(storage.get('coldBathAutoStartCommand'))
os.sleep(1)
port:write(':RR\r\n')
storage.set('coldBathAutoStartCommand', nil)
end


port:flush()
res, err = port:read(17)
Reply


Messages In This Thread
RS485 signal collision - by Hadeel - 02.12.2022, 15:17
RE: RS485 signal collision - by Daniel - 02.12.2022, 15:33
RE: RS485 signal collision - by Hadeel - 02.12.2022, 15:54
RE: RS485 signal collision - by Daniel - 02.12.2022, 15:56
RE: RS485 signal collision - by Hadeel - 02.12.2022, 16:20
RE: RS485 signal collision - by Hadeel - 03.12.2022, 10:57
RE: RS485 signal collision - by admin - 05.12.2022, 07:51
RE: RS485 signal collision - by Hadeel - 05.12.2022, 18:58
RE: RS485 signal collision - by admin - 06.12.2022, 07:49
RE: RS485 signal collision - by Hadeel - 07.12.2022, 15:03
RE: RS485 signal collision - by Hadeel - 23.03.2023, 02:31
RE: RS485 signal collision - by admin - 23.03.2023, 06:00
RE: RS485 signal collision - by Hadeel - 23.03.2023, 07:48
RE: RS485 signal collision - by admin - 23.03.2023, 08:41
RE: RS485 signal collision - by Hadeel - 28.03.2023, 08:35
RE: RS485 signal collision - by admin - 30.03.2023, 05:42
RE: RS485 signal collision - by Hadeel - 30.03.2023, 07:59

Forum Jump: