mbl_mw_setting_set_tx_power(d.board,4)
I tried to connect MMS to Raspberry pi(python code) but I noticed that the connect signal is bad because the default value of tx_power is 0.
Therefore, I did mbl_mw_setting_set_tx_power(d.board,4)) referring to the API document, but in my python code , it reboots after disconnecting at the end.
In other words, when connecting with MMS for the first time, I want to be able to connect even from afar.
Is there any way to keep the set value of tx_power(4db)? Not default(0)
And is there any way yo set tx_power to 8db?
Comments
@hjpark How is your python script disconnecting from the device? The device should not be resetting on disconnect unless commanded to.
A parameter value of 8 for 8dB is supported on MMS model.
In order for a setting to persist through a power cycle the macro system can be used to set that parameter at power-on.
@Matt
First of all, thanks for the reply.
How is your python script disconnecting from the device? The device should not be resetting on disconnect unless commanded to. --> My script commands libmetawear.mbl_mw_debug_disconnect(s.device.board) and proceeds to reset libmetawear.mbl_mw_debug_reset(s.device.board), Is the setting value maintained even after resetting like this??
In order for a setting to persist through a power cycle the macro system can be used to set that parameter at power-on. --> Can you provide a python example of the macro system??
In addition, is there a function to save the data as a csv file??
@hjpark
libmetawear.mbl_mw_debug_reset(s.device.board)
clears all settings and resets all sensors on the device. So this will be reverting your tx_power command. Unless you really want to wipe your sensor settings or similar, you should not need to issue a device reset at every disconnect.You can have a look at
macro_setup.py
in the MetaWear-SDK-Python examples directory. For what I understand of your use case, I would recommend removing the sensor reset from your disconnect actions instead.Other than tx power, there are not many ways to control BLE distance. Avoid placing the sensor on solid metal surfaces. Reception is typically limited to within the same room for reliable data throughput.