Skip to content

Commit

Permalink
Show changelog to user instead of rebooting (commaai#210)
Browse files Browse the repository at this point in the history
* update releases

* revert auto update changes

* change to auto_update param

* revert

* add param to updated

* update version

* switch v

* shorter

* test

* test

* 15 seconds

* short

* change

* change

* fix

* change

* revert

* test

* looks good

* remove old parameter

* revert

* revert

* fix

* update releases

* update releases

* update releases

* better

* no .
  • Loading branch information
sshane authored Sep 10, 2020
1 parent f384428 commit 0a5d12f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Here are the main parameters you can change with this fork:
- `alca_nudge_required`: Whether to wait for applied torque to the wheel (nudge) before making lane changes
- `alca_min_speed`: The minimum speed allowed for an automatic lane change
- `upload_on_hotspot`: Controls whether your EON will upload driving data on your phone's hotspot
- [`no_ota_updates`](#Automatic-updates): Set this to True to disable all automatic updates. Reboot to take effect
- [`auto_update`](#Automatic-updates): Toggles whether your device will update and reboot automatically on this fork
- `disengage_on_gas`: Whether you want openpilot to disengage on gas input or not
- **Dynamic params**:
- `dynamic_gas`: Whether to use [dynamic gas](#dynamic-gas) if your car is supported
Expand Down Expand Up @@ -163,7 +163,7 @@ Parameters are stored at `/data/op_params.json`
---
### Automatic updates
When a new update is available on GitHub for Stock Additions, your EON/C2 will pull and reset your local branch to the remote. It then queues a reboot to occur when the following is true:
- your EON has been inactive or offroad for more than 5 minutes.
- your EON has been inactive or offroad for more than 5 minutes

Therefore, if your device sees an update while you're driving it will reboot approximately 5 to 10 minutes after you finish your drive, it resets the timer if you start driving again before the time is up.

Expand Down
16 changes: 10 additions & 6 deletions SA_RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Stock Additions 0.7.7
========================
Stock Additions v0.1.1 - 2020-9-10 (0.7.7)
===
* Disable automatic updates by default and show changelog to users in apk

Stock Additions v0.1 (0.7.7)
===
* LaneSpeed process is much more efficient, CPU usage down from 6% (causing lag alerts) to ~1%
* Use numpy_fast.interp instead of np.interp for slight boost in performance
* Support white panda with experimental parameter. localizer performance may be reduced
Expand All @@ -12,20 +16,20 @@ Stock Additions 0.7.7
* Add ZSS support

Stock Additions 0.7.5
========================
===
* Various opEdit improvements, colors, highlighting of last explored param, quicker messages
* New Dynamic Follow modification to help slow and accelerate sooner
* Live parameters update quicker
* dfManager reliability improvements
* New LaneSpeed and Dynamic Camera Offset features added

Stock Additions 0.7.4 (version 0.2)
========================
===
* Sidebar will not pop out when you tap the Dynamic Follow profile change button when driving
* Add derivative to longcontrol. Improves responsiveness and helps overshoot

Stock Additions 0.7.1
========================
===
* Recover faster when lead leaves path, or when braking or acceleration is required immediately. Also should speed up the acceleration with auto lane change.
* Add 3 different dynamic follow profiles: `roadtrip`, `relaxed`, and `traffic`. `relaxed` is the current dynamic follow profile. You can also swap profiles without rebooting live by using opEdit. SSH in and: `cd /data/openpilot;python op_edit.py` The parameter to change is `dynamic_follow`
* Fix for steering unavailable when wheel goes over 100 degrees/sec.
Expand All @@ -35,7 +39,7 @@ Stock Additions 0.7.1
* Automatic updates, EON will reboot by itself as long as it is inactive

Stock Additions 0.7
========================
===
* Dynamic lane speed is a new feature that reduces your cruising speed if many vehicles around you are significantly slower than you. This works with and without an openpilot-identified lead.
* Dynamic gas tuning. Above 20 mph we take lead velocity and the following distance into account. Possibility of different tuning for different cars in the future. (DYNAMIC GAS NOW ONLY WORKS ON TOYOTA COROLLA AND RAV4 PEDAL)
* Dynamic follow tuning, don't get as close when lead is accelerating.
Expand Down
4 changes: 2 additions & 2 deletions common/op_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self):
'enable_long_derivative': Param(False, bool, 'If you have longitudinal overshooting, enable this! This enables derivative-based\n'
'integral wind-down to help reduce overshooting within the long PID loop'),
'disengage_on_gas': Param(True, bool, 'Whether you want openpilot to disengage on gas input or not'),
'no_ota_updates': Param(False, bool, 'Set this to True to disable all automatic updates. Reboot to take effect'),
'auto_update': Param(False, bool, 'Toggles whether your device will update and reboot automatically on this fork'),
'dynamic_gas': Param(True, bool, 'Whether to use dynamic gas if your car is supported'),
'hide_auto_df_alerts': Param(False, bool, 'Hides the alert that shows what profile the model has chosen'),
'log_auto_df': Param(False, bool, 'Logs dynamic follow data for auto-df'),
Expand All @@ -98,7 +98,7 @@ def __init__(self):
self._backup_file = '/data/op_params_corrupt.json'
self._last_read_time = sec_since_boot()
self.read_frequency = 2.5 # max frequency to read with self.get(...) (sec)
self._to_delete = ['lane_hug_direction', 'lane_hug_angle_offset', 'prius_use_lqr'] # a list of params you want to delete (unused)
self._to_delete = ['lane_hug_direction', 'lane_hug_angle_offset', 'prius_use_lqr', 'no_ota_updates'] # a list of params you want to delete (unused)
self._run_init() # restores, reads, and updates params

def _run_init(self): # does first time initializing of default params
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/common/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define COMMA_VERSION "0.7.7-release"
#define COMMA_VERSION "0.7.7 - SA v0.1.1"
7 changes: 1 addition & 6 deletions selfdrive/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import textwrap
from typing import Dict, List
from selfdrive.swaglog import cloudlog, add_logentries_handler
from common.op_params import opParams


from common.basedir import BASEDIR, PARAMS
Expand All @@ -23,9 +22,6 @@
TOTAL_SCONS_NODES = 1020
prebuilt = os.path.exists(os.path.join(BASEDIR, 'prebuilt'))

op_params = opParams()
no_ota_updates = op_params.get('no_ota_updates') or os.path.exists('/data/no_ota_updates')

# Create folders needed for msgq
try:
os.mkdir("/dev/shm")
Expand Down Expand Up @@ -232,10 +228,9 @@ def get_running():
persistent_processes += [
'logcatd',
'tombstoned',
'updated',
'deleter',
]
if not no_ota_updates:
persistent_processes.append('updated')

car_started_processes = [
'controlsd',
Expand Down
8 changes: 7 additions & 1 deletion selfdrive/updated.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from common.params import Params
from selfdrive.swaglog import cloudlog
from common.realtime import sec_since_boot
from common.op_params import opParams

STAGING_ROOT = "/data/safe_staging"

Expand All @@ -56,6 +57,8 @@
ffi.cdef("int link(const char *oldpath, const char *newpath);")
libc = ffi.dlopen(None)

op_params = opParams()
auto_update = op_params.get('auto_update') and not os.path.exists('/data/no_ota_updates')

class WaitTimeHelper:
ready_event = threading.Event()
Expand Down Expand Up @@ -120,7 +123,7 @@ def set_update_available_params(new_version=False):

if new_version:
try:
with open(os.path.join(FINALIZED, "RELEASES.md"), "rb") as f:
with open(os.path.join(FINALIZED, "SA_RELEASES.md"), "rb") as f:
r = f.read()
r = r[:r.find(b'\n\n')] # Slice latest release notes
params.put("ReleaseNotes", r + b"\n")
Expand Down Expand Up @@ -318,6 +321,9 @@ def attempt_update(time_offroad, need_reboot):


def auto_update_reboot(time_offroad, need_reboot, new_version):
if not auto_update:
return False

min_reboot_time = 5. * 60
if new_version:
need_reboot = True
Expand Down

0 comments on commit 0a5d12f

Please sign in to comment.