Raspberry Pi Pico - How To Flash a MicroPython Script with Rshell (on Windows)

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ส.ค. 2024

ความคิดเห็น • 50

  • @paakire3918
    @paakire3918 ปีที่แล้ว

    Very usefull for "Raspberry Pi Pico Solar System" project. Thanks a lot!

  • @SomeoneOnlyWeKnow.
    @SomeoneOnlyWeKnow. ปีที่แล้ว

    This is perfect! Brilliant video

  • @do_while
    @do_while 2 ปีที่แล้ว +2

    Everything good until I run rshell --version. It shows the message below. Do you know how to fix it? because I found other people with the same problem but no solution...
    PS C:\Users\stam_> rshell --version
    Traceback (most recent call last):
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\Scripts
    shell-script.py", line 33, in
    sys.exit(load_entry_point('rshell==0.0.30', 'console_scripts', 'rshell')())
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\Scripts
    shell-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py", line 162, in load
    module = import_module(match.group('module'))
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File "", line 1050, in _gcd_import
    File "", line 1027, in _find_and_load
    File "", line 1006, in _find_and_load_unlocked
    File "", line 688, in _load_unlocked
    File "", line 883, in exec_module
    File "", line 241, in _call_with_frames_removed
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\site-packages
    shell\command_line.py", line 1, in
    import rshell.main
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\site-packages
    shell\main.py", line 80, in
    import readline
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\site-packages
    eadline.py", line 34, in
    rl = Readline()
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline
    lmain.py", line 422, in __init__
    BaseReadline.__init__(self)
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline
    lmain.py", line 62, in __init__
    mode.init_editing_mode(None)
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline\modes\emacs.py", line 633, in init_editing_mode
    self._bind_key('space', self.self_insert)
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline\modes\basemode.py", line 162, in _bind_key
    if not callable(func):
    File "C:\Users\stam_\AppData\Local\Programs\Python\Python310\lib\site-packages\pyreadline\py3k_compat.py", line 8, in callable
    return isinstance(x, collections.Callable)
    AttributeError: module 'collections' has no attribute 'Callable'

    • @ericfletcher8144
      @ericfletcher8144 ปีที่แล้ว

      Ditto for me. Very frustrating, as the video tutorial otherwise seemed so promising.

    • @AleksandrIvin
      @AleksandrIvin ปีที่แล้ว

      @@ericfletcher8144 It works on old python version, for example 3.7

    • @arnolduk123
      @arnolduk123 9 หลายเดือนก่อน +1

      run: python -m pip install --upgrade pyreadline3

    • @ForIEqualsZero
      @ForIEqualsZero หลายเดือนก่อน

      @@arnolduk123 for me pyreadline wanst even installed so if that's also the case for you, run: pip install pyreadline3.

    • @squishylemon8577
      @squishylemon8577 หลายเดือนก่อน

      @@arnolduk123 legend

  • @MathiasLechner
    @MathiasLechner 3 ปีที่แล้ว

    Thank you for this great tutorial. Works like a charm also on my RasPi400. :)

  • @TheCesarferreira
    @TheCesarferreira 3 ปีที่แล้ว

    Great Tutorial....
    your keyboard is great.. can you tell me with brand and model?

  • @MakingRoboticsColombia
    @MakingRoboticsColombia 3 ปีที่แล้ว +2

    Gracias por compartir 👍🏻

  • @FelipeManager
    @FelipeManager 2 ปีที่แล้ว

    thanks! simple and objective.

  • @kp_kovilakam
    @kp_kovilakam 3 ปีที่แล้ว

    Thanks for the info. I would like to know how can we stop this running of code? I mean how to reset Pico to default?

  • @matthewfelgate
    @matthewfelgate 3 ปีที่แล้ว +1

    Thanks for sharing. I'm surprised Rasberry Pi haven't released any integrated program to do all this (like the Arduino IDE).

    • @MichaelRuppe
      @MichaelRuppe 3 ปีที่แล้ว

      There will likely be an IDE experience soon. This command line method is a good fallback and useful for programming many boards in batches - like if you're creating your own product.

    • @matthewfelgate
      @matthewfelgate 3 ปีที่แล้ว +1

      @@MichaelRuppe Yes, thanks for teaching me how to do REPL and using RShell to upload files.

    • @CrypticConsole
      @CrypticConsole 3 ปีที่แล้ว

      You can use Thing python ide

    • @CrypticConsole
      @CrypticConsole 3 ปีที่แล้ว

      Thonny* it is pre installed on raspbain buster

    • @Core-Electronics
      @Core-Electronics  3 ปีที่แล้ว

      Arduino has mentioned an RP2040 port is on the bake; so it shouldn't be too long until you can select from the Arduino menu Boards > RP2040 (or something to that effect). Days/weeks/months, unsure. But it's in work :)

  • @andreaswolfesberger6140
    @andreaswolfesberger6140 3 ปีที่แล้ว

    more from this pls - thx

  • @electronic7979
    @electronic7979 3 ปีที่แล้ว +1

    👍

  • @fordsrmaster
    @fordsrmaster 3 ปีที่แล้ว

    I'm trying to follow your example, but when I get to the part at 1:12 where I am supposed to check the version of rshell, I get an error returned with it saying "rshell is not recognized as the name of a cmdlet......."
    The pip install rshell seems to work with no errors. I'm not sure what to try next.

    • @Core-Electronics
      @Core-Electronics  3 ปีที่แล้ว

      Depending on your build, you may need to install rshell with "pip3 install rshell" instead
      If you run into more issues, we can provide much better support over on our forums: forum.core-electronics.com.au/

  • @rubenlott6209
    @rubenlott6209 3 ปีที่แล้ว

    How can I add a python module to the pico? E.G. the mpu9250

  • @jfdd43
    @jfdd43 3 ปีที่แล้ว

    So this thing sounds like a computer more than a micro-controller.
    Does this have an OS? Can it run code directly?

    • @theablanca17
      @theablanca17 3 ปีที่แล้ว

      It's a micro-controller. Not very different from a arduino. It doesn't have an os (not what we would define as an os). It runs code that gets stored on the internal storage, or while connected to it. It can run code in either c++ or micropython. All the info about it here www.raspberrypi.org/documentation/pico/getting-started/

  • @jameseze9469
    @jameseze9469 3 ปีที่แล้ว

    The last command just seems like you're copying main.py to a /pyboard folder. Will this work if I just copy the file using Windows explorer?

    • @johnwinters4201
      @johnwinters4201 3 ปีที่แล้ว +2

      Having tried that myself it seems the answer is no. The documentation for the Pico seems a bit thin at the moment, so it would be really useful to know what exactly is going on with that copy, and how one can emulate it without rshell. Where is the documentation that enabled the author of this video to learn how to do it?
      The really odd thing is that, although file clearly persist on the Pico, they don't show up when it's mounted as a USB drive. Again, more documentation needed.

  • @BazChannal
    @BazChannal 3 ปีที่แล้ว

    thank you for the easy to follow tutorial.
    isn't it the same thing when you just save the code as (main.py) and Pico will runs it automatically.

    • @russellduke7959
      @russellduke7959 3 ปีที่แล้ว

      pro tip: watch series at flixzone. Been using them for watching all kinds of movies lately.

    • @zanereyansh4624
      @zanereyansh4624 3 ปีที่แล้ว

      @Russell Duke yea, have been watching on flixzone for since december myself :D

    • @demetriusabel947
      @demetriusabel947 3 ปีที่แล้ว

      @Russell Duke definitely, I have been using flixzone for since november myself =)

  • @Yoko45454545
    @Yoko45454545 2 ปีที่แล้ว

    れcp
    Thank you for tech How to use rsell ! ,try RP2040 programming,

  • @koalalorenzo
    @koalalorenzo 3 ปีที่แล้ว

    I wish these guides were on Linux or macOS! :(

    • @KarstenJohansson
      @KarstenJohansson 3 ปีที่แล้ว

      I haven't done it *yet* with the pico, but rsh is pretty straightforward. Plug your pico into your Linux box, and if you don't get some type of notice of where it is, look in /var/log/messages or whatever to see what device Linux associates to it. Basically the same process as figuring out which drive is which if you have several newly connected. Once you have it, you can use rcp instead of rsh, which would be a lot fewer steps.

  • @muhammadhussain7976
    @muhammadhussain7976 3 ปีที่แล้ว

    Quite Informative!
    I was wondering though, would it not work with Thonny?

    • @roostertechchan
      @roostertechchan 3 ปีที่แล้ว

      Micropython works with Thonny very well. I don't see a reason why it won't work with Pico

    • @Core-Electronics
      @Core-Electronics  3 ปีที่แล้ว +1

      We have a Thonny guide coming out in the next couple of hours :) We just wanted to be sure the new public release of Thonny works the same way (pretty much does, so stay tuned!)

    • @Core-Electronics
      @Core-Electronics  3 ปีที่แล้ว +2

      Forgot to link to the Thonny video :) th-cam.com/video/_ouzuI_ZPLs/w-d-xo.html

  • @jonron3805
    @jonron3805 3 ปีที่แล้ว

    Cant seem to use the same technique in Macbook. Any person succeeded in doing this on MacOS?

    • @antlister
      @antlister 3 ปีที่แล้ว +1

      In the Mac terminal type `$ ls /dev/tty.*` to find the COM port being used. It will probably come back as `/dev/tty.usbmodem000000001`. So then to connect to rshell on Mac use `$ rshell -p /dev/tty.usbmodem000000001 --buffer-size 512`. Note that's a double dash before buffer-size. Note, I didn't count how many zeros there are on usb.modem00000001 here but make sure you do. The rest is the same. Enjoy!

    • @antlister
      @antlister 3 ปีที่แล้ว

      Also if you type `$ rshell -p /dev/tty.usbmodem000000001 --buffer-size 512 repl` you get straight into the repl to write your micropython!

  • @adithyasrinivas3694
    @adithyasrinivas3694 3 ปีที่แล้ว +1

    Not working properly

    • @adithyasrinivas3694
      @adithyasrinivas3694 3 ปีที่แล้ว +1

      it only works when script name is main.py

    • @Core-Electronics
      @Core-Electronics  3 ปีที่แล้ว +4

      That seems right - main.py is what is "run" when MicroPython reboots.
      Other file names would be useful for custom libraries and code; which could be included within main.py as needed.

    • @kp_kovilakam
      @kp_kovilakam 3 ปีที่แล้ว

      @@Core-Electronics Thanks for the clarification.