Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECONNREFUSED to j7+ after upgrade to 1.4.0 #129

Open
dgilev opened this issue Dec 13, 2022 · 35 comments
Open

ECONNREFUSED to j7+ after upgrade to 1.4.0 #129

dgilev opened this issue Dec 13, 2022 · 35 comments
Assignees
Labels
bug Something isn't working

Comments

@dgilev
Copy link

dgilev commented Dec 13, 2022

homebridge-roomba2 pluging stopped working right after upgrade from 1.3.1 to 1.4.0. Getting the following error:

[12/12/2022, 3:57:55 PM] [xxxxxx] DEBUG: Will refresh Roomba's status again automatically in 15m
[12/12/2022, 4:12:55 PM] [xxxxxx] DEBUG: Automatically refreshing Roomba's status
[12/12/2022, 4:12:55 PM] [xxxxxx] DEBUG: Connecting to Roomba (0 others waiting)...
[12/12/2022, 4:12:55 PM] [xxxxxx] DEBUG: Connection close received
[12/12/2022, 4:12:56 PM] [xxxxxx] DEBUG: Old connection received error: connect ECONNREFUSED 192.168.1.166:8883
[12/12/2022, 4:13:55 PM] [xxxxxx] DEBUG: Timed out after 60000ms trying to connect to Roomba
[12/12/2022, 4:13:55 PM] [xxxxxx] Failed to refresh Roomba's state: Connect timed out

IP/port are correct and pingable/accessible from homebridge instance:

% telnet 192.168.1.166 8883
Trying 192.168.1.166...
Connected to irobot-xxxxxx.localdomain.
Escape character is '^]'.

Tried to reboot both homebridge and robot itself to no success. I remember that I had to change ciphers used by dorita980 module in the past version but it looks like it's already accounted for in 1.4.0 with addition of TLS_AES_256_GCM_SHA384:

ciphers: process.env.ROBOT_CIPHERS || 'AES128-SHA256,TLS_AES_256_GCM_SHA384'

Any ideas on how to troubleshoot it further? Thanks!

Versions

  • Homebridge: 1.6.0
  • Node: v16.13.1
  • Plugin: homebridge-roomba2 v1.4.0
@karlvr
Copy link
Collaborator

karlvr commented Dec 18, 2022

@dgilev this is curious. Perhaps try removing AES128-SHA256 from that ciphers string to see if that makes a difference?
Sometimes having another connection open to the Roomba, such as an app etc can cause further connections to be rejected, so make sure there isn't anything else connected?

@IngmarStein
Copy link

+1. I'm getting the same error since 1.4.0 for a 980 which is pingable and reachable on port 8883, but I get connection timeouts:

[12/19/2022, 10:21:15 PM] [Robbie] Timed out after 60000ms trying to connect to Roomba
[12/19/2022, 10:21:15 PM] [Robbie] Failed to refresh Roomba's state: Connect timed out
[12/19/2022, 10:21:15 PM] [Robbie] Will refresh Roomba's status again automatically in 15m

@dgilev
Copy link
Author

dgilev commented Dec 20, 2022

@karlvr Removing of AES128-SHA256 did the trick! But I swear I tried it before and it didn't work. 😁 Thanks for the suggestion though!

To anyone who is facing the same issue with J7 (not sure if other models are affected) on homebridge-roomba2 v1.4.0 and/or new dorita980 module: remove AES128-SHA256 from the ciphers list in homebridge-roomba2/node_modules/dorita980/lib/v2/local.js leaving only TLS_AES_256_GCM_SHA384.

@karlvr
Copy link
Collaborator

karlvr commented Dec 20, 2022

@dgilev wow, OK, good news but that's a bit of a bummer. I thought it was neat that we could specify multiple ciphers. Could you please try putting the two ciphers in the opposite order and see if you can connect?

@raghavsethi
Copy link

Can confirm this fixes connection issues with j7. Thanks @dgilev!

@Firemanjoe
Copy link

Firemanjoe commented Mar 17, 2023

I'm getting the same error on my i1+ that I just purchased today and for some reason I am unable to edit the js file. It's asking for the password ad when I enter my hombridge password, it says that it's not accepted.

Thoughts?

Further clarification, I've been able to add the unit to the homebridge and I've been able to edit the json file; however, when I remove the AES128-SHA256, I loose contact for my 691; however, it also doesn't enable the i1+. It continues to timeout.

If I remove TLS_AES_256_GCM_SHA384, I'm not any further either.

@karlvr
Copy link
Collaborator

karlvr commented Apr 23, 2023

Please try installing version 1.5.0-beta.0... I have overhauled the connection logic so we attempt multiple ciphers now. Hopefully I've correctly detected the connection failure in all cases...

To install the beta click on the wrench on the plugin on the Plugins screen, and choose Install Alternate Version.

If you have Debug logging enabled you should see a log entry like:

[4/24/2023, 6:57:21 AM] [Roomba] DEBUG: Connection received error: Client network socket disconnected before secure TLS connection was established
[4/24/2023, 6:57:21 AM] [Roomba] Retrying connection to Roomba with cipher TLS_AES_256_GCM_SHA384

If it doesn't work, I need to see the error messages, such as the "Failed to refresh Roomba's state..." message. Please turn on Debug logging so there are more detailed logs to examine, and also please include the version of Node you are using to run Homebridge.

@karlvr karlvr added the bug Something isn't working label Apr 23, 2023
@Firemanjoe
Copy link

Firemanjoe commented Apr 24, 2023 via email

@karlvr
Copy link
Collaborator

karlvr commented Apr 24, 2023

@Firemanjoe it looks like the email reply list what you were trying to send.

@Firemanjoe
Copy link

Screenshot 2023-04-24 at 1 05 58 PM

Yes sorry, looks like gmail stripped it out. Here you go!

@karlvr
Copy link
Collaborator

karlvr commented Apr 25, 2023

@Firemanjoe thank you, can you please tell me which version of Node Homebridge is running with? It shows it on the System Information panel on the homepage of the Config UI.

@karlvr
Copy link
Collaborator

karlvr commented Apr 25, 2023

@Firemanjoe Also... as I understand it, you are having issues connecting to your i1+ and you also have a 691. Your 691 was working previously, but your i1+ has never worked... you did try changing the ciphers in doriat980’s local.js, however perhaps you didn't make the right change... it looks like you tried with just the AES128-SHA256 cipher but not with just the TLS_AES_256_GCM_SHA384 cipher.

So... I'll release a new beta that will attempt different ciphers based on the error message you saw and we'll see if that succeeds... otherwise there might be something else at play.

Please try v1.5.0-beta.2 now.

@karlvr
Copy link
Collaborator

karlvr commented Apr 25, 2023

@Firemanjoe how did you obtain the blid and the password for your i1+?

@Firemanjoe
Copy link

Firemanjoe commented Apr 25, 2023

I don't recall exactly where I found this command, but this was what I ended up using as any other method wasn't working.

Screenshot 2023-03-18 at 8 21 37 PM Redacted

As for the 691, yes - it still works great - it will go unresponsive once in a while and I'll have to simply take it off and put it back on for a second, but it'll usually stay responsive. For the 1+, it won't show any connection on Homebridge or in the Home App.

I wanted to try to change the ciphers, but I can't seem to get the file to allow me to write the changes. I'm not quite familiar to truly troubleshoot, but I can copy/paste quite well!

@karlvr
Copy link
Collaborator

karlvr commented Apr 25, 2023

@Firemanjoe OK, thank you. Please try the latest beta version as above (I'm sorry, I posted three comments in a row!) and let's see what happens with the i1+

@Firemanjoe
Copy link

@karlvr - Thanks Karl - no issues with the multiple tags/posts. I'm more than happy to help out and see how it can get working. I'm installing the latest one now and I'll advise in a moment.

Installed and I'm still getting the same "Identifier rejected" error. Going to reboot the homebridge as well and see if that can somehow make a difference.

@Firemanjoe
Copy link

@karlvr - New error this time.

Screenshot 2023-04-24 at 10 57 23 PM

@karlvr
Copy link
Collaborator

karlvr commented Apr 25, 2023

@Firemanjoe OK, give your Roomba a few minutes and make sure you don't have the mobile app running. Roomba only supports one connection at a time.

Also, you do need to reboot Homebridge after upgrading the plugin.

@Firemanjoe
Copy link

Firemanjoe commented Apr 25, 2023

Ah! ok! I opened the app to "connect to it" and I killed the app (iRobot). I see that HB has a 15min recheck status right now, so I'll wait that out and advise later when the logs refreshes.

@karlvr - time has elapsed and same error - even after another reboot - just to make sure!

@karlvr
Copy link
Collaborator

karlvr commented Apr 25, 2023

@Firemanjoe OK, you may need to reboot your Roomba... https://homesupport.irobot.com/s/article/9087

I think the ECONNREFUSED means that it's tired of talking... let's try a reboot of Roomba.

@Firemanjoe
Copy link

So apparently a reboot of the robot through the app is not the same thing as the reboot that you have linked. I'll give that a try tomorrow as I'm calling it a night for now.

It looks like I need to set it up as a new bot again - which is fine, but I'll do that in the morning! Thanks for the help & I'll update tomorrow.

@karlvr
Copy link
Collaborator

karlvr commented Apr 25, 2023

@Firemanjoe thank you, I wouldn't think you'd need to add it again... I do suspect that the cloud password that you've obtained is not the one you need. So if it doesn't work after the reboot, I suggest trying to normal way of obtaining the password based on the instructions in this repository.

I'm expecting that you'll have some problems!

So if it doesn't work, let's try:

ROBOT_CIPHERS=TLS_AES_256_GCM_SHA384 npm run getpassword <IP ADDRESS>

I'd like to see the error messages from the original and this command.

@Firemanjoe
Copy link

Tried your approach and this is the original error an still an error that I'm getting now.

Screenshot 2023-04-25 at 7 25 16 AM

@IngmarStein IngmarStein removed their assignment Apr 25, 2023
@karlvr
Copy link
Collaborator

karlvr commented Apr 27, 2023

@Firemanjoe That's a host unreachable error... are you sure about the IP address of your Roomba? Perhaps check it on the router's DHCP client list?

@Firemanjoe
Copy link

@karlvr - Hey! I have given it a static IP to ensure that it holds the same numbers and such!

But what happens with this one is the following:

Press the two buttons and it seems that it disconnects from the wifi - that’s what I have found which is why I had tried to reach out via the other method and grab the username/password from the cloud.

@karlvr
Copy link
Collaborator

karlvr commented Apr 27, 2023

@Firemanjoe oh very strange... does the robot flash its WiFi light as suggested in the get-roomba-password messages? Maybe you need to wait a few more moments before pressing "any key" to continue? That's the best I can think of at the moment. Maybe in another terminal window you could try a ping 192.168.13.198 to see when it is on the WiFi and when it drops off and (hopefully) when it reconnects.

@Firemanjoe
Copy link

Thanks! I tried it again and as soon as I press the two buttons to enable the Wifi connection, it disconnects. Here's a video from my desktop and if needed, I can share another 1min video of phone recording me pressing the buttons and then pressing the "any key".

https://youtu.be/Voww_dxw2yk

Hope that helps a little more @karlvr

@karlvr
Copy link
Collaborator

karlvr commented Apr 29, 2023

@Firemanjoe thank you. Interesting. How do you get your Roomba back on the WiFi?

@Firemanjoe
Copy link

@karlvr - I have to go through the wifi set up again… it’s not as easy as the 691 at all!

@karlvr
Copy link
Collaborator

karlvr commented Apr 30, 2023

@Firemanjoe OK, wow. That can't be the right thing to do then... maybe there's another combo or another button that you're going to need to press. It sounds like that combo is doing a full reset. Can you try other buttons?

@Firemanjoe
Copy link

@karlvr you were right. I pressed and held the home button for about 20 seconds and got the information that I was looking for. The downside is that it's the same BLID & password as what I had obtained the other way! hahah

So when I try, I still get the same error connection. I doubt that it would be worth anything, but I'm going to try to remove it from homebridge and install it again and see if maybe that would work!

@karlvr
Copy link
Collaborator

karlvr commented May 9, 2023

@Firemanjoe lol ok that's good to know. That button-holding approach sounds different to what's usual? Could you suggest additional / updated wording for the README? Either as a PR or I'm happy to make the changes.

Ok, let's return to the original issue. I presume we're still unable to talk to the i1? Please enable Debug Logging in the plugin settings, restart Homebridge and post all of the log messages from the plugin for the first 5 minutes!

@Firemanjoe
Copy link

Firemanjoe commented May 9, 2023

@karlvr

Sure I'd love to put something together for the PR - my first shot, so bear with me and I'll use it as a learning experience.

As for the code, let me enable for a bit and I'll come back with the output shortly.

Updated to include the logs - should be about 20mins worth. which is not a whole lot going on there, but hopefully you'll see maybe something.
homebridge.log.txt

@Firemanjoe
Copy link

So they have updated the iRobot app and I don't recall seeing this before. My other unit is communicating via 'server' and this one is communicating via MQTT Broker.

IMG_EC1AF4F0F985-1

Could that be why it's not connecting properly in HomeKit?

@bencharlesrhys
Copy link

I'm running a Roomba j7+ Combo and had issues with getting the password using the Setup instructions in v1.5.0-beta.4. There's only one button on the j7 models, pressing it reboots the machine or empties the bin so button press is not needed. Just make sure it's on the dock and run npm run getpassword <IP ADDRESS> command to fetch the blid and you'll get: Error getting password. Follow the instructions and try again.

koalazak/dorita980#142 solved my issue of getting the password from the cloud by running:

npm install -g dorita980

and then

get-roomba-password-cloud <roomba username> <roomba password> (make sure you update with your details)

This collects both the blid and the password for j7+ Combo and likely the j7+ and j7 models too.

Can we update the Setup in the README and/or instructions in the message after typing 'npm run getpassword ' to include j7 models?

I also updated /Volumes/homebridge/node_modules/homebridge-roomba2/node_modules/dorita980/lib/v2/local.js ciphers line 32 with ciphers: process.env.ROBOT_CIPHERS || customOptions.ciphers || 'TLS_AES_256_GCM_SHA384', as I read in some areas there are errors with AES

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants