kumy / Roomba-Wifi-Initial-Provisionning

Configure irobot wifi series using command line
MIT License
7 stars 2 forks source link

Roomba 966 no Wi-Fi connection. SSID Hex Conversion issue? #1

Closed maramend closed 3 years ago

maramend commented 3 years ago

Hi,

I have a Roomba 966 bought in 2019, which was never connected to the Internet, so I don't know the FW version.

I followed your proposed procedure, reset the Roomba, start Soft AP, get robot CA, set path to robot-ca.pem and finally execute initial-config.py. The only thing I modified was the SSID and password according to my WPA2 protected home network settings:

My SSID FRITZ!Box Fon WLAN 7170 I converted to hex: 465249545A21426F7820466F6E20574C414E2037313730, the password I put as plain text. The procedure ran without any hassle, giving me the following output.

received data: hex: b'f023', length: 2
received data: hex: b'efcc3b29003a313a313537393139353338363a386678376e597156744b67574a39744f', length: 35
received data: hex: b'f023efcc3b29003a313a313537393139353338363a386678376e597156744b67574a39744f', length: 37
Sending: wifictl {"state": {"wlcfg": {"pass": "xxxxxxxxx", "sec": 7, "ssid": "465249545A21426F7820466F6E20574C414E2037313730"}}}
Sending: wifictl { "state" : { "chkssid" : true } }
Sending: wifictl { "state" : { "wactivate" : true } }
Sending: wifictl { "state" : { "get" : "netinfo" } }
Sending: wifictl { "state" : { "uap" : false } }

Unfortunately the Wi-Fi LED does not turn white and the Roomba does not connect to my access point. Since the procedure as such is very simple I assume an error with the SSID ASCII-Hex conversion or with the password.

Can you confirm, that my SSID conversion is fine?

kumy commented 3 years ago

Hi @maramend your conversion seems fine, using https://www.rapidtables.com/convert/number/ascii-to-hex.html I also get 465249545A21426F7820466F6E20574C414E2037313730. AFAIR the password should be clear text, as you did, but I have some doubts (I did not touch this since one year), did you tried to convert it to hex string? other things that come in mind, did you heard as many bip as sent message count? Also, my test SSID is quite small (WWW), I'm wondering if roomba accept all your characters (the !) or if it is "too long" (I've seen that with a samsung Air conditionner), could you try to reconfigure your AP with an "easy" SSID to validate that hypothesis? Also, wondering if the string has to be reversed or not, such has 0717 NALW noF xoB!ZTIRF. All this may seems stupid… but who knows :smile:

maramend commented 3 years ago

Hi @kumy,

thanks for the quick response. I have not received any "beep" sound from the Roomba when I executed initial-config.py. So, I can try out some of your proposals. However, I'm wondering if it would be easier for you to get this verified on your side, since my understanding is that you have just to capture the communication in your testbed between App and Roomba, right?

kumy commented 3 years ago

I have not received any "beep" sound from the Roomba when I executed initial-config.py

hum, strange, I remember to have one.

I do not have the environment anymore to trace the communication, but I may try to replay the config with another SSID. I'll try to check "soon".

maramend commented 3 years ago

I changed my Wifi now to SSID "WWW" and password to "wifisecretpasssword" according to the default setting in https://github.com/kumy/Roomba980-Wifi/blob/b81d921a00cec1ebc96c1e5457af34f99646cfec/initial-config.py.

I started again the whole precedure, resetting Romba, Soft AP, ..., ./initial-config.py. Again no errors in the script but also no "beep" sound. The Roomba just keeps remaining the Soft AP open...

I tried two ways, first: {'topic':"wifictl", 'payload':'{"state": {"wlcfg": {"pass": "wifisecretpasssword", "sec": 7, "ssid": "575757"}}}'}, and second with the password converted to hex: {'topic':"wifictl", 'payload':'{"state": {"wlcfg": {"pass": "776966697365637265747061737373776f7264", "sec": 7, "ssid": "575757"}}}'},

Is there any feedback from the Roomba which can be captured in the Python file when execute client.publish(msg['topic'], msg['payload'])?

kumy commented 3 years ago

Sorry for the long delay. I've check it tonight, I've got some problems with SSL that should be fixed now. I've also added the shell version using mosquitto-clients. Also to note, while doing configuration my robot in on it's base.

Check the commit diff https://github.com/kumy/Roomba980-Wifi/commit/1cf9ab7acdecaf6370a3d9348e064af7d29bbd68

Let me know if it now works for you :crossed_fingers:

maramend commented 3 years ago

Check the commit diff 1cf9ab7

Hi @kumy,

thanks for your effort. Before I give it a try, can you explain me

  1. BLID. Is this a static value or or derived from something? You state

    Check the WIFI SSID name, it's your BLID, set it in the script

However in your initial-config.py your SSID 54657374 and BLID 80A7001234567890 are different?!

  1. The bash script and the python script are doing the same, right? So it doesn't matter which one is executed...
  2. You added to the repo a robot-ca.pem. I thought, that has to be individually created with openssl s_client -showcerts -connect 192.168.10.1:8883 < /dev/null 2>/dev/null|openssl x509 -outform PEM > robot-ca.pem?!, isn't it? You changed this command however toopenssl s_client -showcerts -verify 5 -connect 192.168.10.1:8883 < /dev/null, but that does not create a PEM file anymore. So is the PEM unique per Roomba or universal?
kumy commented 3 years ago

Hi @maramend

  1. The BLID is a unique identifier per robot. You can discover it easily when the Wifi access point is activated on your robot (it is enabled by a long press on home+spot. You should hear a melody). It should look something like "wifi-XYZXYZXYZXYZ" (I don't remember the exact format). Just ignore the prefix, and use the second part XYZXYZXYZ... this is your BLID. Here the SSID has not to be confused with the SSID of the network you wish your robot to connect to after it has been configured. it's the own robot AP.
  2. Basically yes, but in the shell script the password from line 3 is hard coded in the long string in line 9. The python script build it based on the configured values. The shell script is just a helper template for those who wish to do the process manually.
  3. For me the robot-ca.pem to be the same for all robots (you'll may confirm ;)). The new command effectively doesn't create the file, but ouput all certs used here. The second block is the CA, the first is the certificate of your own robot (you'll also find the BLID in there ;)) I've included the file in the repo, it is necessary for the process and it's a public part that everyone can retrieve, there is not secret in it.

I hope you'll get success!

maramend commented 3 years ago

@kumy Worked like a charme. I used the python script and modified BLID, SSID and Wi-Fi password. Different to your .pem file looked the one I created with the command from https://github.com/kumy/Roomba980-Wifi/issues/1#issuecomment-765994348. For that reason I used my .pem file.

Moreover, I can confirm, that sending the timezone generates the BEEP sound. Even my long SSID from my opening post was directly accepted.

Good job, thanks.

kumy commented 3 years ago

Great! If you feel the doc can be enhanced, feel free to provide PR :wink:

Let's close the issue then. Bests