lprhodes / broadlinkjs-rm

Control the IR and RF interfaces within Broadlink RM devices.
MIT License
57 stars 52 forks source link

Get error 65535 #21

Closed chazeon closed 4 years ago

chazeon commented 4 years ago

Hi,

I am using homebridge-broadlink-rm, and I cannot successfully discover my device. I tried to debug your code.

I can see I have the device discovered, but never receive the deviceReady.

My device is

  devices: {
    '��$PM*': Device {
      host: [Object],
      mac: <Buffer xx xx xx xx>,
      emitter: [EventEmitter],
      log: undefined,
      type: 24374,
      model: 'Broadlink RM Mini 3 D',
      on: [Function: addListener],
      emit: [Function: emit],
      removeListener: [Function: removeListener],
      count: 1,
      key: <Buffer xxxx>,
      iv: <Buffer xxxx>,
      id: <Buffer 00 00 00 00>,
      socket: [Socket],
      debug: undefined,
      _events: [Object: null prototype],
      _eventsCount: 1
    }
  },

On discover device, I am getting the following response:

<Buffer 5a a5 aa 55 5a a5 aa 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c5 c9 ff ff 2a 27 e9 03 01 00 2a 4d 50 24 df a7 00 00 ... 6 more bytes>

and thus I am getting a error 65535 at line 270

I am not familiar with socket, etc and therefore cannot understand what is happening.

Do you know what kind of problem I am having?

chazeon commented 4 years ago

Problem solved by resetting the device.

expovin commented 3 years ago

Problem solved by resetting the device.

Hi chazeon , I face exactly the same issue. I've got 2 RM3 Mini devices, an old one (bought a couple of years ago) and a new one (bought this week). The older has no problem, discovery process work like a charme. but the new one fails with the exact same error. at line 270 while checking the incoming message for the setupSocket as the byte 0x22 and 0x23

const err = response[0x22] | (response[0x23] << 8);

which for the new device are 0xFF and 0xFF in decimal -> 65535

This is the message coming from the device that works:

00000000  5a a5 aa 55 5a a5 aa 55  00 00 00 00 00 00 00 00  |Z..UZ..U........|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  ae d5 00 00 2a 27 e9 03  01 00 c1 b5 16 c8 f7 42  |....*'.........B|
00000030  00 00 00 00 3c c5 00 00  1c 3c 40 c5 33 9a 0d 76  |....<....<@.3..v|
00000040  44 ea 34 11 2a c1 92 a3  81 13 1f 70 59 0a f7 7c  |D.4.*......pY..||
00000050  76 63 92 c3 27 ac bb 42                           |vc..'..B|

That's the message coming from the new one (not working)

00000000  5a a5 aa 55 5a a5 aa 55  00 00 00 00 00 00 00 00  |Z..UZ..U........|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  b8 ca ff ff 2a 27 e9 03  01 00 d1 09 e0 24 df a7  |....*'.......$..|
00000030  00 00 00 00 af be 00 00                           |........|
00000038

Of course I reset the device several times. Do you remember any other action you got?

Thanks

Vincenzo