-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Implement BLE, using bleak and bless #366
Comments
I'm working on this issue for a native python implementation for BLE; to remove the nodejs complexity AND to resolve issues (the structure is too complex). First version is in https://github.com/WouterJD/FortiusANT/tree/Implement-BLE-using-bless cleCollector.py is a client to any FitnessMachine (trainer, FortiusAnt) like TrainerRoad and/or Zwift with purpose to show data and make some simple simulations. Although at 98% I do not get it work and have raised an issue with the bleak developer Who can tell me what I'm doing wrong 🙂 |
I tried to understand what you are doing. I have not the background and the knowledge to help you. But why can't you you use a ready BLE Analyser like the one from Keuwlsoft. It reads all messages and had the possibility send something? If the question to stupid please erase this text. |
Im happy to try on my installation if you can harvest any info from it... Otherwise I think everything is way beyond my level |
@decodeais not a stupid remark at all. When I learn an interface, I tend to build something useful. In doing it, I understand the issues, also for other programmers. |
@WouterJD - I remember you saying that you wanted to simplify the BLE installation - that's great work to remove node.js. I've no expertise in this area but would be very happy to lend a hand with RPi testing (0W, 02W, 3B+) and the manual if you want any assistance. Keith |
@MeanHat thanks. First client version will be available this week. This client can be used to "see" (and Analyse) what is transmitted by FortiusAnt. |
Great work @WouterJD ! |
👍🏻🥂🤘🏻🔥 |
https://github.com/WouterJD/FortiusANT/blob/Implement-BLE-using-bless/pythoncode/bleClient.py
See also: hbldh/bleak#772 (comment) |
Good news, prototype for bleServer.py is working and pairing with Trainer Road and Rouvy. |
That's really great news @WouterJD - great work! That is a gamechanger! I'd be delighted to test with Zwift and Fortius when ready. On standby... |
I would like to test pre alpha state to. It would be interesting to get a chance for bug hunting. |
It's like a cliffhanger... To be continued in next episode😀 |
Can't wait!
…On Fri, 25 Feb 2022, 17:13 Wouter Dubbeldam, ***@***.***> wrote:
It's like a cliffhanger... To be continued in next episode😀
—
Reply to this email directly, view it on GitHub
<#366 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARS665FOXR6YLFPGFC27S7LU462CTANCNFSM5MIAN3TA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
All we need is.... your next episode!! |
Hi @WouterJD - I've been testing today as you requested (using Pi 0 2 W as it is a lot quicker and I can then revert to Pi 0 W). I have done / found the following:
The log file is attached for info: FortiusAnt.2022-03-04 16-25-06.log I've had to stop at this stage but happy to pick up again at a future date. Hope this is a small help. |
Hi guys, I'm still engineering the code. It's not trivial. |
See bless/issue/#60 In
|
Great work @WouterJD! I should have some time for more testing to support you next week and will run the addition you suggest. |
Current version is 99% final. |
Fantastic news, great work |
Hi Malkus, feel free to test! |
When FortiusAnt is advertising over BLE, depending on the interface and backends, the CTP (Trainer Road, Rouvy) will see the following devices:
With my knowledge and what I found, there is not much I can do about it. There is no practical difference, since your CTP sees one usable device and you select it. For I now, I surrender. |
Congrats. Does your app recognize it? |
Yes! Have taken a ride with Zwift and worked well! Possibly dropping cconnection adter some time. I will have to investigate that further whats going on |
Cheerio! Let me kno😀 |
Hi @WouterJD - I've been trying bless branch on RPi0 2W. Clean reinstall with Debian Bullseye 32bit.
|
I had problems getting Zwift to have a stable connection with the 64 bit. The raspberry disappeared from the available devices and got lost signal responce from zwift. Possibly resolved just now by installing the x11-utils package..? Now managed to pedal a couple of km with stable connection :) will continue later |
|
I have uploaded some error-handling improvements and access rights settings |
To avoid this, you can use Note that in the standard python logging system, the messges are hierarchical:
As opposed to the FortiusAnt flag-approach, where |
In answer to your points above #366 (comment):
Testing again... |
Please explain, copy output... |
Here's the |
Hi @WouterJD - I'm testing again, this time using Debian Buster rather than Bullseye on an RPi0 2 W and here is an update of the results:
I will do a fresh install of Buster and try Node.js to check "original" setup is still functioning and problem is not related to RPi0 2 W |
ps - I've been using RPi0 2 W rather than RPi0 as it is a lot faster to set up etc. |
RPi 0 2 W worked with Node.js (though needs fix in issue #57 Will now test RPi 0 with Bullseye and bless |
Special. |
Here's an update on the RPi testing:
I have focussed on RPi0 as RPi0 2 is fairly different (ARMv7-l vs ARMv6-l, Bluetooth 4.2 vs 4.1 etc). The closest I came was RPi0 running Buster and bless linking to Zwift as the CTP. Zwift recognised FortiusANT but could not achieve a stable connection in simulation mode. Hopefully the log file will help. During the install (running shell scripts 1, 2, 3_InstallBless_Temporarily.sh, 5, 9_GrantAccessToBluetoothForBless.sh and 9_GrantAccessToUSB_withReboot.sh the main errors were (a) in shell 3 I had to change line 4 from python to python3 and (b) there was a prompt to add /home/pi/.local/bin to PATH. Hope this helps a little. I'm keen to carry on the work to get RPi0 running Buster working with bless. (Next steps could then be to extend the solution further to use Bullseye and then RPi0 2?) RPi0_bullseye_bless.log |
Thank you - I used this in the testing reported above |
* #363 st7789b added; Waveshare 1.3 LCD with different pin layout * PR#365 define waveshare pins * PR #365 Waveshare reset pins * Collector first version; write to FitnessMachineControlPoint fails * bleClient.py working on Raspberry pi0W raspbian 10 (buster) * bleClient.py works on rpi0W with raspbian v10 buster * bleClient.py works on rpi0W with raspbian v10 buster * Server still under editing * bleBleak.py works on rpi0W with raspbian v10 buster * bleBleak.py works on rpi0W with raspbian v10 buster * FortiusAnt now works with bless library, ready for fieldtest * spaces removed * bless implementation works on Windows & Raspberry * General Access Profile, further tests * Made available to bless as example * Code cleanup * logfile improvements * Improved error handling and Changed access rights * -dall activates all debug options * -d log activates all logging but not json * -d all and -d log code improvement * manual for #366 and problem solved for #373 * #379 fonts-dejavu added in install * #366 install bless library from development branch * Version 6.4 candidate for merge * Small manual update * Release BLE/bless, version 6.5 * Last manual update for release of BLE/bless
Implemented and released |
Hi @MeanHat I have released the BLE/bless version today, and I come across this test-work in my Inbox-to-be-handled. I'm trying to get clean for the tacx-season :-) |
Hi @WouterJD - I am sorry for the slow reply. I've been working on some other projects and got distracted! I have not tested bleak & bless since my last trials (I submitted feedback and comments). If you'd like me to test anything again on RPi3, RPi0 or RPi0 2 please let me know. |
Hi @MeanHat
|
Ok @WouterJD - leave it with me for a few days and I'll do a full test. |
👍 |
Have been quite busy lately; just stepped in again and did some small stuff. Now trying to get TrainerRoad back up again. |
Issue is currently ready for integration in master
By using bless, native python -> BLE libraries are used and the node.js construction can be kept as an alternative.
ToDo
Advantage
Risks
Remark for windows users
Advertisement
On you smartphone you will see "A smart trainer" and select it...so you might not even notice. The name of the trainer should be "FortiusAnt Trainer".
No solution yet available from bless; note that such naming differences also exist using -b node.js
It's under investigation; see bless and bleak for currently open issues.
bless - the library for a new FortiusAnt BLE interface (BLE server)
bleak - the library to debug FortiusAnt (BLE client, simulating TrainerRoad or Zwift)
kevincar/bless#60 (No access on raspberry pi, bypass available)
kevincar/bless#74 (sample FTMS, under discussion)
kevincar/bless#76 (How to set Generic Access Profile, not blocking, previously issue#75)
not an issue anymore:
hbldh/bleak#688 (timeout issue, wait loop implemented)
hbldh/bleak#775 (Indications not received on Windows 10, no answer, does not occur now)
closed:
kevincar/bless#61
kevincar/bless#63
kevincar/bless#66
kevincar/bless#67 (should be solved)
kevincar/bless#72
kevincar/bless#73; answered
hbldh/bleak#739
hbldh/bleak#782; DeviceName and attributes
hbldh/bleak#772
The text was updated successfully, but these errors were encountered: