pebble / pebble-tool Goto Github PK
View Code? Open in Web Editor NEWThe pebble tool that goes with libpebble2
License: MIT License
The pebble tool that goes with libpebble2
License: MIT License
Uninstalling a SDK version should also remove get_sdk_persist_dir()
for that version.
@jneubrand suggested adding an option to keep emulator data.
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).
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
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 :(.
I am looking for getting the following setup working:
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.)
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.
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:
enableMultiJS
. For example, Chris Lewis's Thin face will work:git clone https://github.com/C-D-Lewis/thin.git
pebble build
pebble install --emulator=basalt
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.
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.
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 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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.