Are there tools like 'ampy' and 'there' that support websocket connections?

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
cgglzpy
Posts: 47
Joined: Thu Jul 18, 2019 4:20 pm

Re: Are there tools like 'ampy' and 'there' that support websocket connections?

Post by cgglzpy » Tue Aug 16, 2022 12:52 pm

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.
This is not true, upydev requires a config file, in the current dir OR in upydev global path (just use -g flag with config command).

So as default upydev will look for config file in current dir and if it does not find any, it will look in the global path. (If you want to look in global path only, again use -g flag or remove config file from current dir)
This makes upydev awkward to use unless you are prepared to send the config file along with the source.
As mentioned above you don't need to have the config file in current dir,
and if for some reason you need to have any file in your current dir that you don't want to sync you could use "-i" flag to ignore it. (accepts multiple files or some sort of pattern matching with wildcards "*") e.g.

ignore .md , .txt and dotfiles

Code: Select all

$ upydev dsync -i "*.md" "*.txt" "*./.*"
Also if you are not sure about what to sync or not use "-n" flag to make a dry-run.

spierepf
Posts: 22
Joined: Mon Jul 08, 2019 3:22 pm

Re: Are there tools like 'ampy' and 'there' that support websocket connections?

Post by spierepf » Tue Aug 16, 2022 4:18 pm

What is the upydev global path? I cannot find it mentioned in the docs (https://upydev.readthedocs.io/en/latest ... ea=default)

Does the -g parameter accept a filename?

$ upydev dsync -d -g ../upydev_.config

The src folder doesn't have any files that I don't want synced. No README.md files or text files. Those are all in the root of the project.

cgglzpy
Posts: 47
Joined: Thu Jul 18, 2019 4:20 pm

Re: Are there tools like 'ampy' and 'there' that support websocket connections?

Post by cgglzpy » Tue Aug 16, 2022 7:25 pm

What is the upydev global path? I cannot find it mentioned in the docs (https://upydev.readthedocs.io/en/latest ... ea=default)
I do not use exactly "upydev global path" words in the docs but this is what I mean by e.g. in getting started docs--> Create configuration file:
Upydev will use local working directory configuration unless it does not find any or manually indicated with -g option which is the global configuration flag.
And a little below that
To save configuration globally use -g flag: $ upydev config -t [DEVICE ADDRESS] -p [PASSWORD/BAUDRATE] -g
Does the -g parameter accept a filename?
No, is just a flag to indicate you are using the global path to store the configuration file (if used with config command) or to read from the configuration file if used with any other command.

upydev looks for configuration file in 3 steps:

upydev (without -g flag) looks for config file in current dir:
  • Case A: There is a "upydev_.config" file, then use this file.
  • Case B: There is no "upydev_.config" file, then look in global path and use that file
  • Case C: There is no "upydev_.config" file at any location (current dir or global path) --> Raise an error saying there is no "upydev_.config" file and indicate use of command config to create one.


upydev with -g flag will start at Case B and ignore current dir.

So just remove current dir configuration file and use again config but with -g flag e.g

Code: Select all

$ upydev config -t /dev/tty.usbmodem3370377430372 -g -@ mydevice
after that just use

Code: Select all

$ upydev dsync -d
Maybe I should explain this better in the docs?
Since I'm the author, is difficult to judge which commands/steps that may be kind of obvious for me, they are not that obvious for newcomers, so any feedback related to this is always welcome.

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: Are there tools like 'ampy' and 'there' that support websocket connections?

Post by mattyt » Wed Aug 17, 2022 1:57 am

Adding wireless connectivity to mpremote has been discussed and is likely to happen sooner rather than later...

bulletmark
Posts: 59
Joined: Mon Mar 29, 2021 1:36 am
Location: Brisbane Australia

Re: Are there tools like 'ampy' and 'there' that support websocket connections?

Post by bulletmark » Wed Aug 17, 2022 2:33 am

mattyt wrote:
Wed Aug 17, 2022 1:57 am
Adding wireless connectivity to mpremote has been discussed and is likely to happen sooner rather than later...
@mattyr, I'd like to read more about this so can you please point me to where this has been discussed?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Are there tools like 'ampy' and 'there' that support websocket connections?

Post by jimmo » Wed Aug 17, 2022 2:45 am

The webrepl (included on most boards with WiFi) has a command line tool to transfer files like ampy. See https://github.com/micropython/webrepl (specifically webrepl_cli.py)

Post Reply