GithubHelp home page GithubHelp logo

pebble / pebble-tool Goto Github PK

View Code? Open in Web Editor NEW
23.0 43.0 33.0 470 KB

The pebble tool that goes with libpebble2

License: MIT License

Python 92.89% Shell 0.14% JavaScript 4.46% CSS 1.54% C 0.98%

pebble-tool's People

Contributors

cjwilliams avatar corhere avatar davidstosik avatar gregoiresage avatar hexxeh avatar jneubrand avatar katharine avatar koterpillar avatar martijnthe avatar matthewtole avatar maxbaeumle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pebble-tool's Issues

subprocess.CalledProcessError raised in .../pebble_tool/commands/sdk/__init__.py

pebble new-project foo --simple

yields

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Current thread 0x00007f601126d700 (most recent call first):
'python' doesn't mean anything on this system.

Despite of a successful installation of the SDK on Linux (via https://developer.pebble.com/sdk/install/linux/ ).


Forcing my shell environment to use python2 (ln -s /usr/bin/python2 ~/foobin/python && ln -s /usr/bin/python2-config ~/foobin/python-config && export PATH=~/foobin:$PATH for instance) appears to fix the problem, as well as changing

 version = int(subprocess.check_output(["python", "-c", "import sys; print(sys.version_info[0])"]).strip())

to

 version = int(subprocess.check_output(["python2", "-c", "import sys; print(sys.version_info[0])"]).strip())

in https://github.com/pebble/pebble-tool/blob/master/pebble_tool/commands/sdk/__init__.py (line 36).

Unable to use pebble tool on Arch linux

Installed the latest SDK (4.4.1) using the instructions from the site. Created the virtualenv (for python 2.7). Also tried python 3.5.2; same result:

~> pebble new-project hello
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Current thread 0x00007f21d7baf400 (most recent call first):
'python' doesn't mean anything on this system.

Other commands like pebble build also give this error.

Just using pebble works:

~> pebble
usage: pebble [-h] [--version]
              {sdk,build,clean,install,logs,screenshot,insert-pin,delete-pin,emu-accel,emu-app-config,emu-battery,emu-bt-connection,emu-compass,emu-control,emu-tap,emu-time-format,emu-set-timeline-quick-view,ping,login,logout,repl,transcribe,data-logging,new-project,new-package,kill,wipe,package,analyze-size,convert-project,gdb}
              ...
pebble: error: too few arguments

When PEBBLE_PHONE env. var is set in .bash_profile, pebble install --emulator basalt still connects to PEBBLE_PHONE ip address

See https://forums.pebble.com/t/since-sdk4-0-i-cant-run-emulator-again-once-it-has-quit/23792/2

$ cat ~/.bash_profile

...
export PEBBLE_PHONE=192.168.0.12
...

$ pebble logs --emulator aplite

Connecting to ws://192.168.0.12:9000/ ... (instead of localhost:xxxxx)
(logging in libpebble2/communication/transports/websocket/init.py constructor)

This is a regression from 3.x where the same setup worked fine for me.
Two evenings of my life gone :(.

Support for pypkjs with physical watch?

I am looking for getting the following setup working:

  • physical watch
  • "phone" part running on a server instead of phone.

The closest thing that I could find is running pebble install --emulator <name>. This runs the phone part of the app on the server via pypkjs but (I think) this is hardcoded to be running with a simulated watch via QEMU.
What I would love to have is a setup that allows for a physical watch instead (eg using a serial port).

I think that this scenario would be very useful both for development and live scenarios since then no phone needs to be involved.

I have been scanning through the code a bit and it looks like it shouldn't take too much changes to support this. The main thing that seems to be different is that it needs to manage connections whereas the QEMU variant does not (although it would be useful in this variant too).

Would love to hear your feedback on this. (Also it's very well possible that this is already possible and that I simply haven't come across it yet.)

redirection via pipe doesn't work correctly for `pebble logs`.

pebble logs --cloudpebble | cat

yields:

[No response]

after ^C:

^Cclose failed in file object destructor:
sys.excepthook is missing
lost sys.stderr

=> Redirection via pipe is broken.


pebble logs --cloudpebble 1>&2

yields:

Waiting for phone to connect...
Connected.

=> Redirection (here stdout to stderr) seems to work in general. I also tested redirection to a file, this worked as expected.


pebble logs --cloudpebble

yields:

Waiting for phone to connect...
Connected.

=> Control case. Works as expected.


pebble help | cat

yields

usage: pebble [-h] [--version]

              {analyze-size,transcribe,logs,data-logging,emu-accel,emu-control,kill,emu-time-format,emu-bt-connection,insert-pin,ping,emu-app-config,build,emu-tap,clean,screenshot,delete-pin,convert-project,repl,logout,wipe,sdk,emu-compass,new-project,install,emu-battery,login}
              ...
pebble: error: invalid choice: 'help' (choose from 'analyze-size', 'transcribe', 'logs', 'data-logging', 'emu-accel', 'emu-control', 'kill', 'emu-time-format', 'emu-bt-connection', 'insert-pin', 'ping', 'emu-app-config', 'build', 'emu-tap', 'clean', 'screenshot', 'delete-pin', 'convert-project', 'repl', 'logout', 'wipe', 'sdk', 'emu-compass', 'new-project', 'install', 'emu-battery', 'login')

=> Works as expected.


The problem seems to only affect pebble logs. Let me know if I can help out somehow.

libpebble2.exceptions.TimeoutError when running emu-app-config for faces with enableMultiJS

It seems that some change in the Pebble tool broke the emu-app-config function for faces with enableMultiJS set to true. Faces and apps using the older style of Javascript do not appear to be affected.

Steps to reproduce:

  1. Clone a face from Github that uses enableMultiJS. For example, Chris Lewis's Thin face will work:
    git clone https://github.com/C-D-Lewis/thin.git
  2. Build and install the face:
    pebble build
    pebble install --emulator=basalt
  3. Try to configure the face:
    pebble emu-app-config

At least in my tests, it times out, giving the error:

Traceback (most recent call last):
  File "/usr/local/Cellar/pebble-sdk/4.3/libexec/bin/pebble", line 9, in <module>
    load_entry_point('pebble-tool==4.3', 'console_scripts', 'pebble')()
  File "/usr/local/Cellar/pebble-sdk/4.3/libexec/lib/python2.7/site-packages/pebble_tool/__init__.py", line 43, in run_tool
    args.func(args)
  File "/usr/local/Cellar/pebble-sdk/4.3/libexec/lib/python2.7/site-packages/pebble_tool/commands/base.py", line 47, in <lambda>
    parser.set_defaults(func=lambda x: cls()(x))
  File "/usr/local/Cellar/pebble-sdk/4.3/libexec/lib/python2.7/site-packages/pebble_tool/commands/emucontrol.py", line 109, in __call__
    response = self.pebble.read_transport_message(MessageTargetPhone, WebSocketPhonesimConfigResponse)
  File "/usr/local/Cellar/pebble-sdk/4.3/libexec/vendor/lib/python2.7/site-packages/libpebble2/communication/__init__.py", line 253, in read_transport_message
    return self.event_handler.wait_for_event((_EventType.Transport, origin, message_type), timeout=timeout)
  File "/usr/local/Cellar/pebble-sdk/4.3/libexec/vendor/lib/python2.7/site-packages/libpebble2/events/threaded.py", line 37, in wait_for_event
    return _BlockingEventWait(self, event).wait(timeout=timeout)
  File "/usr/local/Cellar/pebble-sdk/4.3/libexec/vendor/lib/python2.7/site-packages/libpebble2/events/threaded.py", line 61, in wait
    raise TimeoutError()
libpebble2.exceptions.TimeoutError

However, if a pre-multi-js commit is checked out, this error doesn't occur:
git checkout 35c1f53b487ee54690ce42dc222f47a9ff5cea56

Build, install, and emu-app-config. It will correctly load the Dropbox-hosted config page.

Firmware upgrade with the pebble-tool

Is it possible to upgrade the pebble firmware with the pebble-tool? It would imagine something like the following:

$ pebble firmware --serial /dev/rfcomm0

To update the pebble firmware without the need for an Android phone.

Unable to determine cause of "App install failed."

When app installation fails, only "App install failed" is logged. In my case, I was using the Pebble app instead of the Pebble Time app which caused the failure, however, there was no way for me to know why it failed.

if result.status != WebSocketInstallStatus.StatusCode.Success:

If there is more information on the result object or elsewhere that could be logged for debugging purposes that would be very helpful.

I also wonder if there is a way for the pebble tool to check for this scenario specifically and tell the user they are using the wrong app.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.