Commit Graph

192 Commits (staging)

Author SHA1 Message Date
Rick Carlino 1e37e5cf5a Add Mimic to farmbot_core tests 2020-01-23 17:34:36 -06:00
Rick Carlino fc353c64d5 Formatting updates 2020-01-23 16:40:19 -06:00
Rick Carlino 3316baad82 Fix tests ✔️ 2020-01-23 16:31:43 -06:00
Rick Carlino ce4d3f1688 WIP: Fix FarmbotCeleryScriptTest 2020-01-23 16:21:09 -06:00
Rick Carlino d6ab57425b TODO: Fix FarmbotCeleryScript.SchedulerTest 2020-01-23 15:37:09 -06:00
Rick Carlino 9ba060c0f1 Fix set_servo_angle, get_sequence 2020-01-23 15:06:04 -06:00
Rick Carlino e1e8adfa00 Fix set_servo_angle, get_sequence 2020-01-23 15:02:15 -06:00
Rick Carlino f2790ff886 Fix read/write pin sys call tests 2020-01-23 14:46:23 -06:00
Rick Carlino e4af444ece TODO: Fix FarmbotCeleryScript.SysCallsTest. 50 tests, 11 failures 2020-01-22 21:03:46 -06:00
Rick Carlino 0c22021d66 TODO: Fix FarmbotCeleryScript.SysCallsTest. 49 tests, 13 failures 2020-01-22 20:51:48 -06:00
Rick Carlino ac7bf38be9 Fix SysCalls.point tests 2020-01-22 20:27:55 -06:00
Rick Carlino c9206ab484 TODO: Fix FarmbotCeleryScript.SysCallsTest. 47 tests, 16 failures 2020-01-22 19:56:29 -06:00
Rick Carlino 2c45bd3057 Fix FarmbotCeleryScript.CompilerGroupsTest 2020-01-22 19:23:23 -06:00
Rick Carlino 2f7685c077 Update FarmbotCeleryScriptTest to use Mimic 2020-01-22 17:07:22 -06:00
Rick Carlino 99b5f3436b 👏 Add `mimic` package to test suite 2020-01-22 09:21:05 -06:00
Rick Carlino 5a449af74f Minor cleanup 2020-01-19 10:32:00 -06:00
Rick Carlino a2647f7fe2 (51.1%, STABLE). "good enough" tests for Sequence.sequnce/2 2020-01-19 10:28:37 -06:00
Rick Carlino cc1a97d886 (50.8%, STABLE). Needs better assertions 2020-01-19 09:19:08 -06:00
Rick Carlino eba61d34f8 (49.2%, FAILING) Move groups stuff into its own test for now. 2020-01-19 09:01:30 -06:00
Rick Carlino 88ace0db19 Simulate :get_point_group, remove dead code 2020-01-18 14:06:39 -06:00
Rick Carlino 4ce80f0431 WIP: Still failing 2020-01-17 18:01:28 -06:00
Rick Carlino ee010874f0 TODO: Fix failing test 2020-01-17 16:59:04 -06:00
Rick Carlino a8c4887841 Run mix format 2020-01-17 16:02:00 -06:00
Rick Carlino 26d31012fb Test: get_point_group test success case 2020-01-17 15:40:25 -06:00
Rick Carlino 12c55fb60f Test: PointGroup test failure case 2020-01-17 15:28:13 -06:00
Rick Carlino 1c00c543e3 Rename some test helpers 2020-01-17 13:42:58 -06:00
Rick Carlino 5722bea421 Huge formatting update (sorry) 2020-01-17 09:58:53 -06:00
Rick Carlino a13e6c5832 Minor updates before branch cleanup 2020-01-17 09:53:15 -06:00
Rick Carlino 845e69ce7e
Re-enable set_servo_angle
* set_servo_angle works.
* Tests for set_servo_angle in  FarmbotCeleryScript.Syscalls
2019-12-27 11:45:26 -06:00
Rick Carlino d9fddde3e7 Add factory reset when device.needs_reset field changes 2019-12-19 13:18:34 -08:00
Connor Rigby 6cb47d43aa Add docs for generating app specific docs 2019-12-18 13:01:20 -08:00
Connor Rigby 7e90421f14
Update docs for variable sanitizer 2019-12-17 14:42:08 -08:00
Connor Rigby f78b146bca Delete old file 2019-12-17 14:25:20 -08:00
Rick Carlino e1cbfa26f5 Dep updates for farmbot_celery_script 2019-12-16 13:03:25 -08:00
Connor Rigby 477a179ff9 Add log for executing `take-photo` 2019-11-14 10:36:49 -08:00
Connor Rigby 685177046b Set peripheral IO mode before read/writing 2019-11-05 13:09:40 -08:00
Connor Rigby f50c945232
Add new sequence logs to execute block 2019-10-31 14:40:33 -07:00
Connor Rigby 2eb94818a6
Add logs to sequence iteration 2019-10-31 14:40:32 -07:00
Connor Rigby 9009ff6329 Update deps
* `tesla` 1.3.0
* `hackney` 1.15.2
* `tzdata` 1.0.2
* `amqp` ~> 1.3
* `circuits_gpio` 0.4.2
* `circuits_uart` 1.3.2
* `toolshed` 0.2.11
2019-10-31 14:00:08 -07:00
Connor Rigby 131a5f5e8d Add UUID to telemetry payload 2019-10-31 14:00:08 -07:00
Connor Rigby 1539f45014 Add new farmbot_telemetry application 2019-10-31 14:00:08 -07:00
Connor Rigby 29bff57501 Fix missing command for calibrate and home 2019-10-24 14:03:11 -07:00
Connor Rigby c82619e470 Add referential integrity checker for point_groups
This will cause point_group updates to reindex any
running processes using those assets
2019-10-22 14:19:32 -07:00
connor rigby 30d035fb88 Fix compiler tests 2019-10-22 14:19:32 -07:00
connor rigby 433af34e6a Add ability to use loops in farm_events and regimens 2019-10-22 14:19:32 -07:00
Connor Rigby a5022eed27 Factor out CeleryScript compiler into multiple modules
This should hopefully allow for easier to follow error messages as it
removes all elixir macro "magic"
2019-10-22 14:19:32 -07:00
Connor Rigby 1ff2a7d153 Implement `every_point` and `point_group` Celery nodes 2019-10-22 14:19:32 -07:00
Connor Rigby 96574f2033 Implement `resource_update` celery node 2019-09-24 12:47:08 -07:00
Connor Rigby 8a816ba1f4
Change if and read_pin to function the same as v7
this prevents the possibility of reading a sensor and it changing
by the time an if statement is executed
2019-09-13 16:03:34 -07:00
Gabriel Burnworth 85465f3044
add missing op log cases 2019-09-13 16:03:34 -07:00
Connor Rigby 46d259202c
Add sequence start/complete logs to regimen and farm_events 2019-09-13 16:03:34 -07:00
Connor Rigby d22a390505
Update `if` logs to have more contextual information 2019-09-13 16:03:33 -07:00
Connor Rigby cf2877c76e
Ensure firmware/rpc logs always dispatch 2019-09-13 16:03:33 -07:00
Connor Rigby f400b2746f
Add new RPC for `toggle_pin`
This was previously implemented as a "macro" that just expanded
`toggle_pin` to a series of `read_pin` -> `write_pin` -> `read_pin` this
lead to three logs instead of just one. The implementation is still
mostly the same, but now there is less logging.

