Search found 3630 matches

by dhylands
Mon Apr 19, 2021 11:29 pm
Forum: General Discussion and Questions
Topic: Protecting files on littlefs
Replies: 3
Views: 143

Re: Protecting files on littlefs

You can disable MSC access by turning it off in your boot.py file. However, you'll still be able to access the files using a tool like rshell. You'd need to disable the REPL in order to fully disable file access that way. That can all be circumvented by booting in safe mode: http://docs.micropython....
by dhylands
Mon Apr 19, 2021 4:51 pm
Forum: Raspberry Pi microcontroller boards
Topic: program controlled REPL ?
Replies: 4
Views: 164

Re: program controlled REPL ?

You could also just have your program collect bytes from stdin and 'eval' them when you get a full line (terminated by a CR - 0x0D).
by dhylands
Sun Apr 11, 2021 4:32 pm
Forum: Raspberry Pi microcontroller boards
Topic: Receive data from PC
Replies: 2
Views: 138

Re: Receive data from PC

I put together an example which allows JSON data to be sent back and forth:
https://github.com/dhylands/json-ipc
by dhylands
Fri Apr 09, 2021 9:14 pm
Forum: General Discussion and Questions
Topic: Why does utime.gmtime() exist?
Replies: 2
Views: 141

Re: Why does utime.gmtime() exist?

In the unix version of MicroPython localtime and gmtime don't return the same results.
by dhylands
Fri Apr 09, 2021 9:11 pm
Forum: General Discussion and Questions
Topic: How does file transfer to target device work?
Replies: 3
Views: 143

Re: How does file transfer to target device work?

I've also written a script https://github.com/dhylands/upy-example ... e_files.py that takes some files and generates a files.py file. You can then run that on the board using pyboard.py

I think using rshell is easier (disclaimer I wrote rshell).
by dhylands
Thu Apr 08, 2021 7:17 pm
Forum: MicroPython pyboard
Topic: Pyboard.py raw repl : passing Micropython variable to Python
Replies: 6
Views: 383

Re: Pyboard.py raw repl : passing Micropython variable to Python

I think you can just call exec_raw_no_follow. However, you probably need to keep track of whether you're in raw-repl mode or not. Since you're not calling follow, you don't know if calling exit_raw_repl will actually work or not. If you call enter_raw_repl again, it will send a Control-C and if the ...
by dhylands
Wed Apr 07, 2021 6:12 pm
Forum: MicroPython pyboard
Topic: pydfu.py run
Replies: 1
Views: 236

Re: pydfu.py run

I'm pretty sure that pydfu.py will only work on Linux and MacOS and not on Windows. You'll need to use dfu-util (command line) or one of the GUI based DFU loaders (like DFUse) under windows.
by dhylands
Wed Apr 07, 2021 6:10 pm
Forum: MicroPython pyboard
Topic: Pyboard.py raw repl : passing Micropython variable to Python
Replies: 6
Views: 383

Re: Pyboard.py raw repl : passing Micropython variable to Python

"follow" collects output from the downloaded script. rshell calls exec_raw_no_follow, and then calls follow. This allows the host side to interact with the remote side when say transferring files. https://github.com/dhylands/rshell/blob/e2820f679aa06d40c35dbd5c626a0402047e28f8/rshell/main.py#L1610-L...
by dhylands
Sat Apr 03, 2021 5:05 pm
Forum: General Discussion and Questions
Topic: I am at a loss of how to get started??
Replies: 14
Views: 479

Re: I am at a loss of how to get started??

You can use pyboard.py (found in micropython/tools) to upload a file into memory and execute it. Something like: pyboard.py -d /dev/ttyACM0 name-of--python-file Note which the RPi Pico and rshell you shouldn't need to specify the port. It should find it automatically. After launching rshell you can ...
by dhylands
Sat Apr 03, 2021 4:07 pm
Forum: General Discussion and Questions
Topic: Problem with rshell running a series of commands
Replies: 4
Views: 186

Re: Problem with rshell running a series of commands

I can manually enter rshell and then enter repl and then type import mm1 and get the simple program to run ok. However, if I run the following code, it does'nt work: $rshell repl ~ import mm1 The error message is: unable to find to find board 'home/pi' I am using the default name of the board. What...