Commit Graph
62 Commits
Author SHA1 Message Date
David Lechner f4cb69f995 add setting to flash current user program 2021-01-14 18:03:04 -06:00
David Lechner a48f3f381e convert settings to do/did action pattern 2021-01-14 15:12:49 -06:00
David Lechner b15b2e1dea move docs toggle to settings 2021-01-14 10:55:00 -06:00
David Lechner d7dbaaa12d add dark mode setting 2021-01-11 23:36:48 -06:00
David Lechner 41a1cee092 change support button to settings button
and add new empty settings drawer
2021-01-11 23:36:48 -06:00
David Lechner 69e52be259 remove wasm file extension rename workaround
This modifies the webpack config instead of renaming the .wasm file
to workaround default webpack behavior regarding import .wasm files.
2021-01-11 16:47:49 -06:00
David Lechner ae996453e8 drop polyfill for chromimum < v85
This removes the polyfill for using older chrome browsers before the
writeWithResponse and writeWithoutResponse APIs were added.
2020-12-21 13:05:47 -06:00
David Lechner 32f2120ec6 fix timeout when firmware size is 10x packet size
When the firmware blob is exactly a multiple of 10 times the packet
size, the last checksum request causes the reply to the last program
request to be missed (there is only a response from the hub to the very
last program request). The program response is received, then the
checksum response is received. Since the saga is waiting for the
checksum response first, the program response is discarded.

Fix by breaking out of the loop when the firmware has been fully
transferred before making the checksum request.

Fixes: pybricks/support#178
2020-12-18 14:09:54 -06:00
David Lechner 4ee50072a0 Update firmware to v3.0.0a11
Also take advantage of new helper functions in firmware package.
2020-11-20 21:08:53 -06:00
David Lechner 71ad9c1b1b Update to create-react-app 4
- had to update eslint deps
- ran into https://github.com/palantir/blueprint/issues/4112
- had to move beta.svg out of static/
- had to fix prettier formatting changes
- ran into https://github.com/facebook/jest/issues/7780
2020-11-20 21:08:53 -06:00
Laurens Valk 5561de530b Rename CPlusHub to TechnicHub 2020-10-09 20:26:52 -05:00
David Lechner 441d517a52 Rework web assembly inclusion
This moves the .wasm file out of the static/js/ folder and into the
source tree. This way we can import it and webpack will pick it up
and version the file with a hash.

This fixes possibly running with an out of date file from the browser
cache and also fixes running offline.

The file extension had to be changed because there is a default rule in
webpack that matches the .wasm extension and causes the following error:

    Failed to compile.

    ./src/sagas/mpy-cross.wasm
    Module parse failed: magic header not detected
    File was processed with these loaders:
    * ./node_modules/file-loader/dist/cjs.js
    You may need an additional loader to handle the result of these loaders.
    Error: magic header not detected

The webpack configuration cannot be modified without ejecting
create-react-app or using something like react-app-rewired, which we
would like to avoid.

Also using ncp to copy file now which fixes building on Windows.
2020-07-03 20:29:19 -05:00
David Lechner 9cfc7c5bd1 wait for feedback more often during flashing
There have been some reports of firmware flashing not working with a
checksum timeout error, meaning that we probably overflowed a buffer
on the Bluetooth chip from sending data too fast.

We don't have info of the Bluetooth firmware so we are just guessing
here.
2020-07-02 21:37:00 -05:00
David Lechner 0944a27eb9 increase firmware flashing packet size 2020-07-02 21:37:00 -05:00
David Lechner c3037a56e6 Clarify city hub error message
It is only the bootloader/flashing firmware that is not compatible. It
can still be used with older browsers after Pybricks firmware has been
flashed.
2020-07-02 21:37:00 -05:00
David Lechner 78b17df163 add city hub to firmware flasher 2020-07-02 21:37:00 -05:00
David Lechner 087fb43b35 check for missing files in firmware.zip
Found by https://github.com/pybricks/pybricks-code/pull/98/checks?check_run_id=772712591
2020-06-15 08:34:07 -05:00
David Lechner 37a3967f3a fix race condition when flashing firmware
On Windows, we can get the GATT notification from the bootloader before
Windows says we are done writing to the characteristic. This was
observed on the erase and checksum messages with the Control+ hub.
2020-06-13 00:41:31 -05:00
David Lechner 712117c8d8 convert lwp3-bootloader from a service to a saga
For some reason this significantly improved bluetooth performance so we
had to readjust the frequency of getting the checksum. The new value
actually makes much more sense. It is unlikely that the bootloader
actually had an 8k buffer.
2020-06-12 21:46:00 -05:00
David Lechner 3f80374215 use new app startup action in terminal sagas 2020-06-12 21:46:00 -05:00
David Lechner 6e23262f06 fix spelling of firmware 2020-06-12 21:46:00 -05:00
David Lechner 1e0ef476ef Add docs toggle button 2020-06-12 21:46:00 -05:00
David Lechner bda007c17a convert ble service to saga 2020-06-11 22:53:38 -05:00
David Lechner f3425e2f0f rename BLEData to BleUart
These actions all relate specifically to the nRF UART GATT service
2020-06-11 22:53:38 -05:00
David Lechner ba14910dae move ble epic to terminal saga
this is the last epic so removing redux-observable as well
2020-06-10 21:59:34 -05:00
David Lechner 34184785c8 convert hub service and epic to saga 2020-06-10 21:59:34 -05:00
David Lechner 367d8a6178 remove buffers.expanding()
according to the docs, this is the default
2020-06-10 21:59:34 -05:00
David Lechner 818e7867ee globally handle no-unused-vars 2020-06-10 21:59:34 -05:00
David Lechner 292f2d83d2 convert error log from service to saga 2020-06-10 21:59:34 -05:00
David Lechner 17cb5a32d5 convert editor service to saga 2020-06-10 21:59:34 -05:00
David Lechner 5c3ec89e3b add test for editor saga 2020-06-10 21:59:34 -05:00
David Lechner 31c3e2b52e refactor common test helpers into test/
This way we can share them with multiple tests
2020-06-10 21:59:34 -05:00
David Lechner 8ba4143fa7 Throttle BLE messages from terminal
This makes the terminal more efficient by combining individual characters into a single message. Also (mostly) fixes overring the hub and locking it up.
2020-06-10 21:59:34 -05:00
David Lechner a411bfc92d improve serialization of BLE writes 2020-06-10 21:59:34 -05:00
David Lechner e09fd8713f convert terminal from epic to saga 2020-06-10 21:59:34 -05:00
David Lechner 07d0b5ef39 split firmware flashing from lwp3-bootloader
BLE won't always be the only way to flash firmware
2020-06-09 23:51:32 -05:00
David Lechner 6d81da0df0 Show notification when program is changed in another window 2020-06-09 23:51:32 -05:00
David Lechner 2a3e9caa90 Add some missing license headers 2020-06-07 21:39:58 -05:00
David Lechner 16b8f71d81 Fix MPY ABI version check
fixes: 6b3d1464bb
2020-06-04 11:53:59 -05:00
David Lechner c975613e1c rename bootloader to lwp3-bootloader
we will probably have DFU bootloader in the future
2020-06-04 11:28:13 -05:00
Laurens Valk bbad88a502 Bump @pybricks/mpy-cross to v5 2020-06-04 13:21:18 +02:00
David Lechner 297faafc27 convert mpy to saga
- unit tests depend on bug fix in @pybricks/mpy-cross-v4
- removes last use of redux-thunk
2020-05-27 20:57:22 -05:00
David Lechner c373b3abc5 begin rework of notifications
The notification reducer should decide when to display notifications rather than having notifications scattered throughout the code.

Also start using translations so that user-visible strings are not scattered in code.
2020-05-26 21:20:08 -05:00
David Lechner 6e4b22f841 Add common top-level Action type
This makes for better type inference.
2020-05-26 21:20:08 -05:00
David Lechner 6713afe198 Add util funciton to format as hex 2020-05-26 21:20:08 -05:00
David Lechner 7a7eba407f add tests for bootloader protocol errors 2020-05-26 21:20:08 -05:00
David Lechner 33861d970b Package firmware in app
- includes firmware .zip for movehub and cplushub
- firmware flash button no longer opens file dialog
  - now connects first, then choses firmware based on connected device
  - drag and drop of custom firmware still works
2020-05-25 21:31:35 -05:00
David Lechner f54f267762 simplify bootloader saga tests 2020-05-22 20:54:53 -05:00
David Lechner 6645a81d1c catch all message decode errors 2020-05-22 20:54:53 -05:00
David Lechner dd9d789e9a license 2020-05-22 19:54:48 -05:00