Merge pull request #280 from ConnorRigby/master
Serial Handler simplification + General Cleanuppull/285/head
commit
2308e7123e
|
@ -1,5 +1,4 @@
|
|||
use Mix.Config
|
||||
config :farmbot,
|
||||
configurator_port: System.get_env("CONFIGURATOR_PORT") || 5000,
|
||||
streamer_port: System.get_env("STREAMER_PORT") || 5050,
|
||||
tty: System.get_env("ARDUINO_TTY")
|
||||
|
|
|
@ -2,8 +2,7 @@ use Mix.Config
|
|||
config :farmbot,
|
||||
path: "/state",
|
||||
config_file_name: "default_config_rpi.json",
|
||||
configurator_port: 80,
|
||||
streamer_port: 4040
|
||||
configurator_port: 80
|
||||
|
||||
config :farmbot, :redis,
|
||||
server: true,
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
use Mix.Config
|
||||
config :farmbot,
|
||||
path: "/state",
|
||||
config_file_name: "default_config_rpi3.json",
|
||||
configurator_port: 80
|
||||
|
||||
config :farmbot, :redis,
|
||||
server: true,
|
||||
port: 6379
|
|
@ -0,0 +1 @@
|
|||
plant-detection
|
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
|
@ -0,0 +1 @@
|
|||
plant-detection
|
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
|
@ -2,8 +2,7 @@ use Mix.Config
|
|||
config :farmbot,
|
||||
path: "/state",
|
||||
config_file_name: "default_config_rpi2.json",
|
||||
configurator_port: 80,
|
||||
streamer_port: 4040
|
||||
configurator_port: 80
|
||||
|
||||
config :farmbot, :redis,
|
||||
server: true,
|
||||
|
|
|
@ -2,8 +2,7 @@ use Mix.Config
|
|||
config :farmbot,
|
||||
path: "/state",
|
||||
config_file_name: "default_config_rpi3.json",
|
||||
configurator_port: 80,
|
||||
streamer_port: 4040
|
||||
configurator_port: 80
|
||||
|
||||
config :farmbot, :redis,
|
||||
server: true,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use Mix.Config
|
||||
config :farmbot,
|
||||
configurator_port: 80,
|
||||
streamer_port: 4040
|
||||
configurator_port: 80
|
||||
|
||||
config :tzdata, :data_dir, "/tmp"
|
||||
config :tzdata, :autoupdate, :disabled
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
defmodule Farmbot.Camera do
|
||||
@moduledoc """
|
||||
Test module for taking photos with the rpi camera.
|
||||
"""
|
||||
|
||||
# @params ["-o", "/tmp/image.jpg", "-e", "jpg", "-t", "1", "-w","1024", "-h", "1024"]
|
||||
# @command "raspistill"
|
||||
|
||||
def params(path, extra_opts) do
|
||||
~w"#{path}
|
||||
-d /dev/video0 -r 1280x720
|
||||
--no-banner --gmt
|
||||
--set sharpness=15
|
||||
--set gamma=10 --set contrast=75
|
||||
" ++ extra_opts
|
||||
end
|
||||
@command "fswebcam"
|
||||
# "fswebcam --save /tmp/image/image.jpg -d /dev/video0 -r 1280x720 --no-banner --gmt --skip 25 --set sharpness=15 --set gamma=10 --set contrast=75"
|
||||
require Logger
|
||||
|
||||
def capture(path \\ nil, options \\ [])
|
||||
def capture(path, options) do
|
||||
command = System.find_executable(@command)
|
||||
path = path || out_path()
|
||||
port = Port.open({:spawn_executable, command},
|
||||
[:stream,
|
||||
:binary,
|
||||
:exit_status,
|
||||
:hide,
|
||||
:use_stdio,
|
||||
:stderr_to_stdout, args: params(path, options)])
|
||||
handle_port(port)
|
||||
File.read!(path)
|
||||
end
|
||||
|
||||
defp handle_port(port) do
|
||||
receive do
|
||||
{^port, {:data, stuff}} ->
|
||||
IO.puts stuff
|
||||
handle_port(port)
|
||||
{^port, {:exit_status, _}} -> :ok
|
||||
_ -> handle_port(port)
|
||||
after 10_000 -> Logger.error "[CAMERA] UHHHHHH"
|
||||
end
|
||||
end
|
||||
|
||||
defp out_path, do: "/tmp/images/#{Timex.now |> DateTime.to_unix(:milliseconds)}.jpg"
|
||||
|
||||
end
|
|
@ -28,7 +28,6 @@ defmodule Farmbot.CeleryScript.Command.ConfigUpdate do
|
|||
if param_int do
|
||||
Logger.info ">> is updating #{param_str}: #{val}"
|
||||
"F22 P#{param_int} V#{val}" |> UartHan.write
|
||||
Process.sleep(500)
|
||||
# HACK read the param back because sometimes the firmware decides
|
||||
# our param sets arent important enough to keep
|
||||
read_param(%{label: param_str}, [])
|
||||
|
@ -48,9 +47,11 @@ defmodule Farmbot.CeleryScript.Command.ConfigUpdate do
|
|||
|
||||
@spec filter_params([{binary, any}], map) :: [{binary, any}]
|
||||
defp filter_params(blah, current) do
|
||||
Enum.filter(blah, fn({param_str, val}) ->
|
||||
result = Enum.filter(blah, fn({param_str, val}) ->
|
||||
current[param_str] != val
|
||||
end)
|
||||
# Im sorry about this
|
||||
if Enum.empty?(result), do: blah, else: result
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@ defmodule Farmbot.CeleryScript.Command.TakePhoto do
|
|||
if info do
|
||||
Command.start_process(%{label: info.uuid}, [])
|
||||
else
|
||||
Farmbot.Camera.capture()
|
||||
Logger.warn "take-photo is not installed!"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,14 +11,12 @@ defmodule Farmbot.Configurator do
|
|||
require Logger
|
||||
|
||||
@port Application.get_env(:farmbot, :configurator_port, 4000)
|
||||
@streamer_port Application.get_env(:farmbot, :streamer_port, 4040)
|
||||
|
||||
def init([]) do
|
||||
Logger.info ">> Configurator init!"
|
||||
children = [
|
||||
Plug.Adapters.Cowboy.child_spec(:http, Router, [], port: @port,
|
||||
dispatch: [dispatch()]),
|
||||
Plug.Adapters.Cowboy.child_spec(:http, Streamer, [], port: @streamer_port)
|
||||
]
|
||||
opts = [strategy: :one_for_one]
|
||||
supervise(children, opts)
|
||||
|
|
|
@ -151,35 +151,6 @@ defmodule Farmbot.Configurator.Router do
|
|||
end
|
||||
end
|
||||
|
||||
get "/image/latest" do
|
||||
list_images = fn() ->
|
||||
"/tmp/images"
|
||||
|> File.ls!
|
||||
|> Enum.reduce("", fn(image, acc) ->
|
||||
acc <> "<img src=\"/image/#{image}\">"
|
||||
end)
|
||||
end
|
||||
html =
|
||||
~s"""
|
||||
<html>
|
||||
<body>
|
||||
<form action=/image/capture>
|
||||
<input type="submit" value="Capture">
|
||||
</form>
|
||||
#{list_images.()}
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
conn |> send_resp(200, html)
|
||||
end
|
||||
|
||||
get "/image/capture" do
|
||||
Farmbot.Camera.capture()
|
||||
conn
|
||||
|> put_resp_header("location", "/image/latest")
|
||||
|> send_resp(302, "OK")
|
||||
end
|
||||
|
||||
# anything that doesn't match a rest end point gets the index.
|
||||
match _, do: conn |> send_resp(404, "not found")
|
||||
|
||||
|
@ -194,7 +165,7 @@ defmodule Farmbot.Configurator.Router do
|
|||
:done ->
|
||||
blerp |> send_resp(200, "OK")
|
||||
{:error, reason} ->
|
||||
blerp |> send_resp(400, IO.inspect(reason))
|
||||
blerp |> send_resp(400, inspect(reason))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
defmodule Plug.Streamer do
|
||||
@moduledoc """
|
||||
Plug for streaming an image
|
||||
"""
|
||||
alias Plug.Conn
|
||||
import Conn
|
||||
@behaviour Plug
|
||||
@boundry "w58EW1cEpjzydSCq"
|
||||
|
||||
def init(opts), do: opts
|
||||
|
||||
def call(conn, _opts) do
|
||||
conn |>
|
||||
put_resp_header("content-type", "multipart/x-mixed-replace; boundary=#{@boundry}")
|
||||
|> send_chunked(200)
|
||||
|> send_picture
|
||||
end
|
||||
|
||||
defp send_picture(conn) do
|
||||
file = Farmbot.Camera.capture("/tmp/stream.jpg", ["-q"])
|
||||
Process.sleep(5)
|
||||
size = byte_size(file)
|
||||
header = "------#{@boundry}\r\nContent-Type: \"image/jpeg\"\r\nContent-length: #{size}\r\n\r\n"
|
||||
footer = "\r\n"
|
||||
with {:ok, conn} <- chunk(conn, header),
|
||||
{:ok, conn} <- chunk(conn, file),
|
||||
{:ok, conn} <- chunk(conn, footer), do: send_picture(conn)
|
||||
conn
|
||||
end
|
||||
end
|
||||
|
||||
defmodule Farmbot.Configurator.Streamer do
|
||||
@moduledoc false
|
||||
require Logger
|
||||
use Plug.Router
|
||||
plug Plug.Logger
|
||||
plug Plug.Streamer
|
||||
plug :match
|
||||
plug :dispatch
|
||||
match _, do: conn
|
||||
end
|
|
@ -5,12 +5,6 @@ defmodule Farmbot.Serial.Gcode.Parser do
|
|||
|
||||
@spec parse_code(binary) :: {binary, tuple}
|
||||
|
||||
# ????
|
||||
def parse_code("R0 Q" <> tag), do: {tag, :idle}
|
||||
def parse_code("R1 Q" <> tag), do: {tag, :received}
|
||||
def parse_code("R2 Q" <> tag), do: {tag, :done}
|
||||
def parse_code("R3 Q" <> tag), do: {tag, :error}
|
||||
def parse_code("R4 Q" <> tag), do: {tag, :busy}
|
||||
# / ???
|
||||
def parse_code("R00 Q" <> tag), do: {tag, :idle}
|
||||
def parse_code("R01 Q" <> tag), do: {tag, :received}
|
||||
|
@ -19,7 +13,7 @@ defmodule Farmbot.Serial.Gcode.Parser do
|
|||
def parse_code("R04 Q" <> tag), do: {tag, :busy}
|
||||
|
||||
# TODO(Connor) Fix these
|
||||
def parse_code("R05" <> _r), do: :dont_handle_me # Dont care about this.
|
||||
def parse_code("R05" <> _r), do: {nil, :dont_handle_me} # Dont care about this.
|
||||
def parse_code("R06 " <> r), do: parse_report_calibration(r)
|
||||
|
||||
def parse_code("R21 " <> params), do: parse_pvq(params, :report_parameter_value)
|
||||
|
@ -28,8 +22,8 @@ defmodule Farmbot.Serial.Gcode.Parser do
|
|||
def parse_code("R81 " <> params), do: parse_end_stops(params)
|
||||
def parse_code("R82 " <> params), do: parse_report_current_position(params)
|
||||
def parse_code("R83 " <> v), do: parse_version(v)
|
||||
def parse_code("R99 " <> message) do {:debug_message, message} end
|
||||
def parse_code("Command" <> _), do: :dont_handle_me # I think this is a bug
|
||||
def parse_code("R99 " <> message) do {nil, {:debug_message, message}} end
|
||||
def parse_code("Command" <> _), do: {nil, :dont_handle_me} # I think this is a bug
|
||||
def parse_code(code) do {:unhandled_gcode, code} end
|
||||
|
||||
@spec parse_report_calibration(binary)
|
||||
|
|
|
@ -10,8 +10,6 @@ defmodule Farmbot.Serial.Handler do
|
|||
alias Farmbot.BotState
|
||||
alias Farmbot.Lib.Maths
|
||||
|
||||
@race_fix 5000
|
||||
|
||||
@typedoc """
|
||||
Handler pid or name
|
||||
"""
|
||||
|
@ -22,31 +20,20 @@ defmodule Farmbot.Serial.Handler do
|
|||
"""
|
||||
@type nerves :: handler
|
||||
|
||||
@typedoc """
|
||||
The current command in the buffer being worked on.
|
||||
"""
|
||||
@type current :: %{
|
||||
reply: nil | term,
|
||||
handshake: binary,
|
||||
timeout: reference | nil,
|
||||
from: {pid, reference}
|
||||
}
|
||||
|
||||
@typedoc """
|
||||
State of the GenServer
|
||||
"""
|
||||
@type state :: %{
|
||||
nerves: nerves,
|
||||
tty: binary,
|
||||
queue: :queue.queue,
|
||||
current: nil | :no_firm | current
|
||||
}
|
||||
@type state :: {:hey, :fixme}
|
||||
|
||||
@doc """
|
||||
Starts a UART GenServer
|
||||
"""
|
||||
def start_link(nerves, tty) do
|
||||
GenServer.start_link(__MODULE__, {nerves, tty})
|
||||
def start_link(nerves, tty, opts) when is_pid(nerves) and is_binary(tty) do
|
||||
GenServer.start_link(__MODULE__, {nerves, tty}, opts)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Starts a UART GenServer
|
||||
"""
|
||||
def start_link(tty, opts) when is_binary(tty) do
|
||||
GenServer.start_link(__MODULE__, tty, opts)
|
||||
end
|
||||
|
||||
@doc """
|
||||
|
@ -55,10 +42,12 @@ defmodule Farmbot.Serial.Handler do
|
|||
@spec available?(handler) :: boolean
|
||||
def available?(handler \\ __MODULE__)
|
||||
|
||||
# If handler is a pid
|
||||
def available?(handler) when is_pid(handler) do
|
||||
GenServer.call(handler, :available?)
|
||||
end
|
||||
|
||||
# if its a name, look it up
|
||||
def available?(handler) do
|
||||
uh = Process.whereis(handler)
|
||||
if uh do
|
||||
|
@ -97,319 +86,167 @@ defmodule Farmbot.Serial.Handler do
|
|||
|
||||
## Private
|
||||
|
||||
def init({nerves, tty}) when is_pid(nerves) and is_binary(tty) do
|
||||
Process.link(nerves)
|
||||
:ok = open_tty(nerves, tty)
|
||||
GenServer.cast(Farmbot.BotState.Hardware, :eff)
|
||||
{:ok, %{nerves: nerves, tty: tty, current: nil}}
|
||||
end
|
||||
|
||||
def init(tty) when is_binary(tty) do
|
||||
{:ok, nerves} = UART.start_link()
|
||||
init({nerves, tty})
|
||||
end
|
||||
|
||||
@spec open_tty(nerves, binary) :: :ok
|
||||
defp open_tty(nerves, tty) do
|
||||
# Open the tty
|
||||
:ok = UART.open(nerves, tty)
|
||||
|
||||
# configure framing
|
||||
UART.configure(nerves,
|
||||
:ok = UART.configure(nerves,
|
||||
framing: {UART.Framing.Line, separator: "\r\n"},
|
||||
active: true,
|
||||
rx_framing_timeout: 500)
|
||||
|
||||
# Black magic to fix races
|
||||
Process.sleep(@race_fix)
|
||||
|
||||
# Flush the buffers so we start fresh
|
||||
UART.flush(nerves)
|
||||
|
||||
:ok = UART.flush(nerves)
|
||||
:ok
|
||||
end
|
||||
|
||||
@spec init({nerves, binary}) :: {:ok, state} | :ignore
|
||||
def init({nerves, tty}) do
|
||||
Process.link(nerves)
|
||||
Logger.info "Starting serial handler: #{tty}"
|
||||
|
||||
:ok = open_tty(nerves, tty)
|
||||
update_default(self())
|
||||
|
||||
# generate a handshake
|
||||
handshake = generate_handshake()
|
||||
Logger.info "doing handshaking: #{handshake}"
|
||||
|
||||
if do_handshake(nerves, tty, handshake) do
|
||||
UART.write(nerves, "F83 #{handshake}") # ???
|
||||
do_hax()
|
||||
state = %{tty: tty, nerves: nerves, queue: :queue.new(), current: nil}
|
||||
{:ok, state}
|
||||
else
|
||||
Logger.warn "Handshake failed!"
|
||||
IO.puts "BLERP"
|
||||
state = %{
|
||||
tty: tty, nerves: nerves, queue: :queue.new(), current: :no_firm
|
||||
}
|
||||
{:ok, state}
|
||||
end
|
||||
end
|
||||
|
||||
# Shhhhh
|
||||
@spec do_hax :: no_return
|
||||
defp do_hax, do: GenServer.cast(Farmbot.BotState.Hardware, :eff)
|
||||
|
||||
@spec generate_handshake :: binary
|
||||
defp generate_handshake do
|
||||
random_int = :rand.uniform(99)
|
||||
"Q#{random_int}"
|
||||
end
|
||||
|
||||
@spec do_handshake(nerves, binary, binary, integer) :: boolean
|
||||
defp do_handshake(nerves, tty, handshake, retries \\ 5)
|
||||
|
||||
defp do_handshake(_, _, _, 0) do
|
||||
Logger.info "Could not handshake: to many retries."
|
||||
false
|
||||
end
|
||||
|
||||
defp do_handshake(nerves, tty, handshake, retries) do
|
||||
# Write a command to UART
|
||||
UART.write(nerves, "F83 #{handshake}")
|
||||
|
||||
# Wait for it to respong
|
||||
receive do
|
||||
# if it sends a partial, we are probably out of sync
|
||||
# flush the buffer and try again.
|
||||
{:nreves_uart, ^tty, {:partial, _}} ->
|
||||
UART.flush(nerves)
|
||||
do_handshake(nerves, tty, handshake)
|
||||
|
||||
# Recieved happens before our actual response, just go to the next one
|
||||
# if it exists
|
||||
{:nerves_uart, ^tty, "R01" <> _} -> do_handshake(nerves, tty, handshake)
|
||||
{:nerves_uart, ^tty, "Command:" <> _} -> do_handshake(nerves, tty, handshake)
|
||||
|
||||
# This COULD be our handshake. Check it.
|
||||
{:nerves_uart, ^tty, str} ->
|
||||
# if it contains our handshake, check if its the right command.
|
||||
# flush the buffer and return
|
||||
if String.contains?(str, handshake) do
|
||||
Logger.info "Successfully completed handshake!"
|
||||
"R83 " <> version = String.trim(str, " " <> handshake)
|
||||
Farmbot.BotState.set_fw_version(version)
|
||||
UART.flush(nerves)
|
||||
true
|
||||
else
|
||||
# If not, Move on to the next thing in the buffer.
|
||||
do_handshake(nerves, tty, handshake)
|
||||
end
|
||||
uh ->
|
||||
# if we recieve some other stuff, we have a leak or something.
|
||||
# I think this can be deleted.
|
||||
Logger.warn "Could not handshake: #{inspect uh}"
|
||||
false
|
||||
after
|
||||
# After 2 seconds try again.
|
||||
2_000 ->
|
||||
Logger.warn "Could not handshake: timeout, retrying."
|
||||
do_handshake(nerves, tty, handshake, retries - 1)
|
||||
end
|
||||
end
|
||||
|
||||
@spec update_default(pid) :: :ok | no_return
|
||||
defp update_default(pid) do
|
||||
deregister()
|
||||
# Either way, register this pid as the new one.
|
||||
Process.register(pid, __MODULE__)
|
||||
end
|
||||
|
||||
@spec deregister :: no_return
|
||||
defp deregister do
|
||||
# lookup the old default pid
|
||||
old_pid = Process.whereis(__MODULE__)
|
||||
|
||||
# if one existst, unregister it.
|
||||
if old_pid do
|
||||
Logger.info "Deregistering #{inspect old_pid} from default Serial Handler"
|
||||
Process.unregister(__MODULE__)
|
||||
end
|
||||
end
|
||||
|
||||
def handle_call(:get_state, _, state), do: {:reply, state, state}
|
||||
|
||||
def handle_call(:available?, _from, state) do
|
||||
case state.current do
|
||||
:no_firm -> {:reply, false, state}
|
||||
_ -> {:reply, true, state}
|
||||
end
|
||||
end
|
||||
def handle_call(:available?, _, state), do: {:reply, true, state}
|
||||
|
||||
# A new line to write.
|
||||
def handle_call({:write, str, timeout}, from, state) do
|
||||
# generate a handshake
|
||||
handshake = generate_handshake()
|
||||
# if the queue is empty, write this string now.
|
||||
if :queue.is_empty(state.queue) do
|
||||
ref = Process.send_after(self(), {:timeout, from, handshake}, timeout)
|
||||
current = %{reply: nil, handshake: handshake, timeout: ref, from: from}
|
||||
UART.write(state.nerves, str <> " #{handshake}")
|
||||
{:noreply, %{state | current: current}}
|
||||
else
|
||||
q = :queue.in({str, handshake, from, timeout}, state.queue)
|
||||
{:noreply, %{state | queue: q}}
|
||||
end
|
||||
UART.write(state.nerves, "#{str} #{handshake}")
|
||||
timer = Process.send_after(self(), :timeout, timeout)
|
||||
current = %{status: nil, reply: nil, from: from, q: handshake, timer: timer}
|
||||
{:noreply, %{state | current: current}}
|
||||
end
|
||||
|
||||
def handle_cast({:update_fw, hex_file, pid}, state) do
|
||||
def handle_cast({:update_fw, file, pid}, state) do
|
||||
UART.close(state.nerves)
|
||||
Process.sleep(1000)
|
||||
if String.contains?(state.tty, "tnt") do
|
||||
Logger.warn "Not a real arduino!"
|
||||
send(pid, :done)
|
||||
{:noreply, state}
|
||||
else
|
||||
UART.close(state.nerves)
|
||||
Process.sleep(100)
|
||||
flash_firmware(state.tty, hex_file, pid)
|
||||
Process.sleep(5000)
|
||||
{:ok, new_state} = init({state.nerves, state.tty})
|
||||
{:noreply, new_state}
|
||||
flash_firmware(state.tty, file, pid)
|
||||
end
|
||||
end
|
||||
|
||||
def handle_info({:timeout, from, handshake}, state) do
|
||||
def handle_info(:timeout, state) do
|
||||
current = state.current
|
||||
if current do
|
||||
new_current = maybe_timeout({from, handshake}, current)
|
||||
{:noreply, %{state | current: new_current}}
|
||||
GenServer.reply(current.from, :timeout)
|
||||
{:noreply, %{state | current: nil}}
|
||||
else
|
||||
{:noreply, state}
|
||||
end
|
||||
end
|
||||
|
||||
def handle_info({:nerves_uart, _tty, {:partial, thing}}, state) do
|
||||
Logger.warn ">> got partial gcode: #{thing}"
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
def handle_info({:nerves_uart, _tty, {:error, :eio}}, state) do
|
||||
Logger.error "ARDUINO DISCONNECTED!"
|
||||
{:noreply, %{state | queue: :queue.new(), current: nil}}
|
||||
end
|
||||
|
||||
# This is when we get a code in from nerves_uart
|
||||
@lint false # this is just a mess sorry
|
||||
def handle_info({:nerves_uart, tty, gcode}, state) do
|
||||
unless tty != state.tty do
|
||||
parsed = Parser.parse_code(gcode)
|
||||
case parsed do
|
||||
# if the code has a handshake and its not done
|
||||
# we just want to handle the code. Nothing special.
|
||||
|
||||
# derp
|
||||
{:debug_message, _message} ->
|
||||
handle_gcode(parsed, state)
|
||||
|
||||
{_hs, :done} ->
|
||||
current = if state.current do
|
||||
# cancel the timer
|
||||
Process.cancel_timer(state.current.timeout)
|
||||
# reply to the client
|
||||
GenServer.reply(state.current.from, state.current.reply)
|
||||
nil
|
||||
else
|
||||
state.current
|
||||
end
|
||||
handle_gcode(:done, %{state | current: current})
|
||||
|
||||
# If its not done,
|
||||
{hs, code} ->
|
||||
current = if (state.current || false) && (state.current.handshake == hs) do
|
||||
%{state.current | reply: code}
|
||||
else
|
||||
state.current
|
||||
end
|
||||
handle_gcode(code, %{state | current: current})
|
||||
|
||||
# anything else just handle the code.
|
||||
_ -> handle_gcode(parsed, state)
|
||||
end
|
||||
def handle_info({:nerves_uart, tty, str}, state) when is_binary(str) do
|
||||
if tty == state.tty do
|
||||
current = str |> Parser.parse_code |> do_handle(state.current)
|
||||
{:noreply, %{state | current: current}}
|
||||
end
|
||||
end
|
||||
|
||||
defp handle_gcode(:dont_handle_me, state), do: {:noreply, state}
|
||||
def handle_info({:nerves_uart, _tty, {:partial, _}}, s), do: {:noreply, s}
|
||||
|
||||
defp handle_gcode(:idle, state) do
|
||||
{:noreply, state}
|
||||
def handle_info({:nerves_uart, tty, {:error, error}}, state) do
|
||||
Logger.error "#{tty} handler exiting!: #{error}"
|
||||
{:stop, error, state}
|
||||
end
|
||||
|
||||
defp handle_gcode(:busy, state) do
|
||||
def terminate(reason, state) do
|
||||
UART.close(state.nerves)
|
||||
GenServer.stop(state.nerves, reason)
|
||||
end
|
||||
|
||||
@spec do_handle({binary, any}, map | nil) :: map | nil
|
||||
defp do_handle({_qcode, parsed}, current) when is_map(current) do
|
||||
case handle_gcode(parsed) do
|
||||
{:status, :done} ->
|
||||
GenServer.reply(current.from, current.reply)
|
||||
Process.cancel_timer(current.timer)
|
||||
nil
|
||||
{:status, status} -> %{current | status: status}
|
||||
{:reply, reply} -> %{current | reply: reply}
|
||||
_ -> current
|
||||
end
|
||||
end
|
||||
|
||||
defp do_handle({_qcode, parsed}, nil) do
|
||||
handle_gcode(parsed)
|
||||
nil
|
||||
end
|
||||
|
||||
@spec generate_handshake :: binary
|
||||
defp generate_handshake, do: "Q#{:rand.uniform(99)}"
|
||||
|
||||
@spec handle_gcode(any) :: {:status, any} | {:reply, any} | nil
|
||||
defp handle_gcode(:idle), do: {:status, :idle}
|
||||
|
||||
defp handle_gcode(:busy) do
|
||||
Logger.info ">>'s arduino is busy.", type: :busy
|
||||
{:noreply, state}
|
||||
{:status, :busy}
|
||||
end
|
||||
|
||||
defp handle_gcode(:done, state) do
|
||||
# when we get done we need to check the queue for moar commands.
|
||||
# if there is more create a new current map, start a new timer etc.
|
||||
defp handle_gcode(:done), do: {:status, :done}
|
||||
|
||||
# if there is nothing in the queue, nothing to do here.
|
||||
if :queue.is_empty(state.queue) do
|
||||
{:noreply, state}
|
||||
# if there is something in the queue
|
||||
else
|
||||
{{str, handshake, from, millis}, q} = :queue.out(state.queue)
|
||||
ref = Process.send_after(self(), {:timeout, from, handshake}, millis)
|
||||
current = %{reply: nil, handshake: handshake, timeout: ref, from: from}
|
||||
UART.write(state.nerves, str <> " Q#{handshake}")
|
||||
{:noreply, %{state | current: current, queue: q}}
|
||||
end
|
||||
defp handle_gcode(:received), do: {:status, :received}
|
||||
|
||||
defp handle_gcode({:debug_message, message}) do
|
||||
Logger.info ">>'s arduino says: #{message}"
|
||||
nil
|
||||
end
|
||||
|
||||
defp handle_gcode(:received, state) do
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
defp handle_gcode({:debug_message, _message}, state) do
|
||||
# Logger.info ">>'s arduino says: #{message}"
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
defp handle_gcode({:report_pin_value, pin, value}, state)
|
||||
defp handle_gcode({:report_pin_value, pin, value} = reply)
|
||||
when is_integer(pin) and is_integer(value) do
|
||||
BotState.set_pin_value(pin, value)
|
||||
{:noreply, state}
|
||||
{:reply, reply}
|
||||
end
|
||||
|
||||
defp handle_gcode({:report_current_position, x_steps,y_steps,z_steps}, state) do
|
||||
defp handle_gcode({:report_current_position, x_steps, y_steps, z_steps} = reply) do
|
||||
BotState.set_pos(
|
||||
Maths.steps_to_mm(x_steps, spm(:x)),
|
||||
Maths.steps_to_mm(y_steps, spm(:y)),
|
||||
Maths.steps_to_mm(z_steps, spm(:z)))
|
||||
{:noreply, state}
|
||||
{:reply, reply}
|
||||
end
|
||||
|
||||
defp handle_gcode({:report_parameter_value, param, value}, state)
|
||||
defp handle_gcode({:report_parameter_value, param, value} = reply)
|
||||
when is_atom(param) and is_integer(value) do
|
||||
unless value == -1 do
|
||||
BotState.set_param(param, value)
|
||||
end
|
||||
{:noreply, state}
|
||||
{:reply, reply}
|
||||
end
|
||||
|
||||
defp handle_gcode({:reporting_end_stops, x1,x2,y1,y2,z1,z2}, state) do
|
||||
defp handle_gcode({:reporting_end_stops, x1,x2,y1,y2,z1,z2} = reply) do
|
||||
BotState.set_end_stops({x1,x2,y1,y2,z1,z2})
|
||||
{:noreply, state}
|
||||
{:reply, reply}
|
||||
end
|
||||
|
||||
defp handle_gcode({:report_software_version, version}, state) do
|
||||
defp handle_gcode({:report_software_version, version} = reply) do
|
||||
BotState.set_fw_version(version)
|
||||
{:noreply, state}
|
||||
{:reply, reply}
|
||||
end
|
||||
|
||||
defp handle_gcode({:unhandled_gcode, code}, state) do
|
||||
defp handle_gcode(:error), do: {:reply, :error}
|
||||
|
||||
defp handle_gcode(:dont_handle_me), do: nil
|
||||
|
||||
defp handle_gcode({:unhandled_gcode, code}) do
|
||||
Logger.warn ">> got an misc gcode #{code}"
|
||||
{:noreply, state}
|
||||
{:reply, code}
|
||||
end
|
||||
|
||||
defp handle_gcode({:error, :ebadf}, state) do
|
||||
{:ok, new_state} = init({state.nerves, state.tty})
|
||||
{:noreply, new_state}
|
||||
end
|
||||
|
||||
defp handle_gcode(parsed, state) do
|
||||
defp handle_gcode(parsed) do
|
||||
Logger.warn "Unhandled message: #{inspect parsed}"
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
def terminate(_, _) do
|
||||
Process.unregister(__MODULE__)
|
||||
{:reply, parsed}
|
||||
end
|
||||
|
||||
def flash_firmware(tty, hex_file, pid) do
|
||||
|
@ -423,9 +260,6 @@ defmodule Farmbot.Serial.Handler do
|
|||
"-Uflash:w:#{hex_file}:i"]
|
||||
|
||||
"avrdude" |> System.cmd(params) |> log(pid)
|
||||
# handler = Process.whereis(__MODULE__)
|
||||
# if handler, do: spawn fn() -> GenServer.stop(handler, :normal) end
|
||||
# Farmbot.Serial.Supervisor.open_ttys(Farmbot.Serial.Supervisor, [tty])
|
||||
end
|
||||
|
||||
defp log({_, 0}, pid) do
|
||||
|
@ -433,9 +267,9 @@ defmodule Farmbot.Serial.Handler do
|
|||
send pid, :done
|
||||
end
|
||||
|
||||
defp log(_, pid) do
|
||||
defp log(stuff, pid) do
|
||||
Logger.error "FAILED TO FLASH FIRMWARE!"
|
||||
send pid, :error
|
||||
send pid, {:error, stuff}
|
||||
end
|
||||
|
||||
@spec spm(atom) :: integer
|
||||
|
@ -444,17 +278,4 @@ defmodule Farmbot.Serial.Handler do
|
|||
|> String.to_atom
|
||||
|> Farmbot.BotState.get_config()
|
||||
end
|
||||
|
||||
@spec maybe_timeout({{pid, reference}, binary}, current) :: current
|
||||
defp maybe_timeout({from, handshake}, current) do
|
||||
# if we actually are working on the thing that this timeout was created
|
||||
# for, reply timeout to it.
|
||||
if (current.from == from) and (current.handshake == handshake) do
|
||||
GenServer.reply(from, {:error, :timeout})
|
||||
nil
|
||||
else
|
||||
# this was probably already finished or somthing. /shrug
|
||||
current
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,51 +17,72 @@ defmodule Farmbot.Serial.Supervisor do
|
|||
|
||||
def init([]) do
|
||||
children = [
|
||||
# Here we start a task for opening ttys. Since they can change depending
|
||||
# on who made the arduino, what drivers are running etc, we cant hard
|
||||
# code it.
|
||||
worker(Task, [__MODULE__, :open_ttys, [__MODULE__]], restart: :transient)
|
||||
]
|
||||
supervise(children, strategy: :one_for_all)
|
||||
end
|
||||
|
||||
if Mix.Project.config[:target] != "host" do
|
||||
|
||||
# if runnin on the device, enumerate any uart devices and open them
|
||||
# individually.
|
||||
@spec open_ttys(atom | pid, [binary]) :: :ok | no_return
|
||||
def open_ttys(supervisor, ttys \\ nil) do
|
||||
blah = ttys || UART.enumerate() |> Map.drop(["ttyS0","ttyAMA0"]) |> Map.keys
|
||||
blah |> try_open(supervisor)
|
||||
case blah do
|
||||
[one_tty] ->
|
||||
thing = {one_tty, [name: Farmbot.Serial.Handler]}
|
||||
try_open([thing], supervisor)
|
||||
ttys when is_list(ttys) ->
|
||||
ttys
|
||||
|> Enum.map(fn(device) -> {device, []} end)
|
||||
|> try_open(supervisor)
|
||||
end
|
||||
end
|
||||
else
|
||||
@tty Application.get_env(:farmbot, :tty, nil)
|
||||
|
||||
# If running in the host environment the proper tty is expected to be in
|
||||
# the environment
|
||||
@tty System.get_env("ARDUINO_TTY") || Application.get_env(:farmbot, :tty)
|
||||
@spec open_ttys(atom | pid, [binary]) :: :ok | no_return
|
||||
def open_ttys(supervisor, list \\ nil)
|
||||
def open_ttys(supervisor, _) do
|
||||
if @tty do
|
||||
try_open([@tty], supervisor)
|
||||
thing = {@tty, [name: Farmbot.Serial.Handler]}
|
||||
try_open([thing], supervisor)
|
||||
else
|
||||
Logger.warn ">> EXPORT ARDUINO_TTY to initialize arduino in Host mode"
|
||||
:ok
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@spec try_open([binary], atom | pid) :: :ok | no_return
|
||||
@spec try_open([{binary, [any]}], atom | pid) :: :ok | no_return
|
||||
defp try_open([], _), do: :ok
|
||||
defp try_open([tty | rest], sup) do
|
||||
defp try_open([{tty, opts} | rest], sup) do
|
||||
{:ok, nerves} = UART.start_link()
|
||||
nerves
|
||||
|> UART.open(tty, speed: @baud, active: false)
|
||||
|> bleep(tty, {sup, nerves})
|
||||
|> bleep({tty, opts}, sup, nerves)
|
||||
|
||||
try_open(rest, {sup, nerves})
|
||||
try_open(rest, sup)
|
||||
end
|
||||
|
||||
@spec bleep(any, binary, {atom | pid, atom | pid})
|
||||
@spec bleep(any, binary, atom | pid, atom | pid)
|
||||
:: {:ok, pid} | false | no_return
|
||||
defp bleep(:ok, tty, {sup, nerves}) do
|
||||
worker_spec = worker(Handler, [nerves, tty], [restart: :permanent])
|
||||
defp bleep(:ok, {tty, opts}, sup, nerves) do
|
||||
worker_spec = worker(Handler, [nerves, tty, opts], [restart: :permanent])
|
||||
UART.close(nerves)
|
||||
Process.sleep(1500)
|
||||
{:ok, _pid} = Supervisor.start_child(sup, worker_spec)
|
||||
end
|
||||
|
||||
defp bleep(_resp, _tty, {_, nerves}) do
|
||||
defp bleep(resp, {tty, _opts}, _, nerves) do
|
||||
Logger.error "Could not open #{tty}: #{inspect resp}"
|
||||
GenServer.stop(nerves, :normal)
|
||||
false
|
||||
end
|
||||
|
|
|
@ -110,7 +110,6 @@ defmodule Farmbot.System.Network do
|
|||
|
||||
# First Party Farmware is not really a network concern but here we are...
|
||||
{:ok, fpf} = GenServer.call(CS, {:get, Configuration, "first_party_farmware"})
|
||||
IO.puts "FIRST PARTY FIRMWARE BOOL: #{inspect fpf}"
|
||||
|
||||
if ntp do
|
||||
Logger.info ">> ntp"
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
defmodule Farmbot.System.NervesCommon.Cell do
|
||||
require Logger
|
||||
|
||||
@ssdp_fields [
|
||||
location: "http://localhost:3000/myservice.json",
|
||||
server: "MyServerName",
|
||||
"cache-control": "max-age=1800"
|
||||
]
|
||||
|
||||
@cell_ssdp_st "urn:nerves-project-org:service:cell:1"
|
||||
@cell_ssdp_server "Nerves"
|
||||
@cell_ssdp_location "/_cell/"
|
||||
|
||||
def setup do
|
||||
config = Application.get_all_env(:nerves_cell)
|
||||
Logger.info "setting up cell"
|
||||
Nerves.SSDPServer.publish usn(config), @cell_ssdp_st, fields(config)
|
||||
end
|
||||
|
||||
defp fields(config) do
|
||||
[ "Server": @cell_ssdp_server,
|
||||
"Location": @cell_ssdp_location,
|
||||
"X-Id": board_id() || "unknown",
|
||||
"X-Version": config[:version],
|
||||
"X-Firmware-Stream": config[:firmware_stream] ]
|
||||
|> field(:"X-Platform", platform(config))
|
||||
|> field(:"X-Tags", config[:tags])
|
||||
|> field(:"X-Target", config[:target])
|
||||
|> field(:"X-Node", node_name())
|
||||
|> field(:"X-Creation-Date", config[:creation_date], &DateTime.to_iso8601/1)
|
||||
end
|
||||
|
||||
# if value truthy, add field with value optionally transformed by fn
|
||||
@spec field(Keyword.t, atom, term, function) :: Keyword.t
|
||||
defp field(fields, key, val, f \\ &(&1)) do
|
||||
if val do
|
||||
Keyword.put fields, key, f.(val)
|
||||
else
|
||||
fields
|
||||
end
|
||||
end
|
||||
|
||||
defp platform(config), do: config[:platform] || config[:app]
|
||||
defp usn(config), do: "uuid:#{board_id() || "unknown"}::#{platform(config)}"
|
||||
|
||||
# return a board ID, or :unknown if the board ID cannot be generated
|
||||
# REVIEW TODO cache in ets, move to library, handle other board types better
|
||||
@lint false
|
||||
defp board_id do
|
||||
try do
|
||||
{raw_id, 0} = System.cmd "boardid", ["-n", "6"]
|
||||
String.strip(raw_id)
|
||||
rescue
|
||||
_ in ErlangError -> nil
|
||||
end
|
||||
end
|
||||
|
||||
# return a node id as a string if valid, else nil
|
||||
defp node_name do
|
||||
if Node.alive? do
|
||||
Node.self
|
||||
|> Atom.to_string
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
|
@ -21,7 +21,6 @@ defmodule Farmbot.System.NervesCommon.Network do
|
|||
Process.sleep(5000)
|
||||
GenEvent.add_handler(event_manager(),
|
||||
Farmbot.System.NervesCommon.EventManager, [])
|
||||
# Farmbot.System.NervesCommon.Cell.start_link
|
||||
{:ok, %{}}
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
defmodule Module.concat([Farmbot, System, "rpi0w", FileSystem]) do
|
||||
@moduledoc false
|
||||
@behaviour Farmbot.System.FS
|
||||
@state_path Application.get_env(:farmbot, :path)
|
||||
@block_device "/dev/mmcblk0p3"
|
||||
@fs_type "ext4"
|
||||
@ro_options ["-t", @fs_type, "-o", "ro,remount", @block_device, @state_path]
|
||||
@rw_options ["-t", @fs_type, "-o", "rw,remount", @block_device, @state_path]
|
||||
use Farmbot.System.NervesCommon.FileSystem,
|
||||
target: "rpi0w",
|
||||
ro_options: @ro_options,
|
||||
rw_options: @rw_options,
|
||||
state_path: @state_path,
|
||||
fs_type: @fs_type,
|
||||
block_device: @block_device
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
defmodule Module.concat([Farmbot, System, "rpi0w", Network]) do
|
||||
use Farmbot.System.NervesCommon.Network, target: "rpi0w", modules: ["brcmfmac"]
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
defmodule Module.concat([Farmbot, System, "rpi0w"]) do
|
||||
@moduledoc false
|
||||
@behaviour Farmbot.System
|
||||
|
||||
use Farmbot.System.NervesCommon, target: "rpi0w"
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
defmodule Module.concat([Farmbot, System, "rpi0w", Updates]) do
|
||||
use Farmbot.System.NervesCommon.Updates, target: "rpi0w"
|
||||
end
|
6
mix.lock
6
mix.lock
|
@ -9,7 +9,7 @@
|
|||
"cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], []},
|
||||
"credo": {:hex, :credo, "0.6.0-rc1", "3db898270ba651aa7d8dc8d844f2827e0111526a01474ab088c7f7f677e83778", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, optional: false]}]},
|
||||
"dialyxir": {:hex, :dialyxir, "0.4.3", "a4daeebd0107de10d3bbae2ccb6b8905e69544db1ed5fe9148ad27cd4cb2c0cd", [:mix], []},
|
||||
"distillery": {:hex, :distillery, "1.2.2", "d5a52920cbe2378c8a21dfc83b526b4225944b9dce7bf170fe5f5cddda81ffb3", [:mix], []},
|
||||
"distillery": {:hex, :distillery, "1.3.1", "211231af29ea55c79143d601a2caaf5936cc7b99e73bef25d78a0ff7f321b7fe", [:mix], []},
|
||||
"earmark": {:hex, :earmark, "1.0.3", "89bdbaf2aca8bbb5c97d8b3b55c5dd0cff517ecc78d417e87f1d0982e514557b", [:mix], []},
|
||||
"elixir_make": {:hex, :elixir_make, "0.4.0", "992f38fabe705bb45821a728f20914c554b276838433349d4f2341f7a687cddf", [:mix], []},
|
||||
"ex_doc": {:hex, :ex_doc, "0.14.5", "c0433c8117e948404d93ca69411dd575ec6be39b47802e81ca8d91017a0cf83c", [:mix], [{:earmark, "~> 1.0", [hex: :earmark, optional: false]}]},
|
||||
|
@ -46,9 +46,9 @@
|
|||
"nerves_network_interface": {:hex, :nerves_network_interface, "0.3.2", "e7450f7eccd7387ceebee6096a0646bcdc0dd4aa77077e5fa81f6767da9b77af", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}]},
|
||||
"nerves_runtime": {:hex, :nerves_runtime, "0.1.1", "efa80e0dab93a53cb44dacdb6e2a326dfe4b54b94a0da6173c10f410e08fecb5", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}, {:gen_stage, "~> 0.4", [hex: :gen_stage, optional: false]}, {:nerves_uart, "~> 0.1.0", [hex: :nerves_uart, optional: true]}]},
|
||||
"nerves_ssdp_server": {:hex, :nerves_ssdp_server, "0.2.1", "2d010552023fc1a724e8cb5c92479a58552976e6f805b6dbf09babd31f923b8f", [:mix], []},
|
||||
"nerves_system_br": {:hex, :nerves_system_br, "0.9.4", "5096a9dfec49d4663ccb94c4a4fe45885303fbf31108f7e9400369bdec94b5e7", [:mix], []},
|
||||
"nerves_system_br": {:git, "https://github.com/tmecklem/nerves_system_br.git", "b4297e361bb8ecb3abb6abdd49e52faa6350af51", [branch: "master"]},
|
||||
"nerves_toolchain_arm_unknown_linux_gnueabihf": {:hex, :nerves_toolchain_arm_unknown_linux_gnueabihf, "0.10.0", "18200c6cc3fcda1cbe263b7f7d50ff05db495b881ade9436cd1667b3e8e62429", [:mix], [{:nerves, "~> 0.4", [hex: :nerves, optional: false]}, {:nerves_toolchain_ctng, "~> 0.9", [hex: :nerves_toolchain_ctng, optional: false]}]},
|
||||
"nerves_toolchain_armv6_rpi_linux_gnueabi": {:hex, :nerves_toolchain_armv6_rpi_linux_gnueabi, "0.9.0", "11618febee06ceb16eae5833e0df331599c135727630e1aedec7b2677a5fa9dc", [:mix], [{:nerves, "~> 0.4.0", [hex: :nerves, optional: false]}, {:nerves_toolchain_ctng, "~> 0.8.0", [hex: :nerves_toolchain_ctng, optional: false]}]},
|
||||
"nerves_toolchain_armv6_rpi_linux_gnueabi": {:hex, :nerves_toolchain_armv6_rpi_linux_gnueabi, "0.10.0", "a730667fb22710270d3e9fdab8ce7230381c424f65b0381feb693829bc460f80", [:mix], [{:nerves, "~> 0.4", [hex: :nerves, optional: false]}, {:nerves_toolchain_ctng, "~> 0.9", [hex: :nerves_toolchain_ctng, optional: false]}]},
|
||||
"nerves_toolchain_ctng": {:hex, :nerves_toolchain_ctng, "0.9.0", "825b2b5bbacc3ad20c8513baafd44978616d5b451e6e052cdb727be81e7cdcac", [:mix], []},
|
||||
"nerves_uart": {:hex, :nerves_uart, "0.1.2", "4310dbb1721a5a007b8e5c416cf81754415bde6b7e2c9aa65a059886b85e637c", [:make, :mix], [{:elixir_make, "~> 0.4", [hex: :elixir_make, optional: false]}]},
|
||||
"nerves_wpa_supplicant": {:hex, :nerves_wpa_supplicant, "0.2.3", "2666b21bf0868f0d3b127930c3bacf59b178a0d015d308ae3985dcb7c1595870", [:make, :mix], [{:elixir_make, "~> 0.3", [hex: :elixir_make, optional: false]}]},
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
/_build
|
||||
/cover
|
||||
/deps
|
||||
erl_crash.dump
|
||||
*.ez
|
||||
build.log
|
||||
.nerves
|
|
@ -0,0 +1,88 @@
|
|||
# Changelog
|
||||
|
||||
## v0.11.1-dev
|
||||
|
||||
## v0.11.0
|
||||
|
||||
* New features
|
||||
* Enabled USB_SERIAL and FTDI_SIO support. Needed for connecting with Arduino to the USB ports
|
||||
* Support for Nerves 0.5.0
|
||||
|
||||
## v0.10.0
|
||||
|
||||
* New features
|
||||
* Upgraded the Linux kernel to 4.4.43. This also removes the
|
||||
call to mkknlimg which is no longer needed.
|
||||
* Bump toolchain to use gcc 5.3 (previously using gcc 4.9.3)
|
||||
|
||||
## v0.9.1
|
||||
|
||||
* Bug Fixes
|
||||
* Loosen mistaken nerves dep on `0.4.0` to `~> 0.4.0`
|
||||
|
||||
## v0.9.0
|
||||
|
||||
This version switches to using the `nerves_package` compiler. This will
|
||||
consolidate overall deps and compilers.
|
||||
|
||||
* Nerves.System.BR v0.8.1
|
||||
* Support for distillery
|
||||
* Support for nerves_package compiler
|
||||
|
||||
## v0.7.0
|
||||
|
||||
When upgrading to this version, be sure to review the updates to
|
||||
nerves_defconfig if you have customized this system.
|
||||
|
||||
* nerves_system_br v0.7.0
|
||||
* Package updates
|
||||
* Buildroot 2016.08
|
||||
* Linux 4.4
|
||||
|
||||
## v0.6.1
|
||||
|
||||
* Package versions
|
||||
* Nerves.System.BR v0.6.1
|
||||
|
||||
* New features
|
||||
* All Raspberry Pi-specific configuration is now in this repository
|
||||
* Enabled SMP Erlang - even though the RPi Zero and Model B+ are
|
||||
single core systems, some NIFs require SMP Erlang.
|
||||
|
||||
## v0.6.0
|
||||
* Nerves.System.BR v0.6.0
|
||||
* Package updates
|
||||
* Erlang OTP 19
|
||||
* Elixir 1.3.1
|
||||
* fwup 0.8.0
|
||||
* erlinit 0.7.3
|
||||
* bborg-overlays (pull in I2C typo fix from upstream)
|
||||
* Bug fixes
|
||||
* Synchronize file system kernel configs across all platforms
|
||||
|
||||
## v0.5.2
|
||||
* Enhancements
|
||||
* Enabled USB Printer kernel mod. Needs to be loaded with `modprobe` to use
|
||||
* Bug Fixes(raspberry pi)
|
||||
* Enabled multicast in linux config for rpi/rpi2/rpi3/ev3
|
||||
|
||||
## v0.5.1
|
||||
* Nerves.System.BR v0.5.1
|
||||
* Bug Fixes(nerves-env)
|
||||
* Added include paths to CFLAGS and CXXFLAGS
|
||||
* Pass sysroot to LDFLAGS
|
||||
|
||||
## v0.5.0
|
||||
* Nerves.System.BR v0.5.0
|
||||
* New features
|
||||
* WiFi drivers enabled by default on RPi2 and RPi3
|
||||
* Include wireless regulatory database in Linux kernel by default
|
||||
on WiFi-enabled platforms. Since kernel/rootfs are read-only and
|
||||
coupled together for firmware updates, the normal CRDA/udev approach
|
||||
isn't necessary.
|
||||
* Upgraded the default BeagleBone Black kernel from 3.8 to 4.4.9. The
|
||||
standard BBB device tree overlays are included by default even though the
|
||||
upstream kernel patches no longer include them.
|
||||
* Change all fwup configurations from two step upgrades to one step
|
||||
upgrades. If you used the base fwup.conf files to upgrade, you no
|
||||
longer need to finalize the upgrade. If not, there's no change.
|
|
@ -0,0 +1,4 @@
|
|||
# Add project-specific packages for Buildroot here
|
||||
#
|
||||
# If these are non-proprietary, please consider contributing them back to
|
||||
# Nerves or Buildroot.
|
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -0,0 +1,54 @@
|
|||
# Raspberry Pi Model Zero
|
||||
|
||||
This is the base Nerves System configuration for the Raspberry Pi Zero and
|
||||
Raspberry Pi Zero W.
|
||||
|
||||
![Fritzing Raspberry Pi Zero image](assets/images/raspberry-pi-model-zero.png)
|
||||
<br><sup>[Image credit](#fritzing)</sup>
|
||||
|
||||
| Feature | Description |
|
||||
| -------------------- | ------------------------------- |
|
||||
| CPU | 1 GHz ARM1176JZF-S |
|
||||
| Memory | 512 MB |
|
||||
| Storage | MicroSD |
|
||||
| Linux kernel | 4.4 w/ Raspberry Pi patches |
|
||||
| IEx terminal | HDMI and USB keyboard (can be changed to UART or OTG USB serial via `ttyGS0`) |
|
||||
| GPIO, I2C, SPI | Yes - Elixir ALE |
|
||||
| ADC | No |
|
||||
| PWM | Yes, but no Elixir support |
|
||||
| UART | 1 available - `ttyAMA0` |
|
||||
| Camera | Yes - via rpi-userland |
|
||||
| Ethernet | Yes - via OTG USB port |
|
||||
| WiFi | Pi Zero W, IoT pHAT or USB WiFi dongle |
|
||||
| Bluetooth | Not supported yet |
|
||||
|
||||
## Supported OTG USB modes
|
||||
|
||||
The base image activates the `dwc2` overlay, which allows the Pi Zero to appear as a
|
||||
device (aka gadget mode). When plugged into a host computer via the OTG port, the Pi
|
||||
Zero will appear as a composite ethernet and serial device.
|
||||
|
||||
When a peripheral is plugged into the OTG port, the Pi Zero will act as USB host, with
|
||||
somewhat reduced performace vs the `dwc_otg` driver used in other base systems like
|
||||
the official `nerves_system_rpi`.
|
||||
|
||||
## Supported HAT WiFi devices
|
||||
|
||||
The base image includes drivers for the Red Bear IoT pHAT.
|
||||
|
||||
## Supported USB WiFi devices
|
||||
|
||||
The base image includes drivers and firmware for onboard Raspberry Pi
|
||||
Zero W wifi driver (`brcmfmac` driver), Ralink RT53xx
|
||||
(`rt2800usb` driver) and RealTek RTL8712U (`r8712u` driver) devices.
|
||||
|
||||
If you are unsure what driver your WiFi dongle requires, run Raspbian and configure WiFi
|
||||
for your device. At a shell prompt, run `lsmod` to see which drivers are loaded.
|
||||
Running `dmesg` may also give a clue. When using `dmesg`, reinsert the USB
|
||||
dongle to generate new log messages if you don't see them.
|
||||
|
||||
## Installation
|
||||
|
||||
Coming soon. For now, a custom system build is required until a system image file is created.
|
||||
|
||||
[Image credit](#fritzing): This image is from the [Fritzing](http://fritzing.org/home/) parts library.
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootwait
|
|
@ -0,0 +1,26 @@
|
|||
# Please note that this is only a sample, we recommend you to change it to fit
|
||||
# your needs.
|
||||
# You should override this file using a post-build script.
|
||||
# See http://buildroot.org/downloads/manual/manual.html#rootfs-custom
|
||||
# and http://elinux.org/RPiconfig for a description of config.txt syntax
|
||||
# Device tree options are documented at
|
||||
# https://github.com/raspberrypi/documentation/blob/master/configuration/device-tree.md
|
||||
|
||||
kernel=zImage
|
||||
|
||||
# This, along with the Raspberry Pi "x" firmware is need for the camera
|
||||
# to work. See Target packages->Hardware handling->Firmware for "x" firmware.
|
||||
gpu_mem=128
|
||||
|
||||
# Enable I2C and SPI
|
||||
dtparam=i2c_arm=on,spi=on
|
||||
|
||||
# Comment this in or modify to enable OneWire
|
||||
# NOTE: check that the overlay that you specify is in the boot partition or
|
||||
# this won't work.
|
||||
#dtoverlay=w1-gpio-pullup,gpiopin=4
|
||||
dtoverlay=dwc2
|
||||
dtoverlay=pi3-disable-bt
|
||||
|
||||
# Enable the UART (/dev/ttyS0) on the RPi3.
|
||||
enable_uart=1
|
|
@ -0,0 +1,359 @@
|
|||
# Firmware configuration file for the Raspberry Pi
|
||||
|
||||
# Default paths if not specified via the commandline
|
||||
define(ROOTFS, "${NERVES_SYSTEM}/images/rootfs.squashfs")
|
||||
|
||||
# This configuration file will create an image that
|
||||
# has an MBR and the following 3 partitions:
|
||||
#
|
||||
# +----------------------------+
|
||||
# | MBR |
|
||||
# +----------------------------+
|
||||
# | p0: Boot partition (FAT32) |
|
||||
# | zImage, bootcode.bin, |
|
||||
# | config.txt, etc. |
|
||||
# +----------------------------+
|
||||
# | p1*: Rootfs A (squashfs) |
|
||||
# +----------------------------+
|
||||
# | p1*: Rootfs B (squashfs) |
|
||||
# +----------------------------+
|
||||
# | p2: Application (FAT32) |
|
||||
# +----------------------------+
|
||||
#
|
||||
# The p1 partition points to whichever of Rootfs A or B that
|
||||
# is active.
|
||||
#
|
||||
# The image is sized to be less than 1 GB so that it fits on
|
||||
# nearly any SDCard around. If you have a larger SDCard and
|
||||
# need more space, feel free to bump the partition sizes
|
||||
# below.
|
||||
|
||||
# The Raspberry Pi is incredibly picky on the partition sizes
|
||||
# and in ways that I don't understand. Test changes one at a
|
||||
# time to make sure that they boot. (Sizes are in 512 byte
|
||||
# blocks)
|
||||
define(BOOT_PART_OFFSET, 63)
|
||||
define(BOOT_PART_COUNT, 77261)
|
||||
|
||||
# Let the rootfs have room to grow up to 128 MiB and align
|
||||
# it to the nearest 1 MB boundary
|
||||
define(ROOTFS_A_PART_OFFSET, 77324)
|
||||
define(ROOTFS_A_PART_COUNT, 289044)
|
||||
define(ROOTFS_B_PART_OFFSET, 366368)
|
||||
define(ROOTFS_B_PART_COUNT, 289044)
|
||||
|
||||
# Application partition. This partition can occupy all of the
|
||||
# remaining space. Size it to fit the destination.
|
||||
define(APP_PART_OFFSET, 655412)
|
||||
define(APP_PART_COUNT, 1048576)
|
||||
|
||||
# Firmware metadata
|
||||
meta-product = "Nerves Firmware"
|
||||
meta-description = ""
|
||||
meta-version = ${NERVES_SDK_VERSION}
|
||||
meta-platform = "rpi"
|
||||
meta-architecture = "arm"
|
||||
meta-author = "Frank Hunleth"
|
||||
|
||||
# File resources are listed in the order that they are included in the .fw file
|
||||
# This is important, since this is the order that they're written on a firmware
|
||||
# update due to the event driven nature of the update system.
|
||||
file-resource bootcode.bin {
|
||||
host-path = "${NERVES_SYSTEM}/images/rpi-firmware/bootcode.bin"
|
||||
}
|
||||
file-resource fixup.dat {
|
||||
host-path = "${NERVES_SYSTEM}/images/rpi-firmware/fixup.dat"
|
||||
}
|
||||
file-resource start.elf {
|
||||
host-path = "${NERVES_SYSTEM}/images/rpi-firmware/start.elf"
|
||||
}
|
||||
file-resource config.txt {
|
||||
host-path = "${NERVES_SYSTEM}/images/config.txt"
|
||||
}
|
||||
file-resource cmdline.txt {
|
||||
host-path = "${NERVES_SYSTEM}/images/cmdline.txt"
|
||||
}
|
||||
file-resource zImage {
|
||||
host-path = "${NERVES_SYSTEM}/images/zImage"
|
||||
}
|
||||
file-resource bcm2708-rpi-0-w.dtb {
|
||||
host-path = "${NERVES_SYSTEM}/images/bcm2708-rpi-0-w.dtb"
|
||||
}
|
||||
file-resource bcm2708-rpi-b-plus.dtb {
|
||||
host-path = "${NERVES_SYSTEM}/images/bcm2708-rpi-b-plus.dtb"
|
||||
}
|
||||
file-resource w1-gpio-pullup.dtbo {
|
||||
host-path = "${NERVES_SYSTEM}/images/rpi-firmware/overlays/w1-gpio-pullup.dtbo"
|
||||
}
|
||||
file-resource dwc2.dtbo {
|
||||
host-path = "${NERVES_SYSTEM}/images/rpi-firmware/overlays/dwc2.dtbo"
|
||||
}
|
||||
file-resource pi3-disable-bt.dtbo {
|
||||
host-path = "${NERVES_SYSTEM}/images/rpi-firmware/overlays/pi3-disable-bt.dtbo"
|
||||
}
|
||||
|
||||
file-resource rootfs.img {
|
||||
host-path = ${ROOTFS}
|
||||
}
|
||||
|
||||
mbr mbr-a {
|
||||
partition 0 {
|
||||
block-offset = ${BOOT_PART_OFFSET}
|
||||
block-count = ${BOOT_PART_COUNT}
|
||||
type = 0xc # FAT32
|
||||
boot = true
|
||||
}
|
||||
partition 1 {
|
||||
block-offset = ${ROOTFS_A_PART_OFFSET}
|
||||
block-count = ${ROOTFS_A_PART_COUNT}
|
||||
type = 0x83 # Linux
|
||||
}
|
||||
partition 2 {
|
||||
block-offset = ${APP_PART_OFFSET}
|
||||
block-count = ${APP_PART_COUNT}
|
||||
type = 0xc # FAT32
|
||||
}
|
||||
# partition 3 is unused
|
||||
}
|
||||
|
||||
mbr mbr-b {
|
||||
partition 0 {
|
||||
block-offset = ${BOOT_PART_OFFSET}
|
||||
block-count = ${BOOT_PART_COUNT}
|
||||
type = 0xc # FAT32
|
||||
boot = true
|
||||
}
|
||||
partition 1 {
|
||||
block-offset = ${ROOTFS_B_PART_OFFSET}
|
||||
block-count = ${ROOTFS_B_PART_COUNT}
|
||||
type = 0x83 # Linux
|
||||
}
|
||||
partition 2 {
|
||||
block-offset = ${APP_PART_OFFSET}
|
||||
block-count = ${APP_PART_COUNT}
|
||||
type = 0xc # FAT32
|
||||
}
|
||||
# partition 3 is unused
|
||||
}
|
||||
|
||||
# This firmware task writes everything to the destination media
|
||||
task complete {
|
||||
# Only match if not mounted
|
||||
require-unmounted-destination = true
|
||||
|
||||
# Everything that gets written can be verified on the fly.
|
||||
# This speeds things up, since we don't care about detecting
|
||||
# errors before data gets written.
|
||||
verify-on-the-fly = true
|
||||
|
||||
on-init {
|
||||
mbr_write(mbr-a)
|
||||
|
||||
fat_mkfs(${BOOT_PART_OFFSET}, ${BOOT_PART_COUNT})
|
||||
fat_setlabel(${BOOT_PART_OFFSET}, "BOOT")
|
||||
fat_mkdir(${BOOT_PART_OFFSET}, "overlays")
|
||||
}
|
||||
|
||||
on-resource config.txt { fat_write(${BOOT_PART_OFFSET}, "config.txt") }
|
||||
on-resource cmdline.txt { fat_write(${BOOT_PART_OFFSET}, "cmdline.txt") }
|
||||
on-resource bootcode.bin { fat_write(${BOOT_PART_OFFSET}, "bootcode.bin") }
|
||||
on-resource start.elf { fat_write(${BOOT_PART_OFFSET}, "start.elf") }
|
||||
on-resource fixup.dat { fat_write(${BOOT_PART_OFFSET}, "fixup.dat") }
|
||||
on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage") }
|
||||
on-resource bcm2708-rpi-0-w.dtb { fat_write(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb") }
|
||||
on-resource bcm2708-rpi-b-plus.dtb { fat_write(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb") }
|
||||
on-resource w1-gpio-pullup.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo") }
|
||||
on-resource dwc2.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo") }
|
||||
on-resource pi3-disable-bt.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo") }
|
||||
|
||||
on-resource rootfs.img {
|
||||
# write to the first rootfs partition
|
||||
raw_write(${ROOTFS_A_PART_OFFSET})
|
||||
}
|
||||
|
||||
on-finish {
|
||||
# Initialize a big partition for application data
|
||||
# This is done last so that the boot partition can be written to completely
|
||||
# before the first write to this partition. Not skipping back and forth between
|
||||
# FAT filesystems saves a little time when programming the Flash.
|
||||
fat_mkfs(${APP_PART_OFFSET}, ${APP_PART_COUNT})
|
||||
fat_setlabel(${APP_PART_OFFSET}, "APPDATA")
|
||||
}
|
||||
}
|
||||
|
||||
task upgrade.a {
|
||||
# This task upgrades the A partition
|
||||
require-partition1-offset = ${ROOTFS_B_PART_OFFSET}
|
||||
|
||||
# Since the upgrade won't run until it has been finalized, it's ok
|
||||
# to write data as it is read.
|
||||
verify-on-the-fly = true
|
||||
|
||||
on-init {
|
||||
# Erase any old saved files from previous upgrades
|
||||
fat_rm(${BOOT_PART_OFFSET}, "zImage.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "config.txt.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "cmdline.txt.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bootcode.bin.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "start.elf.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "fixup.dat.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb.pre")
|
||||
|
||||
# Make the overlays directory in case it isn't already there.
|
||||
fat_mkdir(${BOOT_PART_OFFSET}, "overlays")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo.pre")
|
||||
}
|
||||
|
||||
# Write the new firmware and Linux images, but don't
|
||||
# commit them. That way if the user aborts midway, we
|
||||
# still are using the original firmware.
|
||||
on-resource config.txt { fat_write(${BOOT_PART_OFFSET}, "config.txt.new") }
|
||||
on-resource cmdline.txt { fat_write(${BOOT_PART_OFFSET}, "cmdline.txt.new") }
|
||||
on-resource bootcode.bin { fat_write(${BOOT_PART_OFFSET}, "bootcode.bin.new") }
|
||||
on-resource start.elf { fat_write(${BOOT_PART_OFFSET}, "start.elf.new") }
|
||||
on-resource fixup.dat { fat_write(${BOOT_PART_OFFSET}, "fixup.dat.new") }
|
||||
on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.new") }
|
||||
on-resource bcm2708-rpi-0-w.dtb { fat_write(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb.new") }
|
||||
on-resource bcm2708-rpi-b-plus.dtb { fat_write(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb.new") }
|
||||
on-resource w1-gpio-pullup.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new") }
|
||||
on-resource dwc2.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo.new") }
|
||||
on-resource pi3-disable-bt.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo.new") }
|
||||
|
||||
on-resource rootfs.img {
|
||||
# write to the first rootfs partition
|
||||
raw_write(${ROOTFS_A_PART_OFFSET})
|
||||
}
|
||||
|
||||
on-finish {
|
||||
# Switch over to boot the new firmware
|
||||
mbr_write(mbr-a)
|
||||
|
||||
fat_mv(${BOOT_PART_OFFSET}, "zImage", "zImage.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "config.txt", "config.txt.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "cmdline.txt", "cmdline.txt.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bootcode.bin", "bootcode.bin.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "start.elf", "start.elf.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "fixup.dat", "fixup.dat.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb", "bcm2708-rpi-0-w.dtb.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb", "bcm2708-rpi-b-plus.dtb.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo", "overlays/w1-gpio-pullup.dtbo.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo", "overlays/dwc2.dtbo.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo", "overlays/pi3-disable-bt.dtbo.pre")
|
||||
|
||||
fat_mv(${BOOT_PART_OFFSET}, "zImage.new", "zImage")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "config.txt.new", "config.txt")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "cmdline.txt.new", "cmdline.txt")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bootcode.bin.new", "bootcode.bin")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "start.elf.new", "start.elf")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "fixup.dat.new", "fixup.dat")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb.new", "bcm2708-rpi-0-w.dtb")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb.new", "bcm2708-rpi-b-plus.dtb")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new", "overlays/w1-gpio-pullup.dtbo")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo.new", "overlays/dwc2.dtbo")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo.new", "overlays/pi3-disable-bt.dtbo")
|
||||
}
|
||||
|
||||
on-error {
|
||||
# Clean up in case something goes wrong
|
||||
fat_rm(${BOOT_PART_OFFSET}, "zImage.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "config.txt.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "cmdline.txt.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bootcode.bin.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "start.elf.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "fixup.dat.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo.new")
|
||||
}
|
||||
}
|
||||
|
||||
task upgrade.b {
|
||||
# This task upgrades the B partition
|
||||
require-partition1-offset = ${ROOTFS_A_PART_OFFSET}
|
||||
|
||||
# Since the upgrade won't run until it has been finalized, it's ok
|
||||
# to write data as it is read.
|
||||
verify-on-the-fly = true
|
||||
|
||||
on-init {
|
||||
fat_rm(${BOOT_PART_OFFSET}, "zImage.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "config.txt.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "cmdline.txt.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bootcode.bin.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "start.elf.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "fixup.dat.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb.pre")
|
||||
|
||||
fat_mkdir(${BOOT_PART_OFFSET}, "overlays")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo.pre")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo.pre")
|
||||
}
|
||||
|
||||
on-resource config.txt { fat_write(${BOOT_PART_OFFSET}, "config.txt.new") }
|
||||
on-resource cmdline.txt { fat_write(${BOOT_PART_OFFSET}, "cmdline.txt.new") }
|
||||
on-resource bootcode.bin { fat_write(${BOOT_PART_OFFSET}, "bootcode.bin.new") }
|
||||
on-resource start.elf { fat_write(${BOOT_PART_OFFSET}, "start.elf.new") }
|
||||
on-resource fixup.dat { fat_write(${BOOT_PART_OFFSET}, "fixup.dat.new") }
|
||||
on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.new") }
|
||||
on-resource bcm2708-rpi-0-w.dtb { fat_write(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb.new") }
|
||||
on-resource bcm2708-rpi-b-plus.dtb { fat_write(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb.new") }
|
||||
on-resource w1-gpio-pullup.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new") }
|
||||
on-resource dwc2.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo.new") }
|
||||
on-resource pi3-disable-bt.dtbo { fat_write(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo.new") }
|
||||
|
||||
on-resource rootfs.img {
|
||||
# write to the first rootfs partition
|
||||
raw_write(${ROOTFS_B_PART_OFFSET})
|
||||
}
|
||||
|
||||
on-finish {
|
||||
# Switch over to boot the new firmware
|
||||
mbr_write(mbr-b)
|
||||
|
||||
fat_mv(${BOOT_PART_OFFSET}, "zImage", "zImage.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "config.txt", "config.txt.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "cmdline.txt", "cmdline.txt.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bootcode.bin", "bootcode.bin.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "start.elf", "start.elf.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "fixup.dat", "fixup.dat.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb", "bcm2708-rpi-0-w.dtb.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb", "bcm2708-rpi-b-plus.dtb.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo", "overlays/w1-gpio-pullup.dtbo.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo", "overlays/dwc2.dtbo.pre")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo", "overlays/pi3-disable-bt.dtbo.pre")
|
||||
|
||||
fat_mv(${BOOT_PART_OFFSET}, "zImage.new", "zImage")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "config.txt.new", "config.txt")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "cmdline.txt.new", "cmdline.txt")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bootcode.bin.new", "bootcode.bin")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "start.elf.new", "start.elf")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "fixup.dat.new", "fixup.dat")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb.new", "bcm2708-rpi-0-w.dtb")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb.new", "bcm2708-rpi-b-plus.dtb")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new", "overlays/w1-gpio-pullup.dtbo")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo.new", "overlays/dwc2.dtbo")
|
||||
fat_mv(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo.new", "overlays/pi3-disable-bt.dtbo")
|
||||
}
|
||||
|
||||
on-error {
|
||||
# Clean up in case something goes wrong
|
||||
fat_rm(${BOOT_PART_OFFSET}, "zImage.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "config.txt.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "cmdline.txt.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bootcode.bin.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "start.elf.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "fixup.dat.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bcm2708-rpi-0-w.dtb.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "bcm2708-rpi-b-plus.dtb.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/w1-gpio-pullup.dtbo.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/dwc2.dtbo.new")
|
||||
fat_rm(${BOOT_PART_OFFSET}, "overlays/pi3-disable-bt.dtbo.new")
|
||||
}
|
||||
}
|
|
@ -0,0 +1,257 @@
|
|||
# CONFIG_ARM_PATCH_PHYS_VIRT is not set
|
||||
CONFIG_PHYS_OFFSET=0
|
||||
CONFIG_LOCALVERSION="-v7"
|
||||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_BSD_PROCESS_ACCT=y
|
||||
CONFIG_BSD_PROCESS_ACCT_V3=y
|
||||
CONFIG_TASKSTATS=y
|
||||
CONFIG_TASK_DELAY_ACCT=y
|
||||
CONFIG_TASK_XACCT=y
|
||||
CONFIG_TASK_IO_ACCOUNTING=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_DEVICE=y
|
||||
CONFIG_CPUSETS=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_BLK_CGROUP=y
|
||||
CONFIG_NAMESPACES=y
|
||||
CONFIG_SCHED_AUTOGROUP=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
# CONFIG_RD_BZIP2 is not set
|
||||
# CONFIG_RD_LZMA is not set
|
||||
# CONFIG_RD_XZ is not set
|
||||
# CONFIG_RD_LZO is not set
|
||||
# CONFIG_RD_LZ4 is not set
|
||||
CONFIG_EMBEDDED=y
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_JUMP_LABEL=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
CONFIG_MODVERSIONS=y
|
||||
CONFIG_MODULE_SRCVERSION_ALL=y
|
||||
CONFIG_BLK_DEV_THROTTLING=y
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_MAC_PARTITION=y
|
||||
CONFIG_CFQ_GROUP_IOSCHED=y
|
||||
CONFIG_ARCH_BCM2708=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_AEABI=y
|
||||
CONFIG_OABI_COMPAT=y
|
||||
# CONFIG_CPU_SW_DOMAIN_PAN is not set
|
||||
CONFIG_CLEANCACHE=y
|
||||
CONFIG_FRONTSWAP=y
|
||||
CONFIG_CMA=y
|
||||
CONFIG_UACCESS_WITH_MEMCPY=y
|
||||
CONFIG_SECCOMP=y
|
||||
# CONFIG_ATAGS is not set
|
||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||
CONFIG_CMDLINE="console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=squashfs rootwait"
|
||||
CONFIG_CPU_FREQ=y
|
||||
# CONFIG_CPU_FREQ_STAT is not set
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
CONFIG_VFP=y
|
||||
# CONFIG_SUSPEND is not set
|
||||
CONFIG_PM=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_SYN_COOKIES=y
|
||||
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
|
||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||
# CONFIG_INET_LRO is not set
|
||||
# CONFIG_INET_DIAG is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_CFG80211=y
|
||||
CONFIG_CFG80211_INTERNAL_REGDB=y
|
||||
CONFIG_MAC80211=y
|
||||
CONFIG_RFKILL=y
|
||||
CONFIG_DEVTMPFS=y
|
||||
CONFIG_DEVTMPFS_MOUNT=y
|
||||
CONFIG_DMA_CMA=y
|
||||
CONFIG_CMA_SIZE_MBYTES=5
|
||||
CONFIG_OF_CONFIGFS=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_EEPROM_AT24=m
|
||||
CONFIG_SCSI=y
|
||||
# CONFIG_SCSI_PROC_FS is not set
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
# CONFIG_SCSI_LOWLEVEL is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
# CONFIG_ETHERNET is not set
|
||||
CONFIG_USB_USBNET=y
|
||||
# CONFIG_USB_NET_AX8817X is not set
|
||||
# CONFIG_USB_NET_AX88179_178A is not set
|
||||
# CONFIG_USB_NET_CDCETHER is not set
|
||||
# CONFIG_USB_NET_CDC_NCM is not set
|
||||
CONFIG_USB_NET_SMSC95XX=y
|
||||
# CONFIG_USB_NET_NET1080 is not set
|
||||
# CONFIG_USB_NET_CDC_SUBSET is not set
|
||||
# CONFIG_USB_NET_ZAURUS is not set
|
||||
CONFIG_BRCMFMAC=m
|
||||
CONFIG_RT2X00=y
|
||||
CONFIG_RT2800USB=y
|
||||
# CONFIG_RT2800USB_RT33XX is not set
|
||||
# CONFIG_RT2800USB_RT35XX is not set
|
||||
# CONFIG_RT2800USB_RT53XX=y
|
||||
# CONFIG_RTL8192CU=m
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
CONFIG_INPUT_EVDEV=m
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO is not set
|
||||
CONFIG_BRCM_CHAR_DRIVERS=y
|
||||
CONFIG_BCM_VC_CMA=y
|
||||
CONFIG_BCM_VCIO=y
|
||||
CONFIG_BCM_VC_SM=y
|
||||
CONFIG_BCM2835_DEVGPIOMEM=y
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
# CONFIG_DEVKMEM is not set
|
||||
CONFIG_SERIAL_AMBA_PL011=y
|
||||
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||
CONFIG_TTY_PRINTK=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_RAW_DRIVER=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_I2C_BCM2708=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SPI_BCM2835=y
|
||||
CONFIG_SPI_SPIDEV=y
|
||||
CONFIG_GPIO_SYSFS=y
|
||||
CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_STMPE=y
|
||||
CONFIG_W1=y
|
||||
CONFIG_W1_MASTER_GPIO=y
|
||||
CONFIG_W1_SLAVE_THERM=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_GPIO=y
|
||||
# CONFIG_HWMON is not set
|
||||
CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_BCM2835=y
|
||||
CONFIG_WATCHDOG=y
|
||||
CONFIG_BCM2835_WDT=m
|
||||
CONFIG_MFD_STMPE=y
|
||||
CONFIG_STMPE_SPI=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_BCM2708=y
|
||||
CONFIG_FB_RPISENSE=m
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_LOGO=y
|
||||
# CONFIG_LOGO_LINUX_MONO is not set
|
||||
# CONFIG_LOGO_LINUX_VGA16 is not set
|
||||
CONFIG_SOUND=y
|
||||
CONFIG_SND=m
|
||||
CONFIG_SND_SEQUENCER=m
|
||||
CONFIG_SND_SEQ_DUMMY=m
|
||||
CONFIG_SND_MIXER_OSS=m
|
||||
CONFIG_SND_PCM_OSS=m
|
||||
CONFIG_SND_BCM2835=m
|
||||
CONFIG_SND_SOC=m
|
||||
CONFIG_SND_BCM2835_SOC_I2S=m
|
||||
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m
|
||||
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m
|
||||
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m
|
||||
CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m
|
||||
CONFIG_SND_BCM2708_SOC_RPI_DAC=m
|
||||
CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
|
||||
CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m
|
||||
CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m
|
||||
CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
|
||||
CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
|
||||
CONFIG_SND_SOC_ADAU1701=m
|
||||
CONFIG_SND_SOC_WM8804_I2C=m
|
||||
CONFIG_SND_SIMPLE_CARD=m
|
||||
CONFIG_SOUND_PRIME=m
|
||||
CONFIG_HIDRAW=y
|
||||
CONFIG_HID_APPLE=y
|
||||
CONFIG_HID_PID=y
|
||||
CONFIG_USB_HIDDEV=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
|
||||
CONFIG_USB_ACM=y
|
||||
CONFIG_USB_PRINTER=m
|
||||
CONFIG_USB_WDM=m
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_SERIAL=y
|
||||
CONFIG_USB_SERIAL_FTDI_SIO=y
|
||||
CONFIG_USB_DWC2=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_CDC_COMPOSITE=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BLOCK_MINORS=32
|
||||
CONFIG_MMC_BCM2835=y
|
||||
CONFIG_MMC_BCM2835_DMA=y
|
||||
CONFIG_MMC_BCM2835_SDHOST=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
CONFIG_NEW_LEDS=y
|
||||
CONFIG_LEDS_CLASS=y
|
||||
CONFIG_LEDS_GPIO=y
|
||||
CONFIG_LEDS_TRIGGERS=y
|
||||
CONFIG_LEDS_TRIGGER_TIMER=y
|
||||
CONFIG_LEDS_TRIGGER_ONESHOT=y
|
||||
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
|
||||
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
|
||||
CONFIG_LEDS_TRIGGER_CPU=y
|
||||
CONFIG_LEDS_TRIGGER_GPIO=y
|
||||
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
|
||||
CONFIG_LEDS_TRIGGER_TRANSIENT=y
|
||||
CONFIG_LEDS_TRIGGER_CAMERA=y
|
||||
CONFIG_LEDS_TRIGGER_INPUT=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
# CONFIG_RTC_HCTOSYS is not set
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_BCM2835=y
|
||||
CONFIG_DMA_BCM2708=y
|
||||
CONFIG_UIO=m
|
||||
CONFIG_UIO_PDRV_GENIRQ=m
|
||||
CONFIG_STAGING=y
|
||||
CONFIG_R8712U=y
|
||||
CONFIG_STAGING_MEDIA=y
|
||||
CONFIG_MAILBOX=y
|
||||
CONFIG_BCM2835_MBOX=y
|
||||
# CONFIG_IOMMU_SUPPORT is not set
|
||||
CONFIG_RASPBERRYPI_POWER=y
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_BCM2835=m
|
||||
CONFIG_RASPBERRYPI_FIRMWARE=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_FANOTIFY=y
|
||||
CONFIG_MSDOS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_SQUASHFS=y
|
||||
# CONFIG_NETWORK_FILESYSTEMS is not set
|
||||
CONFIG_NLS_DEFAULT="utf8"
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_CODEPAGE_850=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_UTF8=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_BOOT_PRINTK_DELAY=y
|
||||
CONFIG_DEBUG_MEMORY_INIT=y
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
# CONFIG_DEBUG_PREEMPT is not set
|
||||
CONFIG_STACKTRACE=y
|
||||
# CONFIG_FTRACE is not set
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
CONFIG_CRC_ITU_T=m
|
||||
CONFIG_CRC7=m
|
|
@ -0,0 +1,26 @@
|
|||
defmodule NervesSystemRpi.Mixfile do
|
||||
use Mix.Project
|
||||
|
||||
@version Path.join([__DIR__, "..", "..", "VERSION"])
|
||||
|> File.read!
|
||||
|> String.strip
|
||||
|
||||
def project do
|
||||
[app: :nerves_system_rpi0w,
|
||||
version: @version,
|
||||
elixir: "~> 1.3",
|
||||
compilers: Mix.compilers ++ [:nerves_package],
|
||||
deps: deps(),
|
||||
aliases: ["deps.precompile": ["nerves.env", "deps.precompile"]]]
|
||||
end
|
||||
|
||||
def application do
|
||||
[]
|
||||
end
|
||||
|
||||
defp deps do
|
||||
[{:nerves, "~> 0.5.1", runtime: false },
|
||||
{:nerves_system_br, github: "tmecklem/nerves_system_br", branch: "master", runtime: false},
|
||||
{:nerves_toolchain_armv6_rpi_linux_gnueabi, "~> 0.10.0", runtime: false}]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
%{"distillery": {:hex, :distillery, "1.3.0", "2145a0a2195df928d276d96fafbf93380d29e8c54156711a3baf0030ce00943b", [:mix], []},
|
||||
"nerves": {:hex, :nerves, "0.5.1", "a55d73752e8f271c7aca5fbe47747f07d0e7760b5e858e7f8da17ab06287f49c", [:mix], [{:distillery, "~> 1.0", [hex: :distillery, optional: false]}]},
|
||||
"nerves_system_br": {:git, "https://github.com/tmecklem/nerves_system_br.git", "b4297e361bb8ecb3abb6abdd49e52faa6350af51", [branch: "master"]},
|
||||
"nerves_toolchain_armv6_rpi_linux_gnueabi": {:hex, :nerves_toolchain_armv6_rpi_linux_gnueabi, "0.10.0", "a730667fb22710270d3e9fdab8ce7230381c424f65b0381feb693829bc460f80", [:mix], [{:nerves, "~> 0.4", [hex: :nerves, optional: false]}, {:nerves_toolchain_ctng, "~> 0.9", [hex: :nerves_toolchain_ctng, optional: false]}]},
|
||||
"nerves_toolchain_ctng": {:hex, :nerves_toolchain_ctng, "0.9.0", "825b2b5bbacc3ad20c8513baafd44978616d5b451e6e052cdb727be81e7cdcac", [:mix], []}}
|
|
@ -0,0 +1,29 @@
|
|||
use Mix.Config
|
||||
|
||||
version = Path.join([__DIR__, "..", "..", "VERSION"])
|
||||
|> File.read!
|
||||
|> String.strip
|
||||
|
||||
pkg = :nerves_system_rpi0w
|
||||
nerves_target = "rpi0w"
|
||||
|
||||
config pkg, :nerves_env,
|
||||
type: :system,
|
||||
version: version,
|
||||
compiler: :nerves_package,
|
||||
artifact_url: [
|
||||
"https://github.com/FarmBot/farmbot_os/releases/download/v#{version}/farmbot.rootfs-#{nerves_target}-#{version}.tar.gz"
|
||||
],
|
||||
platform: Nerves.System.BR,
|
||||
platform_config: [
|
||||
defconfig: "nerves_defconfig",
|
||||
],
|
||||
checksum: [
|
||||
"nerves_defconfig",
|
||||
"rootfs-additions",
|
||||
"linux-4.4.defconfig",
|
||||
"fwup.conf",
|
||||
"cmdline.txt",
|
||||
"config.txt",
|
||||
"post-createfs.sh"
|
||||
]
|
|
@ -0,0 +1,91 @@
|
|||
BR2_arm=y
|
||||
BR2_arm1176jzf_s=y
|
||||
BR2_ARM_EABI=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/nerves-project/toolchains/releases/download/v0.10.0/nerves_toolchain_armv6_rpi_linux_gnueabi-0.10.0.linux-x86_64.tar.xz"
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="armv6-rpi-linux-gnueabi"
|
||||
BR2_TOOLCHAIN_EXTERNAL_GCC_5=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_12=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME=""
|
||||
BR2_TARGET_GENERIC_ISSUE=""
|
||||
BR2_INIT_NONE=y
|
||||
# BR2_TARGET_GENERIC_GETTY is not set
|
||||
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
|
||||
BR2_ENABLE_LOCALE_WHITELIST="locale-archive"
|
||||
BR2_GENERATE_LOCALE="en_US.UTF-8"
|
||||
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/rootfs-additions ${NERVES_DEFCONFIG_DIR}/rootfs-additions"
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/post-build.sh"
|
||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="${NERVES_DEFCONFIG_DIR}/post-createfs.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_GIT=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux.git"
|
||||
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="04c8e47067d4873c584395e5cb260b4f170a99ea"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${NERVES_DEFCONFIG_DIR}/linux-4.4.defconfig"
|
||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-0-w bcm2708-rpi-b-plus"
|
||||
BR2_LINUX_KERNEL_EXT_KERNEL_WIRELESS_REGDB=y
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/busybox-1.22.config"
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="${NERVES_DEFCONFIG_DIR}/busybox_defconfig"
|
||||
BR2_PACKAGE_E2FSPROGS=y
|
||||
# BR2_PACKAGE_E2FSPROGS_BADBLOCKS is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_CHATTR is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_DUMPE2FS is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_E2FREEFRAG is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_E2FSCK is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_E2LABEL is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_E2UNDO is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_FILEFRAG is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_FSCK is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_LOGSAVE is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_LSATTR is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_MKLOSTFOUND is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_TUNE2FS is not set
|
||||
# BR2_PACKAGE_E2FSPROGS_UUIDGEN is not set
|
||||
BR2_PACKAGE_FWUP=y
|
||||
BR2_PACKAGE_FSWEBCAM=y
|
||||
BR2_PACKAGE_RPI_FIRMWARE=y
|
||||
BR2_PACKAGE_RPI_FIRMWARE_X=y
|
||||
BR2_PACKAGE_AVRDUDE=y
|
||||
BR2_PACKAGE_RPI_USERLAND=y
|
||||
BR2_PACKAGE_ERLANG_SMP=y
|
||||
BR2_PACKAGE_PYTHON=y
|
||||
BR2_PACKAGE_PYTHON_CURSES=y
|
||||
BR2_PACKAGE_PYTHON_READLINE=y
|
||||
BR2_PACKAGE_PYTHON_SSL=y
|
||||
BR2_PACKAGE_PYTHON_NUMPY=y
|
||||
BR2_PACKAGE_PYTHON_REQUESTS=y
|
||||
BR2_PACKAGE_REDIS=y
|
||||
BR2_PACKAGE_OPENCV=y
|
||||
BR2_PACKAGE_OPENCV_LIB_PYTHON=y
|
||||
BR2_PACKAGE_OPENCV_WITH_JASPER=y
|
||||
BR2_PACKAGE_OPENCV_WITH_JPEG=y
|
||||
BR2_PACKAGE_OPENCV_WITH_PNG=y
|
||||
BR2_PACKAGE_OPENCV_WITH_V4L=y
|
||||
BR2_PACKAGE_LIBV4L=y
|
||||
BR2_PACKAGE_LIBV4L_UTILS=y
|
||||
BR2_PACKAGE_LIBMNL=y
|
||||
BR2_PACKAGE_DNSMASQ=y
|
||||
BR2_PACKAGE_DROPBEAR=y
|
||||
BR2_PACKAGE_HOSTAPD=y
|
||||
BR2_PACKAGE_IW=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG=y
|
||||
BR2_PACKAGE_INOTIFY_TOOLS=y
|
||||
BR2_PACKAGE_MRUBY=y
|
||||
BR2_PACKAGE_PYTHON_PICAMERA=y
|
||||
BR2_PACKAGE_PYTHON_REDISPY=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
BR2_NERVES_SYSTEM_NAME="nerves_system_rpi0w"
|
||||
BR2_NERVES_ADDITIONAL_IMAGE_FILES="$(NERVES_DEFCONFIG_DIR)/fwup.conf ${NERVES_DEFCONFIG_DIR}/cmdline.txt ${NERVES_DEFCONFIG_DIR}/config.txt"
|
||||
BR2_PACKAGE_BOARDID=y
|
||||
BR2_PACKAGE_ERLANG_HISTORY=y
|
||||
BR2_PACKAGE_NERVES_CONFIG=y
|
||||
BR2_PACKAGE_NERVES_CONFIG_NO_ERLINIT_CONF=y
|
||||
BR2_PACKAGE_NERVES_CONFIG_APPS="crypto"
|
||||
BR2_PACKAGE_NERVES_CONFIG_SNAME="farmbot"
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
FWUP_CONFIG=$NERVES_DEFCONFIG_DIR/fwup.conf
|
||||
|
||||
# Run the common post-image processing for nerves
|
||||
$BR2_EXTERNAL_NERVES_PATH/board/nerves-common/post-createfs.sh $TARGET_DIR $FWUP_CONFIG
|
|
@ -0,0 +1,41 @@
|
|||
# Additional configuration for erlinit
|
||||
|
||||
# Turn on the debug prints
|
||||
#-v
|
||||
|
||||
# Specify the UART port that the shell should use.
|
||||
# -c tty1
|
||||
-c ttyAMA0
|
||||
|
||||
# If more than one tty are available, always warn if the user is looking at
|
||||
# the wrong one.
|
||||
--warn-unused-tty
|
||||
|
||||
# Use dtach to capture the iex session so that it can be redirected
|
||||
# to the app's GUI
|
||||
#-s "/usr/bin/dtach -N /tmp/iex_prompt"
|
||||
|
||||
# Specify the user and group IDs for the Erlang VM
|
||||
#--uid 100
|
||||
#--gid 200
|
||||
|
||||
# Uncomment to hang the board rather than rebooting when Erlang exits
|
||||
--hang-on-exit
|
||||
|
||||
# Optionally run a program if the Erlang VM exits
|
||||
#--run-on-exit /bin/sh
|
||||
|
||||
# Enable UTF-8 filename handling in Erlang and custom inet configuration
|
||||
-e LANG=en_US.UTF-8;LANGUAGE=en;ERL_INETRC=/etc/erl_inetrc
|
||||
|
||||
# Mount the application partition
|
||||
# See http://www.linuxfromscratch.org/lfs/view/6.3/chapter08/fstab.html about
|
||||
# ignoring warning the Linux kernel warning about using UTF8 with vfat.
|
||||
# -m /dev/mmcblk0p3:/root:vfat::
|
||||
|
||||
# Erlang release search path
|
||||
-r /srv/erlang
|
||||
|
||||
# Assign a unique hostname based on the board id
|
||||
-d "/usr/bin/boardid -b rpi -n 4"
|
||||
-n nerves-%.4s
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,66 @@
|
|||
# NVRAM file for BCM943430WLPTH
|
||||
# 2.4 GHz, 20 MHz BW mode
|
||||
|
||||
# The following parameter values are just placeholders, need to be updated.
|
||||
manfid=0x2d0
|
||||
prodid=0x0727
|
||||
vendid=0x14e4
|
||||
devid=0x43e2
|
||||
boardtype=0x0727
|
||||
boardrev=0x1101
|
||||
boardnum=22
|
||||
macaddr=00:90:4c:c5:12:38
|
||||
sromrev=11
|
||||
boardflags=0x00404201
|
||||
boardflags3=0x08000000
|
||||
xtalfreq=37400
|
||||
nocrc=1
|
||||
ag0=255
|
||||
aa2g=1
|
||||
ccode=ALL
|
||||
|
||||
pa0itssit=0x20
|
||||
extpagain2g=0
|
||||
#PA parameters for 2.4GHz, measured at CHIP OUTPUT
|
||||
pa2ga0=-168,7161,-820
|
||||
AvVmid_c0=0x0,0xc8
|
||||
cckpwroffset0=5
|
||||
|
||||
# PPR params
|
||||
maxp2ga0=84
|
||||
txpwrbckof=6
|
||||
cckbw202gpo=0
|
||||
legofdmbw202gpo=0x66111111
|
||||
mcsbw202gpo=0x77711111
|
||||
propbw202gpo=0xdd
|
||||
|
||||
# OFDM IIR :
|
||||
ofdmdigfilttype=18
|
||||
ofdmdigfilttypebe=18
|
||||
# PAPD mode:
|
||||
papdmode=1
|
||||
papdvalidtest=1
|
||||
pacalidx2g=42
|
||||
papdepsoffset=-22
|
||||
papdendidx=58
|
||||
|
||||
# LTECX flags
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0102
|
||||
ltecxfnsel=0x44
|
||||
ltecxgcigpio=0x01
|
||||
|
||||
il0macaddr=00:90:4c:c5:12:38
|
||||
wl0id=0x431b
|
||||
|
||||
deadman_to=0xffffffff
|
||||
# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
|
||||
muxenab=0x1
|
||||
# CLDO PWM voltage settings - 0x4 - 1.1 volt
|
||||
#cldo_pwm=0x4
|
||||
|
||||
#VCO freq 326.4MHz
|
||||
spurconfig=0x3
|
||||
|
||||
edonthd20l=-75
|
||||
edoffthd20ul=-80
|
Binary file not shown.
|
@ -0,0 +1,21 @@
|
|||
diff --git a/package/rpi-firmware/rpi-firmware.hash b/package/rpi-firmware/rpi-firmware.hash
|
||||
index 8161d7a..f6dd03a 100644
|
||||
--- a/package/rpi-firmware/rpi-firmware.hash
|
||||
+++ b/package/rpi-firmware/rpi-firmware.hash
|
||||
@@ -1,2 +1,2 @@
|
||||
# Locally computed
|
||||
-sha256 144de63ee1999155fc1ff597630f1a13f798e597e7c4d144b8b625fa774c1f9b rpi-firmware-7f8ac8dac0b80291cbf5e56580139034a0a42070.tar.gz
|
||||
+sha256 173c55441a78b5ce9cd7739318f71361b7569597e409c0e002c71e0fd6909481 rpi-firmware-b51046a2b2bb69771579a549d157205d9982f858.tar.gz
|
||||
diff --git a/package/rpi-firmware/rpi-firmware.mk b/package/rpi-firmware/rpi-firmware.mk
|
||||
index d2cd481..b73ef53 100644
|
||||
--- a/package/rpi-firmware/rpi-firmware.mk
|
||||
+++ b/package/rpi-firmware/rpi-firmware.mk
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
-RPI_FIRMWARE_VERSION = 7f8ac8dac0b80291cbf5e56580139034a0a42070
|
||||
+RPI_FIRMWARE_VERSION = b51046a2b2bb69771579a549d157205d9982f858
|
||||
RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION))
|
||||
RPI_FIRMWARE_LICENSE = BSD-3c
|
||||
RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom
|
|
@ -0,0 +1,21 @@
|
|||
diff --git a/package/rpi-userland/rpi-userland.hash b/package/rpi-userland/rpi-userland.hash
|
||||
index 24b6584..3e0dbfa 100644
|
||||
--- a/package/rpi-userland/rpi-userland.hash
|
||||
+++ b/package/rpi-userland/rpi-userland.hash
|
||||
@@ -1,2 +1,2 @@
|
||||
# Locally computed
|
||||
-sha256 f229c29ceae611101bf4716b112251b2f2a33cfbb6636d736deda4e1314bb9d9 rpi-userland-c139376e9bc6fbd93f777c7fc3c7d7cf2cc35122.tar.gz
|
||||
+sha256 9f7caa5fee77cef034551b23a7c12d78792ebd2feca7bcbc677da4daf2a98cf7 rpi-userland-f410ec051a3724934e3671315474d4b81424b0ef.tar.gz
|
||||
diff --git a/package/rpi-userland/rpi-userland.mk b/package/rpi-userland/rpi-userland.mk
|
||||
index 4e3b4ec..aec721d 100644
|
||||
--- a/package/rpi-userland/rpi-userland.mk
|
||||
+++ b/package/rpi-userland/rpi-userland.mk
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
-RPI_USERLAND_VERSION = c139376e9bc6fbd93f777c7fc3c7d7cf2cc35122
|
||||
+RPI_USERLAND_VERSION = f410ec051a3724934e3671315474d4b81424b0ef
|
||||
RPI_USERLAND_SITE = $(call github,raspberrypi,userland,$(RPI_USERLAND_VERSION))
|
||||
RPI_USERLAND_LICENSE = BSD-3c
|
||||
RPI_USERLAND_LICENSE_FILES = LICENCE
|
|
@ -10,5 +10,9 @@ else
|
|||
git clone $NERVES_SYSTEM_BR_GIT nerves/nerves_system_br
|
||||
fi
|
||||
|
||||
cp buildroot_patches/*.patch nerves/nerves_system_br/patches
|
||||
nerves/nerves_system_br/create-build.sh nerves/nerves_system_$SYSTEM/nerves_defconfig nerves/NERVES_SYSTEM_$SYSTEM
|
||||
if [ ! -f nerves/nerves_system_br/buildroot/.farmbot_applied_patches_list ]; then
|
||||
echo "Applying FarmbotOS patches"
|
||||
nerves/nerves_system_br/buildroot/support/scripts/apply-patches.sh nerves/nerves_system_br/buildroot patches
|
||||
cp nerves/nerves_system_br/buildroot/.applied_patches_list nerves/nerves_system_br/buildroot/.farmbot_applied_patches_list
|
||||
fi
|
||||
|
|
|
@ -23,7 +23,9 @@ defmodule Farmbot.Serial.HandlerTest do
|
|||
nil ->
|
||||
Process.sleep(10)
|
||||
wait_for_serial_available()
|
||||
_ -> Farmbot.CeleryScript.Command.home(%{axis: "all"}, [])
|
||||
_ ->
|
||||
Farmbot.CeleryScript.Command.home(%{axis: "all"}, [])
|
||||
Process.sleep(10)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue