Global Caché

Ok, can you try escaping the backslash as its JSON. i.e put double

\\x02POF\\x03\\0D

. Also have you verified that the baud rate and the other settings are correct for your connected device?

Double backslash also doesn’t work I’m afraid.
Setting on the WF2SL are correct as far as I can tell
49

I was referring the config in the apps JSON, my understanding is that overrides the stuff configured on the iTach.
However I found one issue with the config cmd sent and also put in some debug logging. Can you have another go after updating the app?

EDIT: one more fix pushed

Oh , you meant these settings?
25
Seems like they are ok as well.
I also tried renaming “PARITY_NO” to “PARITY_NONE” because that’s what the setting is called on the WF2SL but that didn’t help.
Just installed the latest version but it’s still not working.
What I did notice looking through your code is that in device.js in master/drivers/ip2sl/device.js it says “class ITachIP2IRDevice extends ITachDevice” while the IP2CC has “class ITachIP2CCDevice extends ITachDevice”.
Should it say “class ITachIP2SLDevice extends ITachDevice”?
Mind you, I have no coding experience what so ever so please excuse me if I’m talking bullsh*t :wink:

Oh, you’re totally right, i’ve pushed another fix… not sure if that was a problem though but perhaps, it depends how homey loads the classes as it was under the correct driver directory. Did you get any new output log?

Now it crashes right after I run the flow.
10
And below is the output log:

✓ Validating app…
✓ Homey App validated successfully against level debug
✓ Packing Homey App…
✓ Installing Homey App on Homey (http://192.168.3.88:80)…
✓ Homey App com.globalcache successfully installed
✓ Running com.globalcache, press CTRL+C to quit
─────────────── Logging stdout & stderr ───────────────
2018-10-07 12:39:26 [log] [MyApp] MyApp is running…
listening on 0.0.0.0:9131
2018-10-07 12:39:35 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171
2018-10-07 12:41:05 [log] [ManagerDrivers] [ip2sl] Device found: iTachWF2SL @ http://192.168.3.171
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object] ] } }
2018-10-07 12:41:15 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171
2018-10-07 12:41:15 [log] [ManagerDrivers] [ip2cc] Device found: iTachWF2SL @ http://192.168.3.171
2018-10-07 12:41:15 [log] [ManagerDrivers] [ip2sl] Device found: iTachWF2SL @ http://192.168.3.171
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object] ] } }
sending config set_SERIAL,1:1,9600,FLOW_NONE,PARITY_NO
/drivers/ip2sl/device.js:47
payloadClient.connect(this._serialPort, this._deviceData.ip, function () {
^

TypeError: Cannot read property ‘ip’ of undefined
at Socket. (/drivers/ip2sl/device.js:47:64)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:594:20)

— INFO: com.globalcache has been killed —
2018-10-07 12:42:16 [log] [MyApp] MyApp is running…
listening on 0.0.0.0:9131
2018-10-07 12:42:16 [log] [ManagerDrivers] [ip2sl] [0] device init
2018-10-07 12:42:16 [log] [ManagerDrivers] [ip2sl] [0] name: iTachWF2SL (192.168.3.171)
2018-10-07 12:42:16 [log] [ManagerDrivers] [ip2sl] [0] class: other
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object] ] } }
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object] ] } }
2018-10-07 12:42:25 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171
2018-10-07 12:42:45 [log] [ManagerDrivers] [ip2sl] Device found: iTachWF2SL @ http://192.168.3.171
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object] ] } }
2018-10-07 12:42:55 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171
2018-10-07 12:42:55 [log] [ManagerDrivers] [ip2cc] Device found: iTachWF2SL @ http://192.168.3.171
2018-10-07 12:42:55 [log] [ManagerDrivers] [ip2sl] Device found: iTachWF2SL @ http://192.168.3.171
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object] ] } }
sending config set_SERIAL,1:1,9600,FLOW_NONE,PARITY_NO
/drivers/ip2sl/device.js:47
payloadClient.connect(this._serialPort, this._deviceData.ip, function () {
^

TypeError: Cannot read property ‘ip’ of undefined
at Socket. (/drivers/ip2sl/device.js:47:64)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:594:20)

— INFO: com.globalcache has been killed —
2

ok sorry my fault , new version again :slight_smile:

No problem!
Just installed the latest but unfortunately it’s still not working.
Below is the log.

✓ Validating app…

✓ Homey App validated successfully against level debug

✓ Packing Homey App…

✓ Installing Homey App on Homey (http://192.168.3.88:80)…

✓ Homey App com.globalcache successfully installed

✓ Running com.globalcache, press CTRL+C to quit

─────────────── Logging stdout & stderr ───────────────

2018-10-07 12:55:15 [log] [MyApp] MyApp is running…

listening on 0.0.0.0:9131

2018-10-07 12:55:25 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171

2018-10-07 12:55:25 [log] [ManagerDrivers] [ip2cc] Device found: iTachWF2SL @ http://192.168.3.171

2018-10-07 12:57:25 [log] [ManagerDrivers] [ip2sl] Device found: iTachWF2SL @ http://192.168.3.171

{ ir: { devices: [ [Object], [Object] ] },

serial:

{ baudrate: ‘9600’,

flowcontrol: ‘FLOW_NONE’,

parity: ‘PARITY_NO’,

cmds: [ [Object], [Object], [Object], [Object] ] } }

2018-10-07 12:57:35 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171

2018-10-07 12:57:35 [log] [ManagerDrivers] [ip2cc] Device found: iTachWF2SL @ http://192.168.3.171

2018-10-07 12:57:35 [log] [ManagerDrivers] [ip2sl] Device found: iTachWF2SL @ http://192.168.3.171

{ ir: { devices: [ [Object], [Object] ] },

serial:

{ baudrate: ‘9600’,

flowcontrol: ‘FLOW_NONE’,

parity: ‘PARITY_NO’,

cmds: [ [Object], [Object], [Object], [Object] ] } }

sending config set_SERIAL,1:1,9600,FLOW_NONE,PARITY_NO

sending payload |02|PON|03|0D

{ ir: { devices: [ [Object], [Object] ] },

serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object] ] } }
sending config set_SERIAL,1:1,9600,FLOW_NONE,PARITY_NO
sending payload \x02POF\x03\0D
2018-10-07 12:57:45 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171

Ps, I’ll skip the “Device found” lines in the next log. Sorry for cluttering…:wink:

Ok at least everything looks correct now. I need to go out for a while but can have another look this evening.

Sure, I’ll check in later to see if you need anything.
Thanks again for your efforts!

ok I possible found a problem , can you try the new version.

Also on your second command I think the last char should be \\x0D

I think the only format thats supported now is the second command in your example (on2), if you need those control characters.

Sorry, still no response from my projector.
Also tried the \x0D but didn’t help.
Below is the log (without all the excess “device found” lines :wink: )

✓ Validating app…
✓ Homey App validated successfully against level debug
✓ Packing Homey App…
✓ Installing Homey App on Homey (http://192.168.3.88:80)…
✓ Homey App com.globalcache successfully installed
✓ Running com.globalcache, press CTRL+C to quit
─────────────── Logging stdout & stderr ───────────────
2018-10-07 21:03:57 [log] [MyApp] MyApp is running…
listening on 0.0.0.0:9131
2018-10-07 21:03:57 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171
2018-10-07 21:04:40 [log] [ManagerDrivers] [ip2sl] [0] device init
2018-10-07 21:04:40 [log] [ManagerDrivers] [ip2sl] [0] name: iTachWF2SL (192.168.3.171)
2018-10-07 21:04:40 [log] [ManagerDrivers] [ip2sl] [0] class: other
2018-10-07 21:04:40 [log] [ManagerDrivers] [ip2sl] [0] device added
2018-10-07 21:04:47 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object], [Object] ] } }
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object], [Object] ] } }
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object], [Object] ] } }
sending config set_SERIAL,1:1,9600,FLOW_NONE,PARITY_NO
config response <Buffer 53 45 52 49 41 4c 2c 31 3a 31 2c 39 36 30 30 2c 46 4c 4f 57 5f 4e 4f 4e 45 2c 50 41 52 49 54 59 5f 4e 4f 0d>
sending payload \x02POF\x03\x0D
2018-10-07 21:07:07 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object], [Object] ] } }
2018-10-07 21:07:18 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object], [Object] ] } }
sending config set_SERIAL,1:1,9600,FLOW_NONE,PARITY_NO
config response <Buffer 53 45 52 49 41 4c 2c 31 3a 31 2c 39 36 30 30 2c 46 4c 4f 57 5f 4e 4f 4e 45 2c 50 41 52 49 54 59 5f 4e 4f 0d>
sending payload \x02POF\x03\0D
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object], [Object] ] } }
2018-10-07 21:07:27 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171
{ ir: { devices: [ [Object], [Object] ] },
serial:
{ baudrate: ‘9600’,
flowcontrol: ‘FLOW_NONE’,
parity: ‘PARITY_NO’,
cmds: [ [Object], [Object], [Object], [Object], [Object] ] } }
sending config set_SERIAL,1:1,9600,FLOW_NONE,PARITY_NO
config response <Buffer 53 45 52 49 41 4c 2c 31 3a 31 2c 39 36 30 30 2c 46 4c 4f 57 5f 4e 4f 4e 45 2c 50 41 52 49 54 59 5f 4e 4f 0d>
sending payload |02|PON|03|0D
2018-10-07 21:07:38 [log] [ManagerDrivers] [ip2ir] Device found: iTachWF2SL @ http://192.168.3.171

Edit: just saw that I copied my POF codes instead of PON and corrected it in my flows but still no response from the projector.

Ok, just to double check , the only command in logs above that I think is supported right now has power off (POF)
instead of power on PON

sending payload \x02POF\x03\x0D

Is this correct?

Yeah I noticed it send POF instead of PON just after posting but changing it to PON didn’t make a difference.
I kept forgetting to change the text-file I copy from but just changed it so it won’t happen again :wink:

Every test I tried 3 codes and after your suggestion now 4 codes:
PON
\x02PON\x03\x0D
\x02PON\x03\0D
|02|PON|03|0D

None work unfortunately.

Ok, its very strange that it doesn’t work. I have even set up iTest now and debugged what that one is sending against a mock server (simulating the iTach) and its exactly same as from the app from what I can see. Can you post a screenshot on a working iTest example with a working command. Its running on port 4999 (Serial 1), right?

This is what works using iTest.
Indeed port4999 (serial 1).
In the screenshot the literal button is highlighted but I use mixed button to send the command

Can you try with this format instead:

\u0002PON\u0003\u000D

Use single backslashes

Special codes (hex) needs to be \u and 4 digits, so just prefix them with 00 as its coming from JSON, my fault, should have thought about that earlier :slight_smile:

YES!!! It works!
Power on, power off, lensmemories, 3d settings :tada:
Man, I’m am so happy :yum:
Thank you so much for your efforts and help!!
Please don’t forget to add a donate button as soon as your submit you app to the app store.
Just, just…wow

Great news! I guess I could add support of other types of format like iTest support. Can you paste in a log now when some command is successful. I’m a bit worried that the client doesn’t disconnect and that may cause a problem after a while.