Are there tools like 'ampy' and 'there' that support websocket connections?
Are there tools like 'ampy' and 'there' that support websocket connections?
I've tried to use 'ampy' (https://pypi.org/project/adafruit-ampy/) and 'there' (https://pypi.org/project/mpy-repl-tool/) to manage source files on my esp32 running micropython. Neither of these tools appears to support WebREPL.
Are there alternatives that support WebREPL?
Are there alternatives that support WebREPL?
Re: Are there tools like 'ampy' and 'there' that support websocket connections?
You may want to try upydev, works for serial, WebREPL and BLE.
Re: Are there tools like 'ampy' and 'there' that support websocket connections?
Do you have experience with this tool? I cannot make it work.
For example, I would like to copy the contents of the device into a directory called tmp:
$ upydev dsync -d / tmp
dsync: path .//, ./tmp:
dsync: checking filesystem...
dsync: dirs: none
dsync: files: none
$ ls tmp
$
The device is freshly flashed, so it has a boot,py file on it. But it clearly was not downloaded.
The online docs are sparse on details:
https://upydev.readthedocs.io/en/latest ... operations
For example, I would like to copy the contents of the device into a directory called tmp:
$ upydev dsync -d / tmp
dsync: path .//, ./tmp:
dsync: checking filesystem...
dsync: dirs: none
dsync: files: none
$ ls tmp
$
The device is freshly flashed, so it has a boot,py file on it. But it clearly was not downloaded.
The online docs are sparse on details:
https://upydev.readthedocs.io/en/latest ... operations
Re: Are there tools like 'ampy' and 'there' that support websocket connections?
Yes I'm the authorDo you have experience with this tool? I cannot make it work.
I agree on that, probably I should explain better how dsync command works since it may be a bit confusing.The online docs are sparse on details:
Although every command has its own help info:
Code: Select all
$ upydev dsync -h
usage: dsync [-h] [-rf] [-d] [-fg] [-b B] [-t] [-f] [-p] [-n]
[-i [I [I ...]]]
[dir/pattern [dir/pattern ...]]
recursively sync a folder from/to device's filesystem
* needs shasum.py in device
positional arguments:
dir/pattern indicate a dir/pattern to sync
optional arguments:
-h, --help show this help message and exit
-rf remove recursive force a dir or file deleted in local/device directory
-d sync from device to host
-fg switch off faster get method
-b B read buffer for faster get method
-t show tree of directory to sync
-f force sync, no hash check
-p show diff
-n dry-run and save stash
-i [I [I ...]] ignore file/dir or pattern
dsync command considers that your current working directory './' is at the same level of device root '/' directory, so if you want to copy the contents of the device into a directory called tmp do:For example, I would like to copy the contents of the device into a directory called tmp:
Code: Select all
$ mkdir tmp
$ cd tmp
tmp:$ upydev dsync -d
So if your device is freshly flashed do:
Code: Select all
$ upydev update_upyutils shasum.py
Note that if you are going to use dsync frequently or do consecutive calls it may be better to enter shell-repl mode first. e.g.
Code: Select all
$ upydev shl
shell-repl @ pybV1.1
SerialREPL connected
MicroPython v1.19.1-217-g5234e1f1e on 2022-07-29; PYBv1.1 with STM32F405RG
Type "help()" for more information.
- CTRL-k to see keybindings or -h to see help
- CTRL-s to toggle shell/repl mode
- CTRL-x or "exit" to exit
pyboard@pybV1.1:~ $
Re: Are there tools like 'ampy' and 'there' that support websocket connections?
I've uploaded `shasum.py` as you suggested
```
$ upydev update_upyutils shasum.py
```
but when I
```
$ cd tmp
$ upydev dsync -d
upydev: no device configured (upydev_.config file not found)
```
The issue is that `upydev_.config` is in the parent directory...
```
$ upydev update_upyutils shasum.py
```
but when I
```
$ cd tmp
$ upydev dsync -d
upydev: no device configured (upydev_.config file not found)
```
The issue is that `upydev_.config` is in the parent directory...
Re: Are there tools like 'ampy' and 'there' that support websocket connections?
And even if I copy `upydev_.config` into the `tmp` directory
```
$ upydev dsync -d
dsync: path ./:
dsync: dirs: none
dsync: syncing new files (1):
- ./lib/shasum.py [5.83 kB]
dsync: syncing modified files (1):
- ./boot.py [0.14 kB]
upydevice:./boot.py -> ./boot.py
./boot.py [0.14 kB]
get: Operation failed, reason: invalid syntax (<unknown>, line 1)
Continue get Operation with next file? [y/n]n
Canceling file queue..
```
```
$ upydev dsync -d
dsync: path ./:
dsync: dirs: none
dsync: syncing new files (1):
- ./lib/shasum.py [5.83 kB]
dsync: syncing modified files (1):
- ./boot.py [0.14 kB]
upydevice:./boot.py -> ./boot.py
./boot.py [0.14 kB]
get: Operation failed, reason: invalid syntax (<unknown>, line 1)
Continue get Operation with next file? [y/n]n
Canceling file queue..
```
Re: Are there tools like 'ampy' and 'there' that support websocket connections?
mmm I see, does command get, put work for you? I see now I forgot to mention a little detail here that should be in the help/docs info.
You have two options:
To sync from device
Now it should work, if it doesn't let me know but I think that's it.
Also for configuration it may be better to save configuration in global path. check $ upydev dm and $ upydev config -h
so you don't need to copy configuration manually.
You have two options:
To sync from device
- add -fg flag as $ upydev dsync -d -fg (this switches off the faster get method which needs upysh.py)
Code: Select all
$ upydev update_upyutils upysh.py
Now it should work, if it doesn't let me know but I think that's it.
Also for configuration it may be better to save configuration in global path. check $ upydev dm and $ upydev config -h
so you don't need to copy configuration manually.
Re: Are there tools like 'ampy' and 'there' that support websocket connections?
Is it possible to just specify the device connection details on the command line instead of using a `upydev_.config` file?
Re: Are there tools like 'ampy' and 'there' that support websocket connections?
It depends, not all commands work this way, upydev is intended to work with config files.
Preferred method is e.g.:
Or if working with multiple devices
Do you have any use case that is preferable to specify connections details on the command line over a config file?
Are you trying to integrate upydev in your own automated workflow or something like that?
Preferred method is e.g.:
Code: Select all
$ upydev config -t /dev/tty.usbmodem3370377430372 -g -@ mydevice
Code: Select all
$ upydev config -t /dev/tty.usbmodem3370377430372 -g -gg -@ mydevice
Are you trying to integrate upydev in your own automated workflow or something like that?
Last edited by cgglzpy on Tue Aug 16, 2022 4:12 pm, edited 1 time in total.
Re: Are there tools like 'ampy' and 'there' that support websocket connections?
upydev appears to require its config file to live in the current dir, but dsync also maps the current directory to the root of the upy device.Do you have any use case that is preferable to specify connections details on the command line over a config file?
Are you trying to integrate upydev in your own automated workflow or something like that?
This makes upydev awkward to use unless you are prepared to send the config file along with the source.