Also factored all pin control into it's own module
2019-09-13 16:03:32 -07:00
Connor Rigby 5373849f51
Update dependencies
* `elixir_make`
* `muontrap`
* `vintage_net`
* `busybox`
* `mdns_lite`
* `nerves_hub`
* `plug`
2019-09-13 16:03:32 -07:00
Connor Rigby 70c9035769
Fix non-string errors causing crashes 2019-09-13 16:03:32 -07:00
Connor Rigby 209ded96cb
Add Lua helpers for updating and getting resources 2019-09-13 16:03:32 -07:00
Connor Rigby a242cce830
Add new log type for assertion logs 2019-09-13 16:03:32 -07:00
Connor Rigby f756302fe6
Add option to continue and not recover from assertion 2019-09-13 16:03:32 -07:00
Connor Rigby 528acd119c
Fix execute block inside lua expression block 2019-09-13 16:03:32 -07:00
Gabriel Burnworth 2619586102
Change `update_farmware` fields to match corpus 2019-09-13 16:03:32 -07:00
Connor Rigby d3081fcc56
Change field names of `assert` to match corpus 2019-09-13 16:03:31 -07:00
Connor Rigby 7e1ceaf7be
Implement new AST: `assert`.
This is a new AST that will allow executing a
simple expression and conditionally pass/fail
and cleanup when it completes.
2019-09-13 16:03:31 -07:00
Connor Rigby a04ddf0159
Fix set_pin_io mode 2019-09-13 16:03:31 -07:00
Connor Rigby fcadeebe6e
Add `update_farmware` rpc back 2019-09-13 16:03:31 -07:00
connor rigby 3231651b5f
Add :set_pin_io_mode rpc back to known rpcs 2019-09-13 16:03:30 -07:00
Connor Rigby a6efc9df38
Remove scheduler debug logs 2019-09-13 16:03:28 -07:00
Connor Rigby 3569a21c72
Update to elixir 1.9 2019-09-13 16:03:27 -07:00
connor rigby d4157175d4
Increase grace period in scheduler to 15 minutes 2019-09-13 16:03:27 -07:00
gabrielburnworth 62a101dc9c
Fix some farmware bugs 2019-09-13 16:03:27 -07:00
Connor Rigby ed84cfeb2f
Add feature to subscribe to update to scheduled calendar 2019-09-13 16:03:27 -07:00
Connor Rigby 6c59d54244
Update logs for starting/completing a sequence 2019-09-13 16:03:26 -07:00
Connor Rigby 3d07c263ea
Fix scheduler not reindexing when an event is missed
* Add some breadcrumbs to see what the data that generated the scheduled
event looks like
* only monitor a process if it isn't monitored yet
2019-09-13 16:03:26 -07:00
connor rigby 55533675f5
Reenable sequence init and sequence complete logs
Sort of a hack, but store some metadata about a sequence in the AST
format, and if it exists, log it
2019-09-13 16:03:26 -07:00
Connor Rigby 6bb75de021
Allow flashing firmware at runtime
* Moves tty detector to farmbot_core
   * Update elixir config to reflect this
* Update `flash_firmware` rpc to not circularly flash firmware
2019-09-13 16:03:25 -07:00
Connor Rigby a160d6a41b
Fix factory_resetting the arduino-firmware
* Adds `api_migrated` field to FirmwareConfig
* Changes `factory_reset()` syscall to be `factory_reset(package)`
2019-09-13 16:03:25 -07:00
connor rigby 2a884f3b41
Fix typo in `If` 2019-09-13 16:03:25 -07:00
connor rigby e7fed8838d
Update home all log 2019-09-13 16:03:25 -07:00
connor rigby 5ca92090a1
Update more logs
* Any float is not formatted very specifically
   * if the remainder in the decimal is `0`, don't display decimal
   * if the remainder is not zero, truncate to only one decimal place

* Write/Read pin
   * yeah that got messy
2019-09-13 16:03:25 -07:00
connor rigby ce3480a0f5
Add log for relative movement 2019-09-13 16:03:25 -07:00
connor rigby d2239d76c3
Try add log channels more aggressively 2019-09-13 16:03:24 -07:00
connor rigby 059af23faf
Add parens to movement logs 2019-09-13 16:03:24 -07:00
connor rigby 28b43bebd3
Update more logs for clarity
* Add log for things that enumerate all axis
* change `homing` to `going home`..
2019-09-13 16:03:24 -07:00
connor rigby 0cbb4ba784
Fix named pins causing celeryscript errors
NamedPin values were encoded as tuples. This changes it to
pattern matchable structs, and implements a `to_string` behaviour
for those structs
2019-09-13 16:03:24 -07:00
Connor Rigby c92c79347f
Add back step logs 2019-09-13 16:03:24 -07:00
connor rigby 672c1cc5e6
Fix CeleryScript Compiler typo in find_home/1 2019-09-13 16:03:23 -07:00
Connor Rigby 60b075cf88
Normalize asset commans
Many clauses were not getting hit depending on if
`update/3` was called with a Module or a "String".
This normalizes everything early.
2019-09-13 16:03:23 -07:00
Connor Rigby e6b29ea559
Refactor CeleryScript execution
* FarmEvents now schedule all events up front
  * Executions are stored in the database
* Regimens now schedule all items up front
  * Executions are stored in the database
* fix Deleting a FarmEvent with a running RegimenInstance
* `execute`int and `schedule`ing a CeleryScript are not separate things
* Everywhere `scheduling` and `executing` CeleryScript updated to use
the new API
2019-09-13 16:03:23 -07:00
Connor Rigby 00d0897672
Dry up celery_script compilation
This adds much more type checking and error
handling in the compiled celery_script.
Also removes the hack/shortcut in the StubSysCalls
module.
2019-09-13 16:03:23 -07:00
Connor Rigby 697850b4b3
Implement process separation for celery scheduler
This should hopefuly prevent hanging forever and other weird
issues relating to executing celeryscript
2019-09-13 16:03:23 -07:00
Connor Rigby 5496efd390
Revert "Update scheduler to use ETS instead of storing data on a local state"
This reverts commit 4b2fa3f312.
2019-09-13 16:03:23 -07:00
Connor Rigby c0ddf0a32d
Revert "Update command_runner to not use entire scheduler"
This reverts commit e5d1e00c5f.
2019-09-13 16:03:22 -07:00
Connor Rigby 12640ae805
Revert "make sure to setup ets table for farmbot_celeryscript before starting it"
This reverts commit 2f689e4a1f.
2019-09-13 16:03:22 -07:00
Connor Rigby 14ff862176
Allow named_pin to return metadata
This will allow doing special thing contextually depending
on the type of pin being read.
2019-09-13 16:03:22 -07:00
Connor Rigby 2d66f09485
Enable `warnings_as_errors` for each app 2019-09-13 16:03:21 -07:00
Connor Rigby be1c6dc869
Add basic support for the express firmware target (#718)
* Initital setup for FarmbotExpress

* Update farmbot-arduino-firmware commit ref
2019-09-13 16:03:21 -07:00
connor rigby 3afed72bf5
Update scheduler_test to be less strict.
When the scheduler was split up into two different processes
for executing cellery_script, checking times doesn't really make
sense. Asserting that they do infact execute in a certain
amount of time is fine
2019-09-13 16:03:20 -07:00
Connor Rigby d7b43ffebe
Fix scheduler tests 2019-09-13 16:03:20 -07:00
Connor Rigby c653502f9a
Update command_runner to not use entire scheduler 2019-09-13 16:03:20 -07:00
Connor Rigby b9b222fe3c
make sure to setup ets table for farmbot_celeryscript before starting it 2019-09-13 16:03:20 -07:00