Giter Club home page Giter Club logo

mpbridge's People

Contributors

amirhmzz avatar wind-stormger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mpbridge's Issues

Failed to access port while trying to enter REPL

~$ mpbridge dev /dev/ttyACM0 /home/wind/temp
 - Syncing files on /dev/ttyACM0 with /home/wind/temp
 - Entering raw repl
 - Syncing files
 ✓ Synced files successfully
 ? Press [Enter] to Sync >> Hard Reset >> Enter REPL   Press [Ctrl + C] to exit 
 - Syncing files
 ✓ Synced files successfully
 ✓ Hard reset board successfully
 R Entering REPL using mpremote
Connected to MicroPython at /dev/ttyACM0
Use Ctrl-] to exit this shell
device disconnected

 R Exiting REPL
Traceback (most recent call last):
  File "/home/wind/.local/bin/mpbridge", line 8, in <module>
    sys.exit(main())
  File "/home/wind/.local/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/wind/.local/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/wind/.local/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/wind/.local/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/wind/.local/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/wind/.local/lib/python3.10/site-packages/mpbridge/shell.py", line 64, in dev
    bridge.start_dev_mode(port, dir_path)
  File "/home/wind/.local/lib/python3.10/site-packages/mpbridge/bridge.py", line 59, in start_dev_mode
    pyb = SweetPyboard(device=port)
  File "/home/wind/.local/lib/python3.10/site-packages/mpremote/pyboard.py", line 292, in __init__
    raise PyboardError("failed to access " + device)
mpremote.pyboard.PyboardError: failed to access /dev/ttyACM0

Tested in Ubuntu 22.04.1 LTS and Windows10, same err.

[Feature request] Sync mode that only updates local->mcu without neither cleaning nor syncing mcu->local

I think an additional syncing mode could be useful when you have several project on the same board, and you don't want to erase them every time you you switch project.

In this mode, which could be activated by another modifier, say --push instead of --clean, mpbridge copies the files that have changed in the local folder to the board, but it doesn't neither erase other files in the board nor copies any board file to the local folder.

Wish to keep using the REPL while the port is occupied.

I've been using mpbridge lately and, on purpose, I've stopped using other 3rd party tools.

I hope this uncovers some of the more pressing needs of using mpbridge.

I found that I needed to close mpbridge anyway, and then use other tools to connect to the port, because only one program can occupy the port at a time.

Of course, I directly use mpremote to connect to the port and view the REPL.

I would like to make an initial suggestion.

When there is no operation on the file, enable REPL on the terminal, allowing users to use REPL to interact with micropython devices. When any changes occur in the local temporary folder, interrupt REPL, start synchronizing files, and continue to enable REPL after completion.

How to exit the program?

If you type ctrl-c the program quits, but the USB is left in an unusable state. To run tools such as mpremote a reboot is required.

Add dummy/preview option to sync

It would be really useful to have an option on the sync command that just previews the sync but doesn't actually perform the sync.

Thoughts?

New idea, add mpy-cross to mpbridge!

Releases v1.19 , mpy 6 description

Doc, mpyfiles

PYPI, mpy-cross

Briefly, add a function to batch convert .py to .mpy, then sync only the .mpy files to the device.

The .mpy runs faster on the device than .py and takes up less space.

At present, mpy-cross can only convert files one by one through commands, and batch conversion can obviously improve efficiency.

The hash checking feature already in place can continue to be used.

Convert .py to .mpy again only if the .mpy file in the device is different from local.

Feature request: support alternative file managers

When mpbridge is run, the Linux default file manager opens. It would be good if there were a means of specifying an alternative.

If that is impractical, printing the location of the temporary filesystem would provide a hint for those wishing to use an alternative.

Fails under Linux Mint 20.3

I attempted to run this under Linux Mint 20.3 with this error message which I've never seen before:

$ ./main.py
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/408.

The system was in a peculiar state with the mouse cursor visible as a cross but not functional. I tried to break in with ctrl-c without success. I then tried to close the Bash window, which did break into the program with this traceback:

^C
^C^X
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/408.
from: can't read /var/mail/typing
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/408.
./main.py: line 8: syntax error near unexpected token `('
./main.py: line 8: `from watchdog.events import ('

I had installed the latest version of watchdog.

Running as root had no effect, producing the same symptoms.

Add auto port detection feature

Accept auto keyword as port in all commands and detect port automatically. This might need to iterate over serial ports and try them one by one.

Feature idea: delete directory

It would be really useful to be able to delete just one directory.

Maybe a new command or a parameter could be supplied to "clear" eg. "clear /logs"?

mpbridge not interrupting processing on esp32

High... Excellent tool ... Have a couple of issues... When running the ESP32 with a program, in many cases it is difficult to interrupt the process for new update of python code by using "ctr alt ]". In the end i have to stop the mpbridge and erase the ESP code using esptool doing a flash erease and flash innstall of micropython. (esptool IS able to connect to the ESP32 even if mpbridge cannot)
I do not know if this is caused by me not installing with "sudo pip install -U mpbridge" in a conda environment since sudo gave an error i skipped it , using "pip install -U mpbridge" instead.
Screenshot from 2023-03-06 19-52-10

When using the sync function, what if we need to delete some files on the board?

Currently, sync will perform a check and compare, and then pull the files that are not in the local folder from the board to the local, and then push the files that are not on the board or have changed locally to the board.

But what if we need to delete some files on the board?

Suppose, when we need to switch projects to use on the same board, the content of many files or folders will be useless and occupy the flash.

At this time, some methods are needed, such as setting an additional requirement when syncing, only based on the files in the local folder, checking redundant files or subfolders on the board, and deleting them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.