pa-pa / AskSinPP

104 stars 71 forks source link

Recreating HM-RC-Key4-2 #204

Open oskarn97 opened 4 years ago

oskarn97 commented 4 years ago

Hey there,

I am trying to recreate HM-RC-Key4-2 and peer it directly to KeyMatic without the help of a VCCU. I've deployed the default eq3 AES Key and enabled AES support inside the sketch. Pairing it to FHEM and then peering it to KeyMatic works fine, but the direct peering does not. Once the pairing mode of an additional remote in KeyMatic is enabled, I start the pairing using the config button at my PCB (led blinks). Pressing any button of the recreated remote also does nothing. I would be very thankful for any advice.

Thanks a lot!

#define SERIAL "ABCD"
#define DEVICE_ID {0x10, 0x08, 0x05}

#define USE_AES
#define HM_DEF_KEY 0xA4,0xE3... //default eq3 key
#define HM_DEF_KEY_INDEX 0

const struct DeviceInfo PROGMEM devinfo = {
  DEVICE_ID,     // Device ID
  SERIAL,           // Device Serial
  {0x00, 0xA6},           // HM-RC-Key4-2 
  0x11,                   // Firmware Version
  as::DeviceType::Remote, // Device Type
  {0x00, 0x00}            // Info Bytes
};
typedef AvrSPI<10, 11, 12, 13> SPIType;
typedef Radio<SPIType, 2> RadioType;
typedef AskSin<StatusLed<LED_PIN>, BatterySensorExt<A0, 0xFF>, RadioType> HalType;

class Hal : public HalType {
    AlarmClock btncounter;
  public:
    void init (const HMID& id) {
      HalType::init(id);
      battery.init(3, btncounter, 1);
      battery.low(25);
      battery.critical(22);
    }

    void sendPeer () {
      --btncounter;
    }

    bool runready () {
      return HalType::runready() || btncounter.runready();
    }

};

typedef RemoteChannel<Hal, 4, List0> ChannelType;
typedef MultiChannelDevice<Hal, ChannelType, 4, List0> RemoteType;

Hal hal;
RemoteType sdev(devinfo, 0x20);
ConfigButton<RemoteType> cfgBtn(sdev);

void setup()
{
  sdev.init(hal);
  buttonISR(cfgBtn, CONFIG_BUTTON_PIN);
  cfgBtn.init(CONFIG_BUTTON_PIN);
  sdev.initDone();
}
jp112sdl commented 4 years ago

You know that the SERIAL has to be a string with a fixed length of 10 characters?

oskarn97 commented 4 years ago

Yes, that was just a placeholder

oskarn97 commented 4 years ago

I've just read that it is not possible to directly peer devices without the help of VCCU. Is that information still up to date?

jp112sdl commented 4 years ago

If one of the (or both) devices is/are paired with a ccu, you cannot create peerings between them directly. That is still up to date.

Bildschirmfoto 2020-09-20 um 13 29 40
oskarn97 commented 4 years ago

That is not what I meant. I read in a forum that AskSinPP cannot peer devices directly without the help of CCU. The Keymatic is only paired to a master remote.

jp112sdl commented 4 years ago

that AskSinPP cannot peer devices directly

Ah okay, sorry, then unfortunately I can't help. I never tried to peer devices directly without a central

oskarn97 commented 4 years ago

Thanks anyway, appreciate it!

pa-pa commented 4 years ago

I have no idea how peering without central should work. I have nothing implemented into this direction.

oskarn97 commented 4 years ago

Would it help if I recorded the communication between an original HM-RC-Key4-2 and a Keymatic while pairing with each other?