Commit Graph

95 Commits (27456d977a145356b81b0c59e585a24bdc537b82)

Author SHA1 Message Date
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