Giter VIP home page Giter VIP logo

Comments (5)

DouweM avatar DouweM commented on July 20, 2024

Hmm, that's strange. Could you perhaps post the actual code that isn't giving you the desired results?

from pebblewatch.

phistep avatar phistep commented on July 20, 2024
require "pebblewatch"

watch = Pebble::Watch.new("4F92", "/dev/rfcomm0")
Pebble.logger.level = Logger::DEBUG

watch.protocol.on_receive do |message|
  puts message
end

watch.on_event(:media_control) do |event|
  case event.button
  when :playpause
    puts "Play or pause music"
  when :next
    puts "Next track"
  when :previous
    puts "Previous track"
  end
end

watch.connect

watch.listen_for_events

And your remote.rb example file does not work either. I mean it doesn't even output the string before running a shell command.

from pebblewatch.

DouweM avatar DouweM commented on July 20, 2024

With Pebble.logger.level = Logger::DEBUG, you should be seeing every message that is sent or received. Are you seeing anything happen at all?

from pebblewatch.

phistep avatar phistep commented on July 20, 2024

This is the output I get from above code. The LUETOOTH_START_DISCOVERABLE events are triggered when I enter the bluetooth settings on the Pebble. I also pressed media buttons, but nothing happened. Using the watch as a remote for my cell works.

% ruby protocol_events.rb
D, [2013-09-28T13:34:00.839338 #13235] DEBUG -- : Connected to port /dev/rfcomm0
D, [2013-09-28T13:34:00.839481 #13235] DEBUG -- : Waiting for messages
D, [2013-09-28T13:34:05.148776 #13235] DEBUG -- : Received SYSTEM_MESSAGE: "\x00\x06"
D, [2013-09-28T13:34:05.149305 #13235] DEBUG -- : Triggering event 'system_message': BLUETOOTH_START_DISCOVERABLE (6)
18
D, [2013-09-28T13:34:07.581236 #13235] DEBUG -- : Received SYSTEM_MESSAGE: "\x00\a"
D, [2013-09-28T13:34:07.581630 #13235] DEBUG -- : Triggering event 'system_message': BLUETOOTH_END_DISCOVERABLE (7)
18
^CD, [2013-09-28T13:34:18.079810 #13235] DEBUG -- : Finished waiting for messages

from pebblewatch.

DouweM avatar DouweM commented on July 20, 2024

Hmm, that's strange, there should be two PHONE_VERSION messages in there at the least: the Pebble should send one just after we connect, and we should reply to it immediately. See lib/pebble/watch.rb#L192.

It looks like the Pebble protocol has changed a bit since I built this lib. Unfortunately though, since my Pebble charging cable broke a little while ago, I can't fix and test it myself at this point. I would be very happy to accept a pull request addressing this, though.

from pebblewatch.

Related Issues (2)

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.