Commit Graph

42 Commits (staging)

Author SHA1 Message Date
Rick Carlino 471b9f2543 Remove references to old `reset` logic. TODO: Add new reset system based on `firmware_hardware` rather than platform 2020-05-03 09:07:30 -05:00
Rick Carlino 20cf44ddad === qa/v10.0.0-rc1 2020-05-01 14:09:33 -05:00
Rick Carlino 53f28daefe Finish testing AutoSyncAssetHandler 2020-03-31 14:45:14 -05:00
Rick Carlino 33b0947c7a Set `async` to `false` in a few missing places 2020-03-30 17:43:29 -05:00
Rick Carlino 9a5b927953 FarmbotExt: Dont supervise anything in :test 2020-03-26 17:06:55 -05:00
Rick Carlino 128ed8ec43 No supervisor children when in test env for FarmbotExt.Bootstrap.Supervisor 2020-03-26 16:30:02 -05:00
Rick Carlino 06926b05ce Dont start process tree in test env. Silence numerous logs. 2020-03-10 12:08:19 -05:00
Rick Carlino 5ef5bb7b91 Silence supervisor crash reports in test suite 2020-03-09 10:59:37 -05:00
Rick Carlino 844d521537 FAILING, minor formatting / config issues 2020-01-24 09:36:56 -06:00
Rick Carlino 7e5738f883 [UNSTABLE] 42.1% Partial removal of :mox, some tests failing though 2020-01-22 11:41:43 -06:00
Connor Rigby d65a54223c Fix Firmware flashing on boot on express boards 2019-12-26 10:37:23 -08:00
Connor Rigby a6f365b4c0
Implement public_key worker 2019-09-13 16:03:30 -07:00
Connor Rigby 1900bdba57
Allow firmware to be open/flashed infinity times
* add `infinity` as an option for `fbos_config_worker` and
`firmware_open_task`
* reenable uevent montior flashing/opening firmware
2019-09-13 16:03:26 -07:00
Connor Rigby 3d9be8d902
Silence repeating firmware open log 2019-09-13 16:03:26 -07:00
connor rigby 712256a1a3
Implement task for opening the firmware
Adds a new flag for `firmware_needs_open` and a task that polls that
value with a bit of state to open the firmware tty
2019-09-13 16:03:25 -07:00
Connor Rigby ce51edeb99
Revert Alert/Enigma system
* Revert 9cc461b512
* Revert 7309a19fe7
* Revert 7fd82d3a58
* Revert 890ddfbd86
* Revert 839ce3e470
* Revert 68cc8e6471
* Revert 3991a2c516
* Revert db8da31018
2019-09-13 16:03:25 -07:00
Connor Rigby 26578a7ae2
Update `mox` to be used correctly.
I previously misunderstood how the black magic of mox actually works.
This updates `farmbot_ext` to not require setting excess data in every
config.exs entry. Also removes calls to `Application.get_env/2`
2019-09-13 16:03:22 -07:00
Rick Carlino 8c7d6f6608
AutoSyncChannel Testing: Device, `auto_sync = false` (#714)
* Test auto_sync ignore case

* Test case: auto_sync is disabled.

* Test for auto_sync of Device assets
2019-09-13 16:03:21 -07:00
Rick Carlino 4248c93962
Add mox and excoveralls
* and tests for AutoSyncChannel
* add tests for auto sync preloader
2019-09-13 16:03:20 -07:00
connor rigby dd05ffc40e
Quick example on how to use mox 2019-09-13 16:03:20 -07:00
Connor Rigby f893611dd0
Consolidate NervesHub logic and implementation 2019-09-13 16:03:20 -07:00
Connor Rigby 199e1edb97
Rename Enigma to Alert 2019-09-13 16:03:19 -07:00
Rick Carlino 399ddf50c8
PersistentRegimen => RegimenInstance 2019-09-13 16:03:17 -07:00
Rick Carlino 295cb45d49
Transport => Channel 2019-09-13 16:03:17 -07:00
Connor Rigby d2c5a1a72b
Add enigma_worker config to farmbot_ext and frambot_os 2019-09-13 16:03:16 -07:00
connor rigby 218b33785d
Fix more namespaces 2019-09-13 16:03:16 -07:00
Connor Rigby 08cec79db6
Rename FarmbotExt Namespace 2019-09-13 16:03:16 -07:00
Connor Rigby 4114e26804
Implement new CeleryScript Runtime environment.
This is obviously a rather large change warranting an essay describing
it.

A Brief overview
Basically the old implementation had quite a few down sides preventing
it from really working as intended, especially with the addition of the
variables feature. Here is the shortlist of things that needed
addressing:

* No scoping between sequences.
What this essentially means is that a sequence that executes another
sequence is unable to add data to the calle. This is important for using
Variables.

* Error recovery
certain nodes have a high likelyhood of failing such as anything that
interfaces the firmware. Much focus was spent ensuring that errors would
be recoverable when desired.

* Complexity of control flow asts versus action asts.
Nodes such as `if` will always work in the same way regardless of the
state of the rest of the system meaning there is no reason for it to
have a special implementation per environment. on the other hand
`move_absolute` is bound to a specific part of the system. Seperating
these concerns allows for better testing of each piece independently.

A More In Depth overview
The core of this change resolves around 1 really big change resulting in
many more small changes. This change is the CeleryScript `compiler`. The
TLDR of this system is that now CeleryScript ASTs are deterministicly
compiled to Elixir's AST and executed. Doing this has some big benifits
as described below.

1) CeleryScript "runtime" environment is now much simpiler in favor of a somewhat
complex "compile time" environment. Basically instead of EVERY single
CeleryScript AST having a custom runtime implementation, only a subset
of ASTs that require external services such as the Firmware, Database,
HTTP, etc require having a runtime implementation. This subset of ASTs
are called `SysCalls`. Also the runtime implementations are compiled to
a single function call that can be implemented instead of needing to
have a contextual environment and making decisions at runtime to
evaluate variables and the like.

2) Static analysis is now possible. This means an incorrectly crafted
sequence can be validated at compile time rather than getting half way
through a sequence before finding the error.

3) Having the "external services" separated leads to better plugability.
There is now a behaviour to be implemented for the subset of syscalls
that are system specific.
2019-09-13 16:03:15 -07:00
connor rigby d0edb1e19e
Update to Elixir 1.8!! 2019-09-13 16:03:15 -07:00
Connor Rigby bb7306dabc
Work towards refactoring Farmware
* Add bot state serializer to filesystem
* Add helper to turn ecto types into TSC types
* Add module to extract ecto changes as a list of instructions
* Add new transport for bot_state_ng
* Update CSVM Runtime to poll until `await` can complete
2019-09-13 16:03:15 -07:00
Connor Rigby 8f3abc335a
Update NervesHub logs and abstractions 2019-09-13 16:03:14 -07:00
Connor Rigby 7cde2b2390
Change to ElixirCircuits. 2019-09-13 16:03:14 -07:00
Connor Rigby 56f6749595
Nerves hub pt2 (#654)
* Rework Networking

* Rework Configurator

* Fix NervesHub not connecting
2019-09-13 16:03:14 -07:00
Connor Rigby 6e2a018598
Implement Regimens again, add tests and test support
* This also includes changes to all Farmbot API Assets adding
  a `monitor: :boolean` field. This allows tests to be run
  causing minimal side effects on the rest of the systems.
2019-09-13 16:03:14 -07:00
Connor Rigby f2b8abd692
Botstate refactor (#645)
* Refactor PinBindings

* Refactor logging to not require Farmbot.Registry

* Fix AMQP bot_state_transport and log_transport

* Update to use floats everywhere

* Refactor Farmbot.Firmware

* Write Firmware Tests

* dipping into FarmbotOS finally

* Cleanup peripheral_worker error message

* Implement remaining CeleryScript RPCs

* Refactor job progress

* Image Upload status notifications updates

* Fix compiler warnings and things

* Update Firmware submodule

* Fix FarmbotEXT tests
2019-09-13 16:03:14 -07:00
Connor Rigby 3b8f8d591f
Config + dead code cleanup 2019-09-13 16:03:14 -07:00
Connor Rigby b3f1369a77
Re-implement image uploading 2019-09-13 16:03:14 -07:00
Connor Rigby 869d1ad1a4
Progress on refactoring data syncing (#643) 2019-09-13 16:03:13 -07:00
Connor Rigby 0d569301f1
Replace httpoison 2019-09-13 16:03:13 -07:00
Connor Rigby bdb11b2ea8
Lots of work on Farmware 2019-09-13 16:03:13 -07:00
connor rigby 358a1e209e
Update AMQP workers to reconnect on a 4 second timer
Pull in new csvm implementation

Update circleci config

Implement syncing and write_pin

add migration for syncing

add saftey to write_pin

Implement read_pin

Implement set_servo_angle

Implement more ast nodes

Implement e-stop and e-unlock

Fix a bunch of stuf

Fix missing assets on boot/init

It actually works

Rename csvm -> farmbot_celery_script; fix initial sync/dispatch

Fix a bunch of small bugs

Identify problem

Fix Sqlite bug and increase performance by 10 times!!

Fix sequences inside of sequences
2019-09-13 16:03:13 -07:00
connor rigby cf1ef23b17
Start splitting Farmbot Application Poncho Style
This begins splitting the monolithic Farmbot application
into separate, independent OTP applicatoins.
2019-09-13 16:03:13 -07:00