360manu / kettlerUSB2BLE

Bridge from USB to Bluetooth low energy for old Kettler Trainers (Ergorace, ..) for Zwift and other apps
MIT License
38 stars 28 forks source link

[KettlerUSB] port is not open, retry in 10s #7

Closed laurent-web closed 2 years ago

laurent-web commented 4 years ago

Hello, I've this message when i start , after sudo node server.js it 's the code from file kettlerUSB.JS, generate by line 160

internalOpen() { this.port.open((err) => { if (!err) return; console.log('[KettlerUSB] port is not open, retry in 10s'); setTimeout(() => this.internalOpen(), 10000); }); };

i don't know how to correct this error, the access at browser pi-adress:3000 is ok when i start zwift, it recognize kettlerBLE, but when i run, nothing 0 watts on browser eton zwift. Is someone can help me? Thank you. Laurent

360manu commented 4 years ago

Hello

It seems that the soft is running. Very strange !

Some ideas :: Have you been able to connect to the bike using your PC ? With GoldenCheetah or KettlerWordTour ?

Are you using a Pi Zero ? The COM port may have a different name on other models.

you can also log the error: add this : console.log(err); console.log('[KettlerUSB] port is not open, retry in 10s');

laurent-web commented 4 years ago

20200617_105447 20200617_105425

Hello, thank you for your answer. it 's a rapsberry pi zero WH. i can connect to KettlerWordTour . it's running good. i join screenshot. i'll try the console.log. laurent

dmitriimi commented 4 years ago

Hello! I bought an RPi ZERO WH for this. I get the same problem.

pi@raspberrypi:~/kettlerUSB2BLE $ sudo node server.js
ENOENT: no such file or directory, open '/dev/i2c-1'
[BikeState starting]
[KettlerUSB] constructor
[KettlerUSB] open
[KettlerBLE starting]
Kettler app listening on port 3000!
[KettlerUSB] port is not open, retry in 10s
[KettlerBLE stateChange] new state: poweredOn
[KettlerBLE advertisingStart] success
[KettlerBLE servicesSet] success
[KettlerBLE setServices] success
[KettlerUSB] port is not open, retry in 10s
[KettlerUSB] port is not open, retry in 10s
[KettlerUSB] port is not open, retry in 10s
[KettlerUSB] port is not open, retry in 10s
360manu commented 4 years ago

Hello

I think the problem is coming for the oled screen driver. I added a screen to display the slope and gears. It's not optional at this stage and it was sendind an exception line 100 or 103. I removed it from the code.

Tell me if it's ok

Emmanuel

Le ven. 19 juin 2020 à 20:26, DmitriiMi notifications@github.com a écrit :

Hello! I bought an RPi ZERO WH for this. I get the same problem.

pi@raspberrypi:~/kettlerUSB2BLE $ sudo node server.js ENOENT: no such file or directory, open '/dev/i2c-1' [BikeState starting] [KettlerUSB] constructor [KettlerUSB] open [KettlerBLE starting] Kettler app listening on port 3000! [KettlerUSB] port is not open, retry in 10s [KettlerBLE stateChange] new state: poweredOn [KettlerBLE advertisingStart] success [KettlerBLE servicesSet] success [KettlerBLE setServices] success [KettlerUSB] port is not open, retry in 10s [KettlerUSB] port is not open, retry in 10s [KettlerUSB] port is not open, retry in 10s [KettlerUSB] port is not open, retry in 10s

I enabled I2C via raspi-config. And now another mistake: "EREMOTEIO: remote I/O error, write"

pi@raspberrypi:~/kettlerUSB2BLE $ sudo node server.js EREMOTEIO: remote I/O error, write [BikeState starting] [KettlerUSB] constructor [KettlerUSB] open [KettlerBLE starting] Kettler app listening on port 3000! [KettlerUSB] port is not open, retry in 10s [KettlerBLE stateChange] new state: poweredOn [KettlerBLE advertisingStart] success [KettlerBLE servicesSet] success [KettlerBLE setServices] success [KettlerUSB] port is not open, retry in 10s

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/360manu/kettlerUSB2BLE/issues/7#issuecomment-646806119, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADACXMO37JDTU3NPPSJMSDDRXOUV7ANCNFSM4N72QNMQ .

dmitriimi commented 4 years ago

Same "port is not open, retry in 10s"

pi@raspberrypi:~/kettlerUSB2BLE $ sudo node server.js
[BikeState starting]
[KettlerUSB] constructor
[KettlerUSB] open
[KettlerBLE starting]
Kettler app listening on port 3000!
[KettlerUSB] port is not open, retry in 10s
[KettlerBLE stateChange] new state: poweredOn
[KettlerBLE advertisingStart] success
[KettlerBLE servicesSet] success
[KettlerBLE setServices] success
[KettlerUSB] port is not open, retry in 10s
[KettlerUSB] port is not open, retry in 10s
laurent-web commented 4 years ago

[ 20200620_103136 20200620_110514 20200620_110605 20200620_111946 20200620_112058

Hello, i also try (I2C not enabled in the first try) i connect first with screen usb socket. laurent

](url)

laurent-web commented 4 years ago

[ 20200620_113032 20200620_113038 20200620_113152

i enabled I2C for the 2nd try and connect the usb cable at the back of the screen to the raspberry. laurent

laurent-web commented 4 years ago

Hello,

Before starting node, i try to configure with minicom the ttyUSB0 port. i only change bauds (9600). i don't change the other settings. I start node and i hear a sound from the bike (that i do not have before) but nothing more.

i have always the message remote I/O error , write. problem wih I2C and other settings of ttyUSB0? I keep searching.

Laurent

360manu commented 4 years ago

hello

I pushed a new version without i2c oled screen. It used to display a message to log some info about the serial port. But it was probably launching an exception while logging.

It doesn't mean that it works. But you can try.

Le mer. 24 juin 2020 à 19:57, laurent-web notifications@github.com a écrit :

Hello,

Before starting node, i try to configure with minicom the ttyUSB0 port. i only change bauds (9600). i don't change the other settings. I start node and i hear a sound from the bike (that i do not have before) but nothing more.

i have always the message remote I/O error , write. problem wih I2C and other settings of ttyUSB0? I keep searching.

Laurent

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/360manu/kettlerUSB2BLE/issues/7#issuecomment-648974568, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADACXMMQYUERGDVBQS5XCJTRYI5ABANCNFSM4N72QNMQ .

thesoulpole commented 4 years ago

Hello, I am trying to get your bridge to work with my Kettler ergometer FX1 (I am hoping that since you say it works with EX1, it will also work with my FX1). I bought an R Pi Zero WH. Great of you to have made this bridge, by the way ! :slight_smile: I have a question. I have gone through steps including the npm install, which I believe succeeded (lots of messages). BUT - how do I connect the Kettler AND the keyboard at the same time? It has only one USB port. Now, without bike connected and the keyboard connected, when I run “sudo node server.js” I get: “[KettlerUSB] port is not open, retry in 10s” looping until I Ctrl-break I assume that is because the bike is not connected? But if I connect the bike, how do I type in “sudo node server.js” since I will not have the keyboard connected (due to lack of a second USB)?

2 - second item is in a separate thread/issue

Thanks for any help and explanation!

360manu commented 4 years ago

Hello

I would suggest working headless on the raspberry pi zero. it means using a remote connection with another PC. start step 3 : https://desertbot.io/blog/headless-pi-zero-w-wifi-setup-windows

Or you can use a USB Hub, but I never tested this way.

Then using a remote connection, you will be able to connect the USB Cable directly to the Kettler. And KettlerUSB will try to open the serial port

Le mer. 7 oct. 2020 à 18:55, Piotr Sienkiewicz notifications@github.com a écrit :

Hello, I am trying to get your bridge to work with my Kettler ergometer FX1 (I am hoping that since you say it works with EX1, it will also work with my FX1). I bought an R Pi Zero WH. Great of you to have made this bridge, by the way ! :slight_smile: I have a question. I have gone through steps including the npm install, which I believe succeeded (lots of messages). BUT - how do I connect the Kettler AND the keyboard at the same time? It has only one USB port. Now, without bike connected and the keyboard connected, when I run “sudo node server.js” I get: “[KettlerUSB] port is not open, retry in 10s” looping until I Ctrl-break I assume that is because the bike is not connected? But if I connect the bike, how do I type in “sudo node server.js” since I will not have the keyboard connected (due to lack of a second USB)?

2 - second item is in a separate thread/issue

Thanks for any help and explanation!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/360manu/kettlerUSB2BLE/issues/7#issuecomment-705066011, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADACXMMGVYFEJM6WNMG4BADSJSMQTANCNFSM4N72QNMQ .

thesoulpole commented 4 years ago

Thanks a lot. In the meantime I managed to connect my Apple Bluetooth kbd (and mouse), over BT. So the USB is now free. When my SUB-RS232 cable arrives I will see if this works. If not, then headless (thanks for the link, it has a Mac version, luckily for me) is certainly a promising option.

Any chance on some help from you on my problem 2, which I wrote in the new Issue (Symlink not creating) I opened? Thanks in advance, much appreciated.

thesoulpole commented 4 years ago

Hello, Cable arrived, it seems to connect to the bike because bike screen displays a RS232 icon. However - it goes into a infinite loop - see attached photo any ideas on what to do? thanks in advance!

IMG_3215 IMG_3217

360manu commented 4 years ago

Good ! it works ! It' displays a log status that it receives from the bike the 25 on the line is your wattage

360manu commented 4 years ago

Now you should try connect it to Zwift or any FTMS BLE compatbile software (I saw a game on Google Play)

thesoulpole commented 4 years ago

Hey, you know what? It WORKS! ;)) I connected no problem!

Now I have to learn this Zwift (and see what actually works, and if there are any missing bits and if they are of interest)

Will let you know!