Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added wdt.feed() on tools > wipe divice #327

Merged
merged 7 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/getting-started/installing/from-pre-built-release.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ If `ktool` fails to run, you may need to give it executable permissions with `ch

If the flashing process fails midway through, check the connection, restart the device, and try the command again.

Two serial ports are created when `Amigo` and `Bit` are connected to a PC. Sometimes Ktool will pick the wrong and flash will fail. Manually specify the serial port to overcome this issue using `-p` argument. Ex:
Two serial ports are created when `Amigo` and `Bit` are connected to a PC. Sometimes Ktool will pick the wrong and flash will fail. Manually specify the serial port to overcome this issue using `-p` argument:

```bash
./ktool-linux -B goE -b 1500000 maixpy_amigo/kboot.kfpkg -p /dev/ttyUSB1
```

Check por names of devices manager on Windows (ex: COM1, COM9), or list the ports on linux
Check por names of devices manager on Windows (e.g. COM1, COM9), or list the ports on linux

```bash
ls /dev/ttyUSB*
Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started/installing/from-test-release.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To Flash M5stickV run:
```

##### Windows
Replace './ktool-linux' for 'ktool-win.exe' and / for \ in commands. Ex:
Replace './ktool-linux' for 'ktool-win.exe' and / for \ in commands:
```pwsh
./ktool-win.exe -B goE -b 1500000 maixpy_m5stickv\kboot.kfpkg
```
Expand All @@ -30,7 +30,7 @@ To Flash Maix Amigo run:
```

##### Windows
Replace './ktool-linux' for 'ktool-win.exe' and / for \ in commands. Ex:
Replace './ktool-linux' for 'ktool-win.exe' and / for \ in commands:
```pwsh
./ktool-win.exe -B goE -b 1500000 maixpy_amigo\kboot.kfpkg
```
Expand All @@ -43,7 +43,7 @@ To Flash Maix Bit run:
```

##### Windows
Replace './ktool-linux' for 'ktool-win.exe' and / for \ in commands. Ex:
Replace './ktool-linux' for 'ktool-win.exe' and / for \ in commands:
```pwsh
./ktool-win.exe -B goE -b 1500000 maixpy_bit\kboot.kfpkg
```
Expand All @@ -56,7 +56,7 @@ To Flash Maix Dock run:
```

##### Windows
Replace './ktool-linux' for 'ktool-win.exe' and / for \ in commands. Ex:
Replace './ktool-linux' for 'ktool-win.exe' and / for \ in commands:
```pwsh
./ktool-win.exe -B dan -b 1500000 maixpy_dock\kboot.kfpkg
```
Expand Down
5 changes: 3 additions & 2 deletions docs/getting-started/settings.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ You can set up a thermal printer or tell Krux to store a GRBL CNC instructions f
Define several machining parameters according to the desired size, material you'll use, and your CNC characteristics and capabilities.

#### Thermal
Printers can come with different baudrates from the manufacturer. By default, Krux assumes the connected printer will have a baudrate of `9600`. If yours is different, you can change this here.
Also setup the IOs you'll use and tweak parameters according to your printer recommendations. Consult the [part list](../parts.md/#optional-thermal-printer) page for supported printers.
Printers can come with different baudrates from the manufacturer. By default, Krux assumes the connected printer will have a baudrate of `9600`. If yours is different, you can change it here.

Also setup the TX Pin you'll use (e.g. 35 for M5stickV and 7 for Amigo) and tweak other parameters according to your printer recommendations. For most printers you will only need to connect 2 cables, the device TX to the printer RX and ground. Consult the [part list](../parts.md/#optional-thermal-printer) page for supported printers.

#### Driver
Here you choose between Thermal, CNC or none (default). Leave this setting to "none" if you won't use a printer and don't want to be bothered by print prompts.
Expand Down
4 changes: 2 additions & 2 deletions docs/parts.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ This will be included with the M5StickV and Maix Amigo that you purchase from on
We cannot guarantee that a microSD card is compatible and will work in your device; you'll need to test it on the device to be sure, read the [FAQ](faq.md/#why-isnt-krux-detecting-my-microsd-card-or-presenting-an-error) for more info. The size of the SD card isn't important; anything over a few megabytes will be plenty.

### (Optional) Thermal Printer
Krux has the ability to print all QR codes it generates, including mnemonic, xpub, wallet backup, and signed PSBT, via a locally-connected thermal printer over its serial port.
Krux has the ability to print all QR codes it generates, including mnemonic, xpub, wallet backup and signed PSBT, via a locally-connected thermal printer over its serial port.

Many thermal printers may work, but the [starter pack](https://www.adafruit.com/product/600) would be the easiest way to get started since it includes all the parts you will need to begin printing (except the conversion cable). For more info, [see here](https://github.com/selfcustody/krux/discussions/312)
Many thermal printers may work, but the [Adafruit printer starter pack](https://www.adafruit.com/product/600) would be the easiest way to get started, as it includes all the parts needed to print (except the conversion cable). Make sure to enable the printer driver and set the baudrate value in [settings](./getting-started/settings.md/#thermal) for 19200 or 9600 as explained in this [Adafruit printer tutorial](https://learn.adafruit.com/mini-thermal-receipt-printer/first-test). You will also need to connect 2 cables, the device TX to the printer RX and ground. For more info, [see this discussion](https://github.com/selfcustody/krux/discussions/312).

### (Optional) Conversion Cable for Thermal Printer
To connect the printer to the device, you will need a [conversion cable](https://store-usa.arduino.cc/products/grove-4-pin-male-to-grove-4-pin-cable-5-pcs) with a 4-pin female Grove connector on one end (to connect to the device) and 4-pin male jumpers on the other end (to connect to the printer).
1 change: 1 addition & 0 deletions i18n/translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"Depth Per Pass": "Tiefe pro Durchgang",
"Device flash storage not detected.": "Geräte-Flash-Speicher nicht erkannt.",
"Display": "Bildschirm",
"Do not power off, it may take a while to complete.": "Schalten Sie das Gerät nicht aus, es kann eine Weile dauern.",
"Done?": "Fertig?",
"Driver": "Driver",
"Encoder": "Encoder",
Expand Down
1 change: 1 addition & 0 deletions i18n/translations/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"Depth Per Pass": "Profundidad por pasada",
"Device flash storage not detected.": "Almacenamiento flash del dispositivo no detectado.",
"Display": "Pantalla",
"Do not power off, it may take a while to complete.": "No apague, puede tardar un tiempo en completarse.",
"Done?": "¿Listo?",
"Driver": "Operador",
"Encoder": "Codificador",
Expand Down
1 change: 1 addition & 0 deletions i18n/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"Depth Per Pass": "Profondeur par passage",
"Device flash storage not detected.": "Stockage flash de l'appareil non détecté.",
"Display": "Affichage",
"Do not power off, it may take a while to complete.": "Ne pas éteindre, cela peut prendre un certain temps.",
"Done?": "Terminé?",
"Driver": "Conducteur",
"Encoder": "Encodeur",
Expand Down
1 change: 1 addition & 0 deletions i18n/translations/nl-NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"Depth Per Pass": "Diepte per pas",
"Device flash storage not detected.": "Opslag op apparaat is niet gedetecteerd.",
"Display": "Weergave",
"Do not power off, it may take a while to complete.": "Schakel het apparaat niet uit, het kan even duren voordat het klaar is.",
"Done?": "Klaar?",
"Driver": "Driver",
"Encoder": "Encoder",
Expand Down
1 change: 1 addition & 0 deletions i18n/translations/pl-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"Depth Per Pass": "Głębokość na przepustkę",
"Device flash storage not detected.": "Nie wykryto pamięci flash urządzenia.",
"Display": "Wyświetlacz",
"Do not power off, it may take a while to complete.": "Nie wyłączaj zasilania, może to chwilę potrwać.",
"Done?": "Zrobione?",
"Driver": "Kierowca",
"Encoder": "Enkoder",
Expand Down
1 change: 1 addition & 0 deletions i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"Depth Per Pass": "Profundidade da Passagem",
"Device flash storage not detected.": "Armazenamento flash do dispositivo não detectado.",
"Display": "Display",
"Do not power off, it may take a while to complete.": "Não desligue, pode demorar um pouco para concluir.",
"Done?": "Feito?",
"Driver": "Driver",
"Encoder": "Codificador",
Expand Down
1 change: 1 addition & 0 deletions i18n/translations/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"Depth Per Pass": "Глубина за Проход",
"Device flash storage not detected.": "Флэш память устройства не обнаружена.",
"Display": "Дисплеи",
"Do not power off, it may take a while to complete.": "Не выключайте питание, это может занять некоторое время.",
"Done?": "Готово?",
"Driver": "Драйвер",
"Encoder": "Кодер",
Expand Down
1 change: 1 addition & 0 deletions i18n/translations/vi-VN.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"Depth Per Pass": "Độ sâu mỗi lần vượt qua",
"Device flash storage not detected.": "Không phát hiện bộ lưu trữ flash của thiết bị.",
"Display": "Hiển thị",
"Do not power off, it may take a while to complete.": "Không tắt nguồn, có thể mất một lúc để hoàn thành.",
"Done?": "Hoàn tất?",
"Driver": "Người cầm lái",
"Encoder": "Mã hoá",
Expand Down
8 changes: 7 additions & 1 deletion src/krux/pages/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ def erase_spiffs(self):

import flash
from ..firmware import FLASH_SIZE, SPIFFS_ADDR, ERASE_BLOCK_SIZE
from ..wdt import wdt

empty_buf = b"\xff" * ERASE_BLOCK_SIZE
for address in range(SPIFFS_ADDR, FLASH_SIZE, ERASE_BLOCK_SIZE):
wdt.feed()
if flash.read(address, ERASE_BLOCK_SIZE) == empty_buf:
continue
flash.erase(address, ERASE_BLOCK_SIZE)
Expand All @@ -135,7 +137,11 @@ def wipe_device(self):
self.ctx.display.height() // 2,
):
self.ctx.display.clear()
self.ctx.display.draw_centered_text(t("Wiping Device.."))
self.ctx.display.draw_centered_text(
t("Wiping Device..")
+ "\n\n"
+ t("Do not power off, it may take a while to complete.")
)
self.erase_spiffs()
# Reboot so default settings take place and SPIFFS is formatted.
self.ctx.power_manager.reboot()
Expand Down
Loading
Loading