how to do simple data transfer using bluetooth serail terminal?
how to do simple data transfer using bluetooth serail terminal?
Hello,
You could use the BLE NUS peripheral and central examples to do such a transfer between your devices.
The examples will relay anything they receive over UART to their connected peer over BLE, and the peer will output the messages received over BLE out on its UART, and visa versa.
Test this according to the example documentation, and let me know if you encounter any issues or questions.
Best regards,
Karl
i go through the nsu code but which api was used to transfer the data?
venkatesha kj said:will online power profiler requires power profiler kit ?
No, the online power profiler only makes estimates of power consumption for the specified scenario. Please keep in mind that these estimates assume no other operations are happening on your DK concurrently with the radio activity.
venkatesha kj said:where actually transmission power set api called and how to change the transmission power?
You may set the TX power through the sd_ble_gap_tx_power_set function. This should be called as part of the advertising / scanning initialization, before advertising / scanning has begun. Connections will inherit the power level configured during initialization of advertising / scanning.
venkatesha kj said:how to measure power consumption in nrf52840 development kit using power profiler kit?
If you wish to measure the current consumption of the nRF52840 DK you should follow the Current Measurement section of its Product Specification.
I see that you have made a separate ticket for this. Please do not post duplicates of your questions, and please create new tickets for issues that diverge from your existing ticket - such as power consumption, in this case.
venkatesha kj said:this was the function to assign the buttons to appropriate bsp events but in that function why default event passed ? which means all the buttons assinged to default events then how come button1 assigned to bsp_event_wakeup?
This is only for the general bsp.c case, the application actually uses the bsp_btn_ble case which is what the button overview you are referencing is referring to. Please take a look at the bsp_btn_ble.c 's bsp_btn_ble_init function.
Best regards,
Karl
static void advertising_init(void)
{
uint32_t err_code;
ble_advertising_init_t init;
memset(&init, 0, sizeof(init));
init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
init.advdata.include_appearance = false;
// init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
init.srdata.uuids_complete.p_uuids = m_adv_uuids;
init.config.ble_adv_fast_enabled = true;
init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
//init.config.ble_adv_fast_timeout = APP_ADV_DURATION;
init.config.ble_adv_fast_timeout = 0;
init.evt_handler = on_adv_evt;
err_code = ble_advertising_init(&m_advertising, &init);
APP_ERROR_CHECK(err_code);
ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
}
in advertisement initialisation where actually tx power was set?
If you do not specify it explicitly it will use the default value of +0 dBm.
You may re-configure this at the end of the advertising_init function.
Best regards,
Karl
static void advertising_init(void)
{
int8_t tx_power_level = 4;
uint32_t err_code;
ble_advertising_init_t init;
memset(&init, 0, sizeof(init));
init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
init.advdata.include_appearance = false;
// init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
init.srdata.uuids_complete.p_uuids = m_adv_uuids;
init.config.ble_adv_fast_enabled = true;
init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
//init.config.ble_adv_fast_timeout = APP_ADV_DURATION;
init.config.ble_adv_fast_timeout = 0;
init.evt_handler = on_adv_evt;
err_code = ble_advertising_init(&m_advertising, &init);
APP_ERROR_CHECK(err_code);
ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, tx_power_level);
APP_ERROR_CHECK(err_code);
}
i have set the transmit power to 4dbm but in nrf connect app rssi level was -45dbm when i am near to the device will the tx power set to 4dbm or not? and am using s140 can i set Supported tx_power values: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +3dBm and +4dBm.
* In addition, on some chips following values are supported: +2dBm, +5dBm, +6dBm, +7dBm and +8dBm. any of the tx power level?
venkatesha kj said:i have set the transmit power to 4dbm but in nrf connect app rssi level was -45dbm when i am near to the device will the tx power set to 4dbm or not?
No, the +4 dBm is what the radio will be outputting - so the RSSI on the receiving device will always be lower than the power it was sent with. -45 dBm is a normal value for a close device.
venkatesha kj said:and am using s140 can i set Supported tx_power values: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +3dBm and +4dBm.
* In addition, on some chips following values are supported: +2dBm, +5dBm, +6dBm, +7dBm and +8dBm. any of the tx power level?
The possible TXPOWER levels depends on which SoC you are using, not which SoftDevice you are using. You could see which power levels are supported in the TXPOWER register of the device you are working with.
Best regards,
Karl
venkatesha kj said:i have set the transmit power to 4dbm but in nrf connect app rssi level was -45dbm when i am near to the device will the tx power set to 4dbm or not?
No, the +4 dBm is what the radio will be outputting - so the RSSI on the receiving device will always be lower than the power it was sent with. -45 dBm is a normal value for a close device.
venkatesha kj said:and am using s140 can i set Supported tx_power values: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +3dBm and +4dBm.
* In addition, on some chips following values are supported: +2dBm, +5dBm, +6dBm, +7dBm and +8dBm. any of the tx power level?
The possible TXPOWER levels depends on which SoC you are using, not which SoftDevice you are using. You could see which power levels are supported in the TXPOWER register of the device you are working with.
Best regards,
Karl
RSSI actually indicates the received strength right then if the transmited signal strength is 4dbm then why rssi shows -45dbm?
The RSSI is the received signal strength indicator. The signal will always be received weaker than what it was transferred as on the other side of the link.
Best regards,
Karl
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, tx_power_level);
if tx power set to 4dbm it increases the transmission range right?
Yes, compared to +0dBm it will increase the transmission range.
but it was not increased in my case?