v9.3.0-rc0 (debugging possible OTA system bug)

qa/firmware_reset_rewrite
Rick Carlino 2020-05-04 16:58:30 -05:00
parent b1c77657cd
commit 8d7fb9a010
11 changed files with 7 additions and 39 deletions

View File

@ -1 +1 @@
10.0.0-rc11
9.3.0-rc0

View File

@ -46,13 +46,8 @@ config :farmbot_core, FarmbotCore.EctoMigrator,
"beta"
)
config :farmbot_core, FarmbotCore.FirmwareOpenTask, attempt_threshold: 5
config :farmbot_firmware, FarmbotFirmware, reset: FarmbotCore.FirmwareResetter
config :farmbot_core, FarmbotCore.AssetWorker.FarmbotCore.Asset.FbosConfig,
firmware_flash_attempt_threshold: 5
import_config "ecto.exs"
import_config "logger.exs"
import_config "#{Mix.env()}.exs"

View File

@ -2,8 +2,3 @@ use Mix.Config
config :farmbot_celery_script, FarmbotCeleryScript.SysCalls,
sys_calls: FarmbotCeleryScript.SysCalls.Stubs
config :farmbot_core, FarmbotCore.FirmwareOpenTask, attempt_threshold: 5
config :farmbot_core, FarmbotCore.AssetWorker.FarmbotCore.Asset.FbosConfig,
firmware_flash_attempt_threshold: 5

View File

@ -11,16 +11,9 @@ defimpl FarmbotCore.AssetWorker, for: FarmbotCore.Asset.FbosConfig do
alias FarmbotCore.{Asset.FbosConfig, BotState, Config}
import FarmbotFirmware.PackageUtils, only: [package_to_string: 1]
@firmware_flash_attempt_threshold Application.get_env(:farmbot_core, __MODULE__)[:firmware_flash_attempt_threshold]
@firmware_flash_attempt_threshold Application.get_env(:farmbot_core, __MODULE__)[:firmware_flash_attempt_threshold] || 5
@firmware_flash_timeout Application.get_env(:farmbot_core, __MODULE__)[:firmware_flash_timeout] || 5000
@disable_firmware_io_logs_timeout Application.get_env(:farmbot_core, __MODULE__)[:disable_firmware_io_logs_timeout] || 300000
@firmware_flash_attempt_threshold || Mix.raise """
Firmware open attempt threshold not configured:
config :farmbot_core, #{__MODULE__}, [
firmware_flash_attempt_threshold: :infinity
]
"""
@impl FarmbotCore.AssetWorker
def preload(%FbosConfig{}), do: []

View File

@ -9,14 +9,7 @@ defmodule FarmbotCore.FirmwareOpenTask do
require FarmbotCore.Logger
alias FarmbotFirmware.{UARTTransport, StubTransport}
alias FarmbotCore.{Asset, Config}
@attempt_threshold Application.get_env(:farmbot_core, __MODULE__)[:attempt_threshold]
@attempt_threshold || Mix.raise """
Firmware open attempt threshold not configured:
config :farmbot_core, FarmbotCore.FirmwareOpenTask, [
attempt_threshold: 10
]
"""
@attempt_threshold Application.get_env(:farmbot_core, __MODULE__)[:attempt_threshold] || 5
@doc false
def start_link(args, opts \\ [name: __MODULE__]) do

View File

@ -6,7 +6,7 @@ defmodule FarmbotCore.FirmwareTTYDetector do
@error_retry_ms 5_000
if System.get_env("FARMBOT_TTY") do
@expected_names [System.get_env("FARMBOT_TTY")]
@expected_names ["ttyUSB0", "ttyAMA0", "ttyACM0", System.get_env("FARMBOT_TTY")]
else
@expected_names ["ttyUSB0", "ttyAMA0", "ttyACM0"]
end
@ -50,7 +50,7 @@ defmodule FarmbotCore.FirmwareTTYDetector do
if farmbot_tty?(name) do
{:noreply, name}
else
# Logger.warn("#{name} is not an expected Farmbot Firmware TTY")
Logger.warn("#{name} is not an expected Farmbot Firmware TTY")
{:noreply, state, {:continue, rest}}
end
end

View File

@ -13,7 +13,7 @@ defmodule FarmbotFirmware.UARTTransport do
def init(args) do
device = Keyword.fetch!(args, :device)
handle_gcode = Keyword.fetch!(args, :handle_gcode)
reset = Keyword.get(args, :reset)
reset = Keyword.fetch!(args, :reset)
{:ok, uart} = UartDefaultAdapter.start_link()
{:ok,

View File

@ -14,7 +14,7 @@ defmodule FarmbotFirmware.UARTTransportTest do
init_args = [
device: :FAKE_DEVICE,
handle_gcode: :FAKE_GCODE_HANDLER,
reset: :FAKE_RESETER
reset: StubReset
]
{:ok, state, 0} = UARTTransport.init(init_args)

View File

@ -38,8 +38,5 @@ config :farmbot,
config :farmbot_core, FarmbotCore.FirmwareOpenTask, attempt_threshold: 5
config :farmbot_core, FarmbotCore.AssetWorker.FarmbotCore.Asset.FbosConfig,
firmware_flash_attempt_threshold: 5
config :logger,
backends: [:console]

View File

@ -35,8 +35,6 @@ config :farmbot, FarmbotOS.Configurator,
data_layer: FarmbotOS.Configurator.ConfigDataLayer,
network_layer: FarmbotOS.Configurator.FakeNetworkLayer
config :farmbot_core, FarmbotCore.FirmwareTTYDetector, expected_names: []
config :farmbot_core, FarmbotCore.FirmwareOpenTask, attempt_threshold: 0
config :farmbot_core, FarmbotCore.AssetWorker.FarmbotCore.Asset.FbosConfig,

View File

@ -116,9 +116,6 @@ config :farmbot, FarmbotOS.System,
config :farmbot_core, FarmbotCore.FirmwareOpenTask, attempt_threshold: 5
config :farmbot_core, FarmbotCore.AssetWorker.FarmbotCore.Asset.FbosConfig,
firmware_flash_attempt_threshold: 5
config :logger, backends: [RingLogger]
config :logger, RingLogger,