koalazak / dorita980

Unofficial iRobot Roomba and Braava (i7/i7+, 980, 960, 900, e5, 690, 675, m6, etc) node.js library (SDK) to control your robot
MIT License
942 stars 150 forks source link

set wlcfg #66

Closed ameinhardt closed 6 years ago

ameinhardt commented 6 years ago

Hi, I have a new irobot 980 and I'm trying to avoid the app. I can connect well with blid and pwd '' (allow in dorita) to the roomba access point after pressing the home+spot button. I can set the time for example with

let d = new Date();
roomba.setPreferences({
    utctime: Math.floor(d.getTime()/1000),
    localtimeoffset: d.getTimezoneOffset()
})

Now, I'd like to adjust the WL settings with

roomba.setPreferences({
  wlcfg: {
    ssid: "myssid".split('').map(c => c.charCodeAt(0).toString(16)).join(''),
    sec: 7,
   /*
      0: none,
      1: wep_open,
      2: wep_shared,
      3: wpa,
      4: wpa2,
      5: wpa_wpa2_mixed,
      6: eap_tls,
      7: wildcard
     */
    passwd: "mypasswd",
    dhcp: 1,
    addr: 0,
    mask: 0,
    gtwy: 0,
    dns1: 0,
    dns2: 0
  }
});

Unfortunately, it doesn't connect and I get

packet {"state":{"reported":{"wifierr":5}}}

Any idea why this could be and how to make it connect to another AP?

koalazak commented 6 years ago

I have no idea how to connect to an AP via setting preferences. May be you need to sniff the trafic and see how the mobile app do that and then try to do the same.

ameinhardt commented 6 years ago

it's pass, not passwd. Also, I had to activate the wifi after:

{
  wactivate: true
}
koalazak commented 6 years ago

awesome!