brandonarbini / treadmill

Control and report via Bluetooth for LifeSpan treadmills.
MIT License
14 stars 0 forks source link

Keep alive #1

Open lostmsu opened 6 years ago

lostmsu commented 6 years ago

Hi @brandonarbini @jgreer

I am trying to port this tool to C#. I've got treadmill to start and stop from command line. However, the treadmill drops Bluetooth connection after a very short period of inactivity (the blue light goes off). Do I need to send some kind of keep-alive command?

brandonarbini commented 6 years ago

Ugh. Yeah. I think that’s what you’ll need to do, but we never figured that part out. We would put a stat report on a loop and it would keep the connection for a while, but even then it would drop occasionally. If you figure it out, let us know. I don’t really use it anymore and mostly for that reason.

— Brandon Arbini On Sat, Aug 26, 2017 at 3:21 PM, lostmsu notifications@github.com wrote: Hi @brandonarbini [https://github.com/brandonarbini] @jgreer [https://github.com/jgreer]

I am trying to port this tool to C#. I've got treadmill to start and stop from command line. However, the treadmill drops Bluetooth connection after a very short period of inactivity. Do I need to send some kind of keep-alive command?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [https://github.com/brandonarbini/treadmill/issues/1] , or mute the thread [https://github.com/notifications/unsubscribe-auth/AAAAlxkl6xBiWS6_APlpLEVNDzvseqP7ks5scJpZgaJpZM4PDowD] .

lostmsu commented 6 years ago

@brandonarbini another qq: does init packet sequence have to go before every command?

lostmsu commented 6 years ago

@brandonarbini I've started infinite loop of query speed, and it did not disconnect in 5h. Unfortunately, it means my app will have to run in background. Have you tried to contact LifeSpan regarding that matter?

jgreer commented 6 years ago

Funny thing, for me it's been rock solid for years. I think it might disconnect after a while (hours) of being stopped, and certainly any time you hold stop to reset it. But otherwise it works great.

hisleiterj commented 6 years ago

Hi @lostmsu, sorry for being off-topic, but I am very interested in your C# port, have you considered to open-source it?

lostmsu commented 6 years ago

@hisleiterj , sorry for late response.

https://gist.github.com/lostmsu/1b0d4a33e5ca2418c2b52797eb720ec7

Feel free 😊

pcorliss commented 4 weeks ago

Regarding the keep-alive issue I noticed that I need to send a query or command every 5-6s to keep the bluetooth connection alive.

Thanks @lostmsu and @brandonarbini for your work on this in the past it really helped me get my own script working. https://github.com/pcorliss/treadmill