RMCob / homebridge-wyze-robovac

This plug-in provides rudimentary control for a Wyze Robot Vacuum.
Apache License 2.0
8 stars 4 forks source link

Invalid Syntax error #2

Closed jiserra closed 2 years ago

jiserra commented 2 years ago

Describe The Bug: The plugin never starts because it says there's a syntax error. The weird thing is that if I execute the line that's failing, it gives me my vacuum name without a problem.

Logs:

error: Command failed: python3 /usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py [email] [password]
  File "/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py", line 10
    print(f"USAGE: {sys.argv[0]} wyze_email wyze_password")
                                                         ^
SyntaxError: invalid syntax

Environment:

ma-armenta commented 2 years ago

@jiserra Where are you seeing this log? Please provide as much details as possible to understand your set up and try to replicate this issue.

I do not get the SyntaxError you mentioned. But vacuum never shows up in accessories.

ma-armenta commented 2 years ago

The way that this plugin is using the wyze-sdk is by parsing the output of the python helper scrips for(let i = 0; i < stdout.length; i++) { const c = stdout.charAt(i); if( c === '\n') { nickNames.push( line ); currentRoomName.push( '' ); // Current room name for this vacuum line = ''; continue; } line = line.concat( stdout.charAt(i) ); }

That becomes a problem when you have a device that is currently not supported by the wyze-sdk, the wyze client will output information about an unknown device and corrupt the rest of the process done by this plugin.

jiserra commented 2 years ago

@ma-armenta I'm seeing this log on Homebridge log. The vacuum never shows up because the plugin is interrupted by the error I posted. Again, is weird that if I execute the command that's failing on the command line, it finds the vacuum name without problems.

ma-armenta commented 2 years ago

Whenever you run it manually, do you see anything else other than the name of your vacuum?

jiserra commented 2 years ago

@ma-armenta Nope, just the name of my vacuum alone, no other text or error.

ma-armenta commented 2 years ago

What version of python are you using? Did you install the wyze-sdk?

jiserra commented 2 years ago

@ma-armenta It's up there in the info on this ticket: 3.8.6

RMCob commented 2 years ago

Does your password have a blank (space) in it?

jiserra commented 2 years ago

Nope, no blank on password, the only weird character is an underscore

jiserra commented 2 years ago

Ok, I finally solved it:

  1. I upgraded my Raspbian version to Buster, I was in Jessie still.
  2. That didn't work, but at least the error was different, it said that it doesn't find wyze-sdk
  3. I install wyze-sdk and is installed, but I still receive the error
  4. I realize by chance that if I execute pip with sudo, the wyze-sdk module is not installed… something about paths?
  5. I can't install it with sudo pip install wyze-sdk because the sudo version of python is 3.7 (I didn't know that you can have a normal version of python and a sudo version of python!)
  6. I follow the instructions on this repo and I download wyze-sdk and modified the setup to support python 3.7
  7. It finally installs, reboot and is working!