How to update sensor relay from serial gateway
Troubleshooting
12
Posts
3
Posters
4.7k
Views
2
Watching
-
I also tried using node.js ...
I check if i receive serial data on my gateway using :
bash> picocom /dev/ttyUSB1 -b 115200 -r -l --omap lfcrlf --imap lfcrlf --emap lfcrlf Terminal ready send: 1-1-0-0 s=255,c=0,t=18,pt=0,l=3,sg=0,st=ok:1.5 send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0 repeater started, id=1, parent=0, distance=1 send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=5,sg=0,st=ok:Relay send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0 send: 1-1-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,st=ok:Here is my node.js script :
const gwType = 'Serial'; //const gwPort = 'COM4'; const gwPort = '/dev/ttyUSB0'; const gwBaud = 115200; //var SerialPort = require('/home/bxl/node-v0.12.0-linux-x64/lib/node_modules/serialport'); var serialport = require('/home/bxl/node-v0.12.0-linux-x64/lib/node_modules/serialport'); var SerialPort = serialport.SerialPort; gw = new SerialPort(gwPort, { baudrate: gwBaud ,parser: serialport.parsers.readline("\n") }); gw.on('open', function() { console.log('connected to serial gateway at ' + gwPort); gw.write('1;1;1;0;2;1'); console.log('Write done.'); }).on('end', function() { console.log('disconnected from gateway'); }).on('error', function() { console.log('connection error - trying to reconnect'); gw.open(); });but nothing move on my serial gateway :(
-
I also try to put my gateway on a widows machine and on arduino ide :

I send : 1;1;1;0;2;1
But on my node :
bash> picocom /dev/ttyUSB1 -b 115200 -r -l --omap lfcrlf --imap lfcrlf --emap lfcrlf picocom v1.7 port is : /dev/ttyUSB1 flowcontrol : none baudrate is : 115200 parity is : none databits are : 8 escape is : C-a local echo is : no noinit is : no noreset is : yes nolock is : yes send_cmd is : sz -vv receive_cmd is : rz -vv imap is : lfcrlf, omap is : lfcrlf, emap is : lfcrlf, Terminal ready send: 1-1-0-0 s=255,c=0,t=18,pt=0,l=3,sg=0,st=ok:1.5 send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0 repeater started, id=1, parent=0, distance=1 send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=5,sg=0,st=fail:Relay send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0 send: 1-1-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,st=ok: -
i try with the option without success.
I also try to reset EEPROM & assigning Node ID with "MYScontroller" :

On my node :
Terminal ready req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail: repeater started, id=255, parent=0, distance=1 req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:I think my gateway don't really send message ...
Any idea why ? -
I used a mini pro whith FTDI :

It wasn't working the serial gateway don't send data.
I test with a nano and all is ok now ...

And on my relay sensor :
Terminal ready req id send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok: read: 0-0-255 s=255,c=3,t=4,pt=0,l=1,sg=0:1 send: 1-1-0-0 s=255,c=0,t=18,pt=0,l=3,sg=0,st=ok:1.5 send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0 read: 0-0-1 s=255,c=3,t=6,pt=0,l=1,sg=0:M id=1 send: 1-1-0-0 s=255,c=0,t=18,pt=0,l=3,sg=0,st=ok:1.5 send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0 read: 0-0-1 s=255,c=3,t=6,pt=0,l=1,sg=0:M repeater started, id=1, parent=0, distance=1 send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=5,sg=0,st=ok:Relay send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0 send: 1-1-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,st=ok: