WouterJD / FortiusANT

FortiusANT enables a pre-smart Tacx trainer (usb- or ANT-connected) to communicate with TrainerRoad, Rouvy or Zwift through ANT or Bluetooth LE.
GNU General Public License v3.0
148 stars 78 forks source link

New OS for RPI4/5 causing Problems #457

Open decodeais opened 8 months ago

decodeais commented 8 months ago

I wanted to set up RasperiPy4 again, as I use it as a true multifunctional device (Print spooler, web server, etc.). However, with the latest version of the OS (Bookworm), some issues arose.

Nevertheless, I managed to generate a suitable one:

sudo apt-get install libgtk-3-dev
sudo apt-get install libpng-dev libjpeg-dev libtiff-dev
pip install -U --no-binary :all: wxPython

The generated file "wxPython-4.2.1-cp311-cp311-linux_aarch64.whl" works, The but the scales on the performance and speed indicators have disappeared.

These were the main issues. Initially, I would appreciate a suggestion on where to search for the missing scales. However, this is only a "Design" problem.

decodeais commented 7 months ago

If you succeed I would like to test yours. I think it would be a good idea to give the apt-get commands a yes parameter. Then it would run to the end in connection with install script n parameter. If it stopped with an error I allways tried to edit the script and restaerted it, fresh installs only to test. I have always problems to understand Git. Chatgpt tries to help me but everything is still confusing. If you think it works you could send me a "pull request", if I understood it right. The next days i will receive my new Raspi, then I will be able to make more tests.

zapiens commented 7 months ago

Many iterations when the aim is totally hands free, always a little thing left to do. I am almost there ..... ha ha

If you have any questions about git feel free to ask me.

Finally no hands and it is up and running on an RP4

decodeais commented 7 months ago

This sounds good! I was a little exhausted from building the wxPython wheel last week. I think we should place the script for the wheel somewhere in the "raspery" directory. It was always a problem in the past to get the right one.

I will get the new Raspi next days.we I orderd a Zero 2W too, so i can check this one too. We should check the instalation on linux too. I think the only thing we must change is th wxPython wheel, but i have allready one generated.

The old autostart, setup onnly works only on X11 on Wayland we can use my autostart_ON/OFF script. I hope we don't need nodejs installation. It does not work on bookworm. I have a alternative way in the bullseye installation script, but it was always a little mystique.

The little help scripts will make problems when somebody forgets to start the virtual environment first, we should think about how to handle.

Now the most important for me, how to get the last version from you to merge ( I am a github analphabet). When I look into your repository i only find an old version. The latest version I get only through the timeline. Did you forget somthing to publish, or can you make a pull request? I hope you know it.

zapiens commented 7 months ago

Good work in getting wxPython to build.

If you do this:

git remote add zapiens https://github.com/zapiens/FortiusANT.git
git fetch zapiens

You will have mine fork together with yours. Nothing of what you have done is affected.

git log zapiens/dag/issue_457

Shows my commits, now only one as I squashed them together Note the hash of my commit: 6ceca9810

You can insert that commit where you see fit by:

git cherry-pick 6ceca9810

I think pull requests are an overkill at this stage with work in progress.

decodeais commented 7 months ago

I have got your changes. I lost orientatio for a while between all the repositories, branches.. I hope you get no nonsense requests from my repostory. Is your connection problem solved(Waiting for response from Bluetooth device)?

zapiens commented 7 months ago

I hope you one day will see the beauty of Merkle trees and the git confusion will be gone ;)

I still have the connection problem. I have tried to pair with my Android phone, windows 11, Ubuntu 22.04 all with the same outcome. I don't know how to debug this or what is expected at this point.

In windows the 'FortiusAntTrainer' is shown as an Audio device and fails to pair. In Ubuntu the pairing comes up with the numbers that should match. Clicking confirm on both computers the Raspberry has the dialogue box 'Waiting for response from Bluetooth device' In ubuntu I get the error:

[  394.175497] Bluetooth: hci0: Opcode 0x 401 failed: -16

in dmesg

zapiens commented 7 months ago

I am totally lost on the bluetooth. I can connect now connect the raspberry to ubuntu 22.04/windows 11 and send files to/from ubuntu and only from windows 11.

In windows 11 the fortius appears as an audio device.

In neither ubuntu or windows the FortiusAntTrainer appears in training software. So far I have only tested with Zwift and GoldenCheetah.

In ubuntu the device looks like:

D8:3A:DD:36:A4:46
public
FortiusAntTrainer
FortiusAntTrainer
0x7c0000
0x0000
blueman
yes
yes
no
no
-50 dBm (0x-32)
yes
00001104-0000-1000-8000-00805f9b34fb IrMC Sync
00001105-0000-1000-8000-00805f9b34fb OBEX Object Push
00001106-0000-1000-8000-00805f9b34fb OBEX File Transfer
0000110a-0000-1000-8000-00805f9b34fb Audio Source
0000110b-0000-1000-8000-00805f9b34fb Audio Sink
0000110c-0000-1000-8000-00805f9b34fb Remote Control Target
0000110e-0000-1000-8000-00805f9b34fb Remote Control
0000111e-0000-1000-8000-00805f9b34fb Handsfree
0000111f-0000-1000-8000-00805f9b34fb Handsfree Audio Gateway
0000112f-0000-1000-8000-00805f9b34fb Phonebook Access (PBAP) - PSE
00001132-0000-1000-8000-00805f9b34fb Message Access Server
00001133-0000-1000-8000-00805f9b34fb Message Notification Server
00001200-0000-1000-8000-00805f9b34fb PnP Information
00001800-0000-1000-8000-00805f9b34fb Generic Access
00001801-0000-1000-8000-00805f9b34fb Generic Attribute
0000180a-0000-1000-8000-00805f9b34fb Device Information
0000180d-0000-1000-8000-00805f9b34fb Heart Rate
00001826-0000-1000-8000-00805f9b34fb Unknown
00005005-0000-1000-8000-0002ee000001 Proprietary
347b0001-7635-408b-8918-8ff3949ce592 Proprietary
usb:v1D6Bp0246d0542
/org/bluez/hci0
decodeais commented 7 months ago

I made a lot of updates in the installation. Now the installation script works with Linux too. I tested the software yesterday with Rouvy, it worked perfect. I remember My first Bluetooth stick I bought for my old raspi2/3, it had a similar behavior. It told always something like headset or audio. I bought a hew one. That worked out of the box. I think you should check with a bluetooth sniffer programm on the smartphone. Did you check a connection to a Tablet?

!!!!!!!!!!!!!!!! I have a idea. The reason will be that you started the program direct. you have to switch the bluetooth driver:

#-------------------------------------------------------------------------------
# If bluetooth required, stop service and enable for FortiusAnt
#-------------------------------------------------------------------------------
if [ $bluetooth == 1 ]; then
    echo Stop standard Bluetooth Service
    sudo service bluetooth stop
    echo Enable Bluetooth for FortiusAnt
    sudo hciconfig hci0 up
    if [ $? != 0 ] ; then
        Red='\033[0;31m'
        NC='\033[0m'
        printf "${Red} hciconfig failed, press enter to continue: ${NC}"; read x
    fi
fi

it part of FortiusAntMain.sh,

WouterJD commented 7 months ago

If you have any questions about git feel free to ask me.

Hi @zapiens good to hear. Yes I have a question for you: as a non-experienced git-user I have put the executables and documentation in the repository. After 4 years of development and uploading nex .exe and .pdf files, this pollutes the repository.

I would like to remove all old versions and then Either continue as I did, so many new versions are not expected OR proceed in a better manner where only the last .exe and .pdf are published.

Your recommendations are appreciated; if it's worthwhile we can start a new issue for that.

decodeais commented 7 months ago

I understand your problem. I think this Issue is really much to long now. Only the script to build the wxPython wheel and the links to the wheels should stay. Have you an Idea how to treat our Wayland fork? This changes had so many aspects, that it was a real problem. I have great respect for your work, so I wanted to help you to make it possible to install FortiusAnt on the actual OS. With the original installation script it is impossible now. Sorry, this was the reason the script "exploded".

zapiens commented 7 months ago

Hi @WouterJD again thanks for all your work on this.

A principle I have used when working with git is to never check in generates. Generates should go to a storage instead.

Yes a repo gets bloated with time as binaries get checked in. To remove generates in the repo the history needs to be rewritten and thus all hashes after the changed point will be rewritten. In a small project with few developers I would communicate that and tell everyone to create pull requests for serious work done. After that freeze the repo and rewrite history and this will be a "new" repository that everyone needs to clone from (or fetch --force).

If a larger project I would create a new rewritten repo and tell everyone to use that one instead, the old could be around for a while for archaeological reasons ;)

zapiens commented 7 months ago

Thanks @decodeais for the suggestions. I brought up the bluetooth connection on both machines with bluetoothctl to have total control over what was going on. The connection was very unstable. It connected and then disconnected. Sometimes it stayed connected for longer time and I could send files back and forth.

When you say you use a bluetooth stick do you mean you omit using the built in bluetooth in RP and computer? If this is the case why not buy ANT+ sticks instead?

decodeais commented 7 months ago

It was for an old Raspi without BT and a Tablet without built in Ant plus. Ant sticks are a better than BT but more expensive. My wife is happy rp2 and two ant+ sticks.