OpenSourceEBike / TSDZ2_wireless

TSDZ2_wireless
36 stars 11 forks source link

removed icon (lower right) from garmin display, added walk mode from wireless remote #83

Closed rananna closed 3 years ago

rananna commented 3 years ago

@casainho , I have removed the unwanted icon in the lower right from the garmin display. @4var1 , the walk mode signal from the wireless remote is a simple on/off flag, when MINUS is held down ui_vars.ui8_walk_assist = 1;, when released, ui_vars.ui8_walk_assist = 0. My expectation is that walk assist comes on when MINUS is pressed and held down, and stops when the button is released. All walk assist settings should be handled by the android app.

That is not how it is currently working, as I think you have integrated walk assist levels with button changing, and the walk assist is timing out after a few seconds. Could you please have a look at this?

4var1 commented 3 years ago

ok - looking

4var1 commented 3 years ago

ok.... now I can see how I might be affecting your walk assist state! :)

Right - I'll go back to doing what I suggested in about my third post yesterday. I'll set a flag to track whether walk assist was actually pressed locally - and only process it if so.

rananna commented 3 years ago

if I comment out the following void walk_assist_state(void) { // kevinh - note on the sw102 we show WALK in the box normally used for BRAKE display - the display code is handled there now if (ui_vars.ui8_walk_assist_feature_enabled) { // if down button is still pressed if (ui_vars.ui8_walk_assist && buttons_get_down_state()) { // ui8_walk_assist_timeout = 2; // 0.2 seconds } else if (buttons_get_down_state() == 0 && --ui8_walk_assist_timeout == 0) { // led_release_queue(); // ui_vars.ui8_walk_assist = 0; } } else { //ui_vars.ui8_walk_assist = 0; } } pressing plus on your remote increase walk speed.

rananna commented 3 years ago

I think the speed adjustment needs to be a part of the Android app, so we can set it globally for use with both remotes.

4var1 commented 3 years ago

there's nothing in that code that changes the walk assist level - oh i see - ok let me look

oh no that's expected - because walk assist level increases with assist level no? Don't see that as a problem - it's how it is supposed to work.

And it won't do it if you have the button depressed - so a moot point surely. The issue only occurs because you've commented out the code that handles that button press properly...

i.e. does it increase walk speed if you're holding down - then click up?

rananna commented 3 years ago

OK, but how do you bring the speed down if the minus button needs to be held to keep walk assist going?

4var1 commented 3 years ago

i don;t understand.. my speed doesn't change when I use walk assist...

walk assist level is based on assist level - plus increases assist level - so also increases walk assist level.

What am I missing? :)

rananna commented 3 years ago

It's probably me not getting it, as I never used walk mode on the older firmware. OK to play back how I now think it is intended to work:

  1. the user sets a desired assist level BEFORE starting walk mode.
  2. the user presses and holds the minus button to start walk mode.
  3. the user finds it going too fast/or slow
  4. the user cancels walk mode by releasing the minus button and sets a new assist level
  5. the use enters walk mode by holding minus and tries again.
  6. rinse and repeat

have I got it right?

4var1 commented 3 years ago

yes that;s my understanding too

What's not happening?

rananna commented 3 years ago

OK, user error on my part. it is probably working fine. once you add the flag for the external command, I will test again with that new understanding. sorry to be so dense about this....

4var1 commented 3 years ago

ah no problem :)

i thought i was going crazy about walk_assist_state - until i realised we weren't looking at the same code :)

rananna commented 3 years ago

I am mystified why there was the timeout happening though.....hopefully that was part of the same user error also... ;)

rananna commented 3 years ago

another mystery -why is github reporting you up to date when you are missing this PR?

4var1 commented 3 years ago

because I don't know how to use github - well - also I can't work out whether upstream-master or latest is the most recent. I think it changed recently...

4var1 commented 3 years ago

ok - be back in a hour - and will then make the change to only process walk assist locally if pressed on wired buttons

casainho commented 3 years ago

Since I remember, for walk assist on the configurations we set a PWM value for each assist level, then the motor firmware just set that fixed PWM. So the idea is just to turn on or off the walk assist from the display / TSDZ2 wireless.

4var1 commented 3 years ago

Ok - PR submitted - i can't test as I don't have a remote - but seems to still work for me...

(https://github.com/OpenSourceEBike/TSDZ2_wireless/pull/84)