libpebble icon indicating copy to clipboard operation
libpebble copied to clipboard

PhoneSim error: traceEnabled not defined

Open mikeblum opened this issue 9 years ago • 1 comments

Here's the stacktrace:

[DEBUG   ] "POST /td.pebble.sdk_events HTTP/1.1" 200 0
[ERROR   ] global name 'traceEnabled' is not defined
Traceback (most recent call last):
  File "/Users/mblum/Developer/pebble-dev/PebbleSDK-3.1/bin/../tools/pebble.py", line 165, in <module>
    sys.exit(main())
  File "/Users/mblum/Developer/pebble-dev/PebbleSDK-3.1/bin/../tools/pebble.py", line 159, in main
    retval = PbSDKShell().main()
  File "/Users/mblum/Developer/pebble-dev/PebbleSDK-3.1/bin/../tools/pebble.py", line 96, in main
    return self.run_action(args.command, args)
  File "/Users/mblum/Developer/pebble-dev/PebbleSDK-3.1/bin/../tools/pebble.py", line 104, in run_action
    retval = command.run(args)
  File "/Users/mblum/Developer/pebble-dev/PebbleSDK-3.1/tools/pebble/LibPebblesCommand.py", line 174, in run
    LibPebbleCommand.run(self, args)
  File "/Users/mblum/Developer/pebble-dev/PebbleSDK-3.1/tools/pebble/LibPebblesCommand.py", line 110, in run
    self.pebble.set_time_utc(int(time.time()))
  File "/Users/mblum/Developer/pebble-dev/PebbleSDK-3.1/tools/pebblecomm/pebble.py", line 1031, in set_time_utc
    self._send_message("TIME", data)
  File "/Users/mblum/Developer/pebble-dev/PebbleSDK-3.1/tools/pebblecomm/pebble.py", line 836, in _send_message
    self._ser.write(msg)
  File "/Users/mblum/Developer/pebble-dev/PebbleSDK-3.1/tools/pebblecomm/WebSocketPebble.py", line 53, in write
    if traceEnabled:
NameError: global name 'traceEnabled' is not defined

My env: OS: Mac OS X Yosemite 10.10.4 Python 2.7.10 (default, Jul 13 2015, 12:05:58)

It looks like the issue is with the version of websocket-client in the requirements.txt in Pebble 3.1

websocket-client==0.22.0

I updated the requirements.txt to 0.32.0.

but it looks like lilpebble went out of sync with the python websockets-client library.

Any ideas?

mikeblum avatar Jul 18 '15 22:07 mikeblum

I patched it by adding in the traceEnabled global here:

vi +52 Pebble/common/phonesim/libpebble/pebblecomm/WebSocketPebble.py

and here:

vi +53 tools/pebblecomm/WebSocketPebble.py

and adding this at line ~27 to both files:

global traceEnabled traceEnabled = True

and that gets the emulator running again. Should I make a PR or should we get in sync with the websockets-client project? They use _traceEnabled apparently.

mikeblum avatar Jul 18 '15 22:07 mikeblum