Can the MetaWear initiate BLE data transmission unprompted?

I'm trying to minimize power usage on the MetaWear device for an application that requires short bursts of sensor data triggered by a changing input on a gpio pin. I'd like to understand a little bit more about the MetaWear BLE protocol to make sure I'm not accidentally creating a ton of unnecessary traffic (and therefore power draw) with my setup.

My fundamental question is whether the MetaWear can initiate a BLE transaction or whether the phone has to prompt it every time. The reason I'm asking is because, in the ideal scenario, the device will locally monitor the pin and initiate sending of accel and gyro data on a transition - looking through the SDK I can see the tools to do this, or at least something close to it. However, if the underlying mechanism is the phone constantly polling the device to ask if it has any data or if the pin has changed, then it seems that all I'm really doing is creating a lot of BLE traffic and adding to the power drain. In that case I'd rather handle all of the state changes explicitly on the phone so that I can at least control the polling parameters myself.

If anyone can give me some insight into this, suggest a different approach, or just offer general tips on minimizing power usage, I'd really appreciate it. Thanks in advance for any help!

Comments

  • (I should add that it's important in this particular application to minimize latency between the pin transition and the sensors turning on)

  • MetaWear can't connect to a host device on its own. It can operate as you described where it internally starts/stops sensors in response to certain events.

  • edited May 31

    Right, so what happens if I configure the pin monitoring example (https://mbientlab.com/androiddocs/latest/gpio.html#pin-monitoring)? In this case the event that it's triggering is a signal to the phone. Does this code also configure the phone to be continually polling the device to detect whether that transition has happened? Again, I'm looking for the lowest-power solution here, so if it would be better to manually poll the device using a ForcedDataProducer then I'll do that instead.

  • It does exactly what the documentation you linked says it does:

    The pin’s digital state can be monitored by the firmware, sending the new state when it changes

    No where does it say the phone is continually polling the MetaWear board.

  • Based on the last 2 posts (by Eric) I am still a bit confused about the input monitoring example here:

    https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/5bbf7be238dd16a8a04a9fb9f9c3010e8268c23d/cppdocs/source/gpio.rst

    Will it act as an interrupt and print the state of the pin once the input at the chosen pin changes or will the board need to be polled again somehow to see if the input change occurred at some point since the start of monitoring?

    I'm running the above script in Python with no effect...

  • @ai7 said:
    Based on the last 2 posts (by Eric) I am still a bit confused about the input monitoring example here:

    https://github.com/mbientlab/MetaWear-SDK-Cpp/blob/5bbf7be238dd16a8a04a9fb9f9c3010e8268c23d/cppdocs/source/gpio.rst

    Will it act as an interrupt and print the state of the pin once the input at the chosen pin changes or will the board need to be polled again somehow to see if the input change occurred at some point since the start of monitoring?

    I'm running the above script in Python with no effect...

    Again, it functions exactly as the documentation says it does. The first sentence of the Input Monitoring section states:

    The firmware can also monitor the digital state of the input signal and alert the user if the state changes

    If it's not working, then it could be an issue with how your sensor is connected to the GPIO pins, the pin configurations, your script, your sensor, etc. Please provide more information in a separate thread.

Sign In or Register to comment.