#No one has written a CyclingPowerService

1 messages · Page 1 of 1 (latest)

junior bane
#

once i create the library how can i make it into an mpy format

wind flicker
junior bane
#

i keep getting the error and wondering if anyone found a way to solve it

BluetoothError occurred: Unknown gatt error: 0x0102
empty verge
#

not sure why you would be getting that, unless there was a disconnect or a problem conneting

junior bane
#
  def power_meter_values(self) -> Optional[CPMeasurementValues]:
        if self._measurement_buf is None:
            self._measurement_buf = bytearray(self.cp_measurement.incoming_packet_length)
            print(self._measurement_buf.decode())


        packet_length = self.cp_measurement.readinto(self._measurement_buf)
        if packet_length == 0:
            return None

        instantaneous_power = struct.unpack_from("<H", self._measurement_buf, 0)[0]
        accumulated_power = struct.unpack_from("<H", self._measurement_buf, 2)[0]

        return CPMeasurementValues(instantaneous_power, accumulated_power)```


why this keeps returning the same numbers as instantaneous power and accumulated power any ideas why
empty verge
#

why don't you make a draft PR to the current library and we can look at the whole piece of code? Or point to your repo.

junior bane
#

i was looking into the zwack so i dont need to manually keep pedaling the bike but i kept getting error messages when installing npm

empty verge
#

npm is a whole art in itself

junior bane
#

I have the library all the way to be able to return the byte array of the 2A63 uuid from the power meter but i cannot figure out how to decode and everything seems to say either unrealistic things (such as when I pedal it with my hand it produces 50k watts) or just no documentation on this topic

empty verge
junior bane
junior bane
#

can the nrf chip connect to multiple sensors at the same time

junior bane
#

hello, I am working on submitting a library and i followed cookiecutter and now have this file

# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2024 Ezra Schwartz
#
# SPDX-License-Identifier: MIT
"""
`adafruit_circuitpython_cycling_power_service`
================================================================================

Cycling Power data is a library created by Ezra Schwartz to help people use cycing power meters in their circuitpython code. This library allows users to extract power data from a power meter and read the data. The librarys goal is to make it more acessable to create projects involving power meters by streamlining the process of extracting the data from a power meter's bluetooth packet.


* Author(s): Ezra Schwartz

Implementation Notes
--------------------

**Hardware:**

.. todo:: Add links to any specific hardware product page(s), or category page(s).
  Use unordered list & hyperlink rST inline format: "* `Link Text <url>`_"

**Software and Dependencies:**

* Adafruit CircuitPython firmware for the supported boards:
  https://circuitpython.org/downloads

.. todo:: Uncomment or remove the Bus Device and/or the Register library dependencies
  based on the library's use of either.

# * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
# * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
"""

# imports

__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/EzrSchwartz/CircuitPython_Adafruit_CircuitPython_Cycling_Power_Service.git"

do i just paste my code below this and how can i make a pull request to add this library to the bundle.