-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth5.0+ PHY (LE 1M/2M/LongRange:500K/125K), CSA1/CSA2 (Channel Selection Algorithm) #221
Comments
These options relate only to BLE Сonnection. Advertising packages are still broadcast on 3 typical channels, regardless of BT version. In new versions BT, the advertising package may indicate an additional channel, but in this case it is not used. |
Is this a limitation with the hardware/runtime libraries, or would it be possible to make it advertise over, for example, S8 coded PHY? |
BLE LongRange (S2: 500K / S8: 125K) has been supported since version 3.6. |
So it is advertising over coded PHY? |
BLE standard: Only Extended Advertising come in other formats. In the current version, "Extended Advertising" is not supported. Strongly increases consumption and does not make sense, because. the main advertising channels should still work on PHY 1 Mbps. And to find out on which channel "Extended advertising" is possible only after receiving on a typical channel (PHY 1 Mbps). Coded PHY requires a special device to receive advertisements. Coded PHY is possible only after negotiation in connection mode on 1M PHY. |
Ah, I see, so what you're saying is that there's no standard for (optional) coded advertisements(?) Essentially making BLE long range per se practically useless since a peer always needs to be able to receive the standard mandatory 1M advertisements anyway, in order to negotiate a coded connection or learn about coded "extended" advertisements? I know that coded PHY is an optional feature not supported by most devices today. The target audience here is obviously those of us that do have a long range capable adapter and need the extended range. |
TLSR825x supports ZigBee and has a ZigBee SDK from Telink. |
Sorry, but I don't understand how ZigBee is related to this? |
ZigBee uses PHY 250 kbps -> greater transmission-reception distance. |
Will the LongRange setting allow me to use the thermometer over longer distances? |
No, because manufacturers ignore this feature in Bluetooth 5.0 on user devices. Read the two posts above for more details. |
It doesn't say anything.
First understand the standards... |
I'm very sorry. I read the comments but I just didn't understand them. The use of long-range Bluetooth has a lot of sense and applications. |
Thanks for the clarification. Is there any leaks or indications that bluetooth over longer distances will work better? |
After digging deeper into the subject, I do NOT agree that advertising on primary channels is limited to 1M PHY. https://novelbits.io/bluetooth-low-energy-advertisements-part-1/ I also agree that it would significantly impact power requirements. Because S=8 requires 8x the radio time for the same volume of data, because of the overhead of extended advertisement, and because it still needs to do legacy advertisement i parallel. Nevertheless, I'm tempted to try to cook up a proof-of-concept to explore this further, although I'm not sure I will be able to. |
If you managed to do something, please share it. Personally, I hope that bluetooth in the new versions will enable long range without extended advertising. |
Experimenting with the inclusion of LongRange for "Extended Advertising" on the main channels show that none of the available adapters in the application for 'HA' does not accept this option. Also checked dozens of smartphones in nRFConnect released that year - the situation is similar. Further, the 'coded PHY' advertising option cannot be used immediately for connection and scannable. And second:
Using the library reverse, I got the ability to embed "Extended Advertising" into the "custom firmware" option. But such a version cannot support all current options and requires a separate implementation. As a result, the only option available to users to increase the range of reception and transmission remains the option of using not BLE, but the ESB protocol. |
This has not happened since the release of the BT5.0 standard in December 2016, although the hardware of 90% of the BT controllers already allowed it. :P |
Is this due to some conflict of interest? |
I do not know for sure. I can only guess... |
Are there any open source drivers (I mean mostly Linux here) that have a patch made to make this work? |
On Linux, no patch is needed. You need to switch the adapter to encoded PHY and it will accept ads on LongRange. But others, standard BLE, will not be accepted. Nobody is engaged in patches of internal software of adapters. It's easier to make your own BLE advertising message receiver or use a full-fledged sniffer. |
If I run an encoded Bluetooth PHY in Linux and then connect to a thermometer with your software, will I get a greater range? Of course in your firmware I will choose LongRange BLE. I found such a way to run an encoded PHY. Do you think he is good? I can't find anything better on Google on this topic, but I'm probably looking in the wrong place. |
Nothing will work - the program will switch the BT adapter to standard mode. |
As a result, if LongRange is enabled, then it will be impossible to connect to this thermometer. |
Could you please clarify - what "program" are you talking about here?
Yes, that's what I was trying to say. I agree that the device always needs to do 1M PHY advertising so that it's always visible and connectable for anyone. Switching advertising on primary channels to Coded PHY only would essentially brick it for most users. Since Telink seems to only support 1 advertising set, would it be possible to, for example, make it do legacy 1M PHY advertising just like today and then periodically switch to extended advertising with Coded PHY on primary channels? I.e. using blc_ll_setExtAdvParam() to set up extended advertising using coded PHY on both primary and secondary channels and then calling blc_ll_setExtAdvEnable_n() to switch extended advertising on/off periodically. |
No. Connecting the ext_adv module does not provide for rollback. In addition, switching ad types in ext_adv causes glitches. There are also glitches when using ext_adv type and a single ext_adv configuration. Sometimes does not include ads after disconnect, etc. ext_adv = demo version :( PS: As a result, everything is done in such a way as to exclude the operability of LongRange in BLE. |
About all implementations. Exception - DIY. |
And there is a second problem with ext_adv: Everything described can be bypassed or solved, but it takes time to reverse and debug. This, in the complete absence of information support, results in months ... And one more problem. Xiaomi LYWSD03MMC has no buttons. As of today, I already have a working implementation with ext_adv for thermometers, including LongRange. But not for LYWSD03MMC. Also - the BLE implementation of HomeAssistant does not provide for temporary advertising or advertising only for changing data from sensors. After a built-in period, if there are no responses from the sensor, then the readings are transferred to the "Unavailable" state. This makes it impossible to save battery on the sensors or increase the period of transmission of BLE messages. PS: As a result, everything is done in such a way as to exclude the operability of LongRange in BLE. |
Тестовая прошивка с поддержкой ‘Extended Advertising’ и ‘LongRange’ для LYWSD03MMC. ‘EXT.ADV’ без ‘LongRange’ включает передачу рекламы в формате LEGACY_CONNECTABLE_SCANNABLE_UNDIRECTED. ‘LongRange’ - включает передачу основной и дополнительной рекламы в формате ‘Coded PHY’ c S8 и варианте EXTENDED_CONNECTABLE_UNDIRECTED. Далее следует убедиться, что приемная сторона поддерживает ‘Extended Advertising’ в режиме ‘LongRange’ и если нет – вытащить и вставить батарейку. |
Thank you very much for sharing the file. |
Исходники так-же обновлены с данными опциями. |
Any chance you could share your test code and procedure for flashing the Zigbee firmware onto a e.g. a CGG1? I'm interested in developing this further. |
|
I read the comment and I get that you don’t want to support Zigbee but being new to the platform it’d be great place to start. Thank you for your hard work on the firmware! |
E.g. The two-stage OTA you mention: do you mean we need to first flash a minimal zigbee firmware with only OTA support (<128k over BLE OTA) and then flash >128k main zigbee firmware over zigbee OTA? |
С начала необходимо прошить малую прошивку BLE которая обрабатывает и очищает области Flash под OTA для кода Zigbee. Zigbee код самой минимальной версии имеет более 128 килобайт и не может быть загружен стандартной BLE OTA от Telink. У Telink на сайте есть версия SDK tl_zigbee_ble_concurrent_sdk_8258. В ней поочередно работают оба варианта. Так же требует специальной OTA. Из за большого объема прошивки Zigbee нет возможности сохранять историю измерений. И у большинства пользователей нет возможностей работы с Zigbee не имея специальных инструментов. Двойная загрузка вызовет массу ошибок у пользователей. |
Thanks! So a BLE firmware that sets up flash according to dual mode and with a dual mode OTA procedure, then flash a <192k zigbee firmware? |
http://wiki.telink-semi.cn/wiki/chip-series/TLSR825x-Series/ |
… thanks again for your firmware … |
Thank you @pvvx for the useful post. Спасибо @pvvx за полезный пост. |
Да, с 2016 года так и продолжается "круговая порука" с BLE Long Range. Все ссылаются друг на друга. Причина в том, что большинство не знает, что в варианте Long Range сильно увеличивается расстояние приёма-передачи для BLE. А думают по старинке, основываясь на опыте работы с устройствами BT4.2. Последний ответ от 'Bleak' означает, что Home Assistant не будет поддерживать Bluetooth Specification 5.0 и далее. |
В версии 4.2 будет включен полный "LE Long Range" для всех поддерживаемых термометров. |
Can you explain a bit more about this?
Is this implemented on the sensors from version 3.7? Even if the sensors are Bluetooth 4.2?
Are they now broadcasting on multiple channels so a BT chip capable of CSA can pick up more readings?
Thanks in advance, just trying to understand it.
The text was updated successfully, but these errors were encountered: