Software update on the 4th of December - Accelerometer and various improvements

Software update on the 4th of December - Accelerometer and various improvements
We have pushed a new release that contains the following changes.

Frontend

  • Made obd logging more simple, fixed responsive issues with table
  • Fixed submit issue and duplicate settings issue in settings
  • Fixed issue with partial success of software updates
  • Changed device settings to use two tabs
  • Changed settings to not mark settings as synced in frontend, as this happens in the backend now
  • Fixed issue with trip position in map

Added advanced configuration for:

  • Cloud upload parameters.
  • Accelerometer settings and logger parameters.

AutoPi Core

Event changes:

  • QMI manager service now reports when 4G connection is online or offline: ‘system/network/wwan0/<online|offline>’
  • Added event that reports status of the OBD connection: ‘vehicle/obd/<interface_connected|bus_connected|not_connected>’
  • Added event that reports when EC3X module has been powered off (restarted): ‘system/device/ec2x/power_off’
  • Time event ‘time/’ has been renamed to 'system/time/’.

Command changes:

  • Refactored 'acc.’ commands - can now be called using 'acc.query '.
  • Added ‘acc.dump’ command to dump raw XYZ accelerometer readings to screen or file.
  • Modified ‘obd.protocol’ command output to include interface for each supported protocol.
  • Fix: Battery information sometimes missing when running ‘power.status’ command.

Other fixes and improvements:

  • Added accelerometer logger that reads XYZ data each second and uploads changes to the cloud.
  • All sleep timers are disabled during update of release. The Salt scheduler is disabled and re-enabled again when done.
  • Metrics specified for all network interfaces to enforce WiFi is always used if possible before 4G connection.
  • EC2X module will be restarted upon continuing errors from QMI manager. This will help to get the device online on modem failures.
  • Improved handling of OBD protocol errors and incorporated retry strategy in OBD readout worker threads. This will help fix occurrences where ‘engine/running’ event is never triggered.
  • STN baudrate is now always matched (equal or higher) with the baudrate of the current protocol. This will improve readout speed.

NB, auto updates are currently disabled, but will be enabled again soon.
Currently the update takes quite a while to finish, and it will restart the services running on the device. So please be patient when installing the updates, it should finish by itself, or retry on errors.
Let us know if you experience any issues.

As always, any comments etc are welcome!

I’m not sure if its related, but I’ve started seeing

peter26@Kona $ obd.query test mode=09 pid=0A force=True
>-
  ERROR: Unable to verify connectivity of protocol 'auto': Unable to connect

  because no supported protocol found

last logs included :

peter26@Kona $ minionutil.last_logs
>2-
      raise ELM327Error(msg)
  ELM327Error: Unable to verify connectivity of protocol 'auto': Unable to
  connect because no supported protocol found
  2018-12-04 18:49:49,334 [messaging        :202 ][ERROR   ][1032] Recurring
  exception (18 times) in worker thread 'readout_30sec' while running workf
low
  for message: {'returner': 'alternating_value', 'handler': 'query',
  'converter': 'dtc', 'kwargs': {'protocol': 'auto', 'force': True, 'name':
  'GET_DTC'}}
  Traceback (most recent call last):
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 168, in 
do_work
      self._call_hook_for(message, "workflow", message)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 354, in 
_call_hook_for
      return True, func(*args, **kwargs)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 280, in 
extended_workflow
      found, result = self._call_hook_for(message, "handler", *args, **kwar
gs)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 354, in 
_call_hook_for
      return True, func(*args, **kwargs)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 75, in s
ynchronizer
      return func(*args, **kwargs)
    File "/var/cache/salt/minion/extmods/engines/obd_manager.py", line 69, 
in query_handler
      conn.ensure_protocol(protocol, baudrate=baudrate)
    File "/var/cache/salt/minion/extmods/utils/obd_conn.py", line 26, in de
corator
      return func(self, *args, **kwargs)
    File "/var/cache/salt/minion/extmods/utils/obd_conn.py", line 184, in e
nsure_protocol
      self.change_protocol.undecorated(self, ident, **kwargs)  # No need to
 call the 'ensure_open' decorator again
    File "/var/cache/salt/minion/extmods/utils/obd_conn.py", line 158, in c
hange_protocol
      self._obd.change_protocol(None if ident == "AUTO" else ident, **kwarg
s)
    File "/usr/local/lib/python2.7/dist-packages/obd/obd.py", line 191, in 
change_protocol
      ret = self.interface.set_protocol(protocol, baudrate=baudrate)
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/stn11xx.py"
, line 248, in set_protocol
      ret = super(STN11XX, self).set_protocol(ident, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/elm327.py",
 line 442, in set_protocol
      self._protocol = self._auto_protocol()
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/elm327.py",
 line 686, in _auto_protocol
      res_0100 = self._verify_protocol("auto", force=not verify)
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/elm327.py",
 line 645, in _verify_protocol
      raise ELM327Error(msg)
  ELM327Error: Unable to verify connectivity of protocol 'auto': Unable to
  connect because no supported protocol found
  2018-12-04 18:50:25,915 [messaging        :540 ][ERROR   ][1032] Exception
  while processing event: {'tag':
  'obd/req/4ddb2946-d99a-43be-82cb-58b85302ba00', 'data': {'_stamp':
  '2018-12-04T18:50:17.400962', 'args': ['test'], '_event_tag':
  'obd/req/4ddb2946-d99a-43be-82cb-58b85302ba00', 'kwargs': {'pid': '0A',
  'force': True, 'bytes': None, 'mode': 9, 'decoder': None}}}
  Traceback (most recent call last):
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 537, in 
process_event
      res = self.process(message)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 115, in 
process
      result = func(message, **settings)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 126, in 
shared_worker
      found, result = self._call_hook_for(message, "workflow", message)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 354, in 
_call_hook_for
      return True, func(*args, **kwargs)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 280, in 
extended_workflow
      found, result = self._call_hook_for(message, "handler", *args, **kwar
gs)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 354, in 
_call_hook_for
      return True, func(*args, **kwargs)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 75, in s
ynchronizer
      return func(*args, **kwargs)
    File "/var/cache/salt/minion/extmods/engines/obd_manager.py", line 69, 
in query_handler
      conn.ensure_protocol(protocol, baudrate=baudrate)
    File "/var/cache/salt/minion/extmods/utils/obd_conn.py", line 26, in de
corator
      return func(self, *args, **kwargs)
    File "/var/cache/salt/minion/extmods/utils/obd_conn.py", line 184, in e
nsure_protocol
      self.change_protocol.undecorated(self, ident, **kwargs)  # No need to
 call the 'ensure_open' decorator again
    File "/var/cache/salt/minion/extmods/utils/obd_conn.py", line 158, in c
hange_protocol
      self._obd.change_protocol(None if ident == "AUTO" else ident, **kwarg
s)
    File "/usr/local/lib/python2.7/dist-packages/obd/obd.py", line 191, in 
change_protocol
      ret = self.interface.set_protocol(protocol, baudrate=baudrate)
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/stn11xx.py"
, line 248, in set_protocol
      ret = super(STN11XX, self).set_protocol(ident, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/elm327.py",
 line 442, in set_protocol
      self._protocol = self._auto_protocol()
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/elm327.py",
 line 686, in _auto_protocol
      res_0100 = self._verify_protocol("auto", force=not verify)
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/elm327.py",
 line 645, in _verify_protocol
      raise ELM327Error(msg)
  ELM327Error: Unable to verify connectivity of protocol 'auto': Unable to
  connect because no supported protocol found
  2018-12-04 18:50:26,278 [salt.minion      :1553][ERROR   ][1282] A command in
  'obd.query' had a problem: Unable to verify connectivity of protocol 'aut
o':
  Unable to connect because no supported protocol found
  2018-12-04 18:50:30,743 [messaging        :202 ][ERROR   ][1032] Recurring
  exception (67 times) in worker thread 'readout_1sec' while running workfl
ow
  for message: {'returner': 'alternating_value', 'handler': 'query', 'kwarg
s':
  {'protocol': 'auto', 'force': True, 'name': 'RPM'}}
  Traceback (most recent call last):
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 168, in 
do_work
      self._call_hook_for(message, "workflow", message)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 354, in 
_call_hook_for
      return True, func(*args, **kwargs)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 280, in 
extended_workflow
      found, result = self._call_hook_for(message, "handler", *args, **kwar
gs)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 354, in 
_call_hook_for
      return True, func(*args, **kwargs)
    File "/var/cache/salt/minion/extmods/utils/messaging.py", line 75, in s
ynchronizer
      return func(*args, **kwargs)
    File "/var/cache/salt/minion/extmods/engines/obd_manager.py", line 69, 
in query_handler
      conn.ensure_protocol(protocol, baudrate=baudrate)
    File "/var/cache/salt/minion/extmods/utils/obd_conn.py", line 26, in de
corator
      return func(self, *args, **kwargs)
    File "/var/cache/salt/minion/extmods/utils/obd_conn.py", line 184, in e
nsure_protocol
      self.change_protocol.undecorated(self, ident, **kwargs)  # No need to
 call the 'ensure_open' decorator again
    File "/var/cache/salt/minion/extmods/utils/obd_conn.py", line 158, in c
hange_protocol
      self._obd.change_protocol(None if ident == "AUTO" else ident, **kwarg
s)
    File "/usr/local/lib/python2.7/dist-packages/obd/obd.py", line 191, in 
change_protocol
      ret = self.interface.set_protocol(protocol, baudrate=baudrate)
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/stn11xx.py"
, line 248, in set_protocol
      ret = super(STN11XX, self).set_protocol(ident, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/elm327.py",
 line 442, in set_protocol
      self._protocol = self._auto_protocol()
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/elm327.py",
 line 686, in _auto_protocol
      res_0100 = self._verify_protocol("auto", force=not verify)
    File "/usr/local/lib/python2.7/dist-packages/obd/interfaces/elm327.py",
 line 645, in _verify_protocol
      raise ELM327Error(msg)
  ELM327Error: Unable to verify connectivity of protocol 'auto': Unable to
  connect because no supported protocol found

I’ll try re-starting a few more times.

A few re-boots and it did start to work okay.