Nekmo / amazon-dash

Hack your Amazon Dash to run what you want.
MIT License
816 stars 69 forks source link

configure finds device but crashes after connection #183

Open parkerlreed opened 1 year ago

parkerlreed commented 1 year ago

Put an x into all the boxes [ ] relevant to your issue (like this: [x])

What is the purpose of your issue?

Guideline for bug reports

You can delete this section if your report is not a bug

Description

Using a Dash Wand (with barcode scanner)

configure finds the WiFI network and connects but dies after confirming the connection.

Is it possible my unit has already been killed?

What I Did

(130)(deck@steamdeck ~)$ amazon-dash configure
Welcome to Amazon-dash v1.4.0 using Python 3.10.8
December 31 is the last day to block requests from your Amazon-dash buttons to Amazon servers. In 2020 your buttons can be bricked in an update from Amazon servers.
SSID (Wireless network name): Dasher
Network password: 
This command allows you to configure the Wi-Fi network of an amazon-dash device.
During the configuration you will have to block the Internet connection of the device.
Not blocking Internet connections after setting it could brick your device.
Hold the button on your Amazon dash device for 5 seconds until the light blinks blue.
Is the blue light flashing? [y/N]: y
STATE         CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN    
disconnected  none          enabled  enabled  enabled  enabled 
Error: No network with SSID 'Amazon ConfigureMe' found.
Error: No network with SSID 'Amazon ConfigureMe' found.
Device info:
Serial Number: G030K51173261637
Mac Address: B47C9CBA4CB6
Firmware: 0.8.189_WS
Battery: 110_en_US
Now you must block Internet connections from the device. 
Have you blocked Internet connections on the router? [y/N]: y
Configuring...
Traceback (most recent call last):
  File "/home/deck/.local/lib/python3.10/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/deck/.local/bin/amazon-dash", line 6, in <module>
    catch(cli)()
  File "/home/deck/.local/lib/python3.10/site-packages/amazon_dash/exceptions.py", line 103, in wrap
    return fn(*args, **kwargs)
  File "/home/deck/.local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/deck/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/deck/.local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/deck/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/deck/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/deck/.local/lib/python3.10/site-packages/amazon_dash/management.py", line 174, in configure
    configure.configure(ssid, password)
  File "/home/deck/.local/lib/python3.10/site-packages/amazon_dash/wifi.py", line 127, in configure
    networks = self.get_networks_availables()
  File "/home/deck/.local/lib/python3.10/site-packages/amazon_dash/wifi.py", line 123, in get_networks_availables
    data = r.json()
  File "/home/deck/.local/lib/python3.10/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
parkerlreed commented 1 year ago

Looking at the device more, it's the second generation Dash Wand

http://en.techinfodepot.shoutwiki.com/wiki/Amazon_Dash_Wand_2_Gen_(PL46MN)

parkerlreed commented 1 year ago

I tried the hack-device before this but since it doesn't have a blue light, I never get confirmation if it it even works (If it even applies to the Wand V2??)

Nekmo commented 1 year ago

Sorry but the Dash Wand is not tested :( I don't have this device for debugging.

parkerlreed commented 1 year ago

Figured as much! Thank you.

I may be able to work out sending this one to you for free if you want. I just picked it up today because it looked neat and in hindsight maybe wasn't worth $10...