Getting Started with REPL on the Raspberry Pi Pico using Rshell

In the ever-expanding realm of embedded systems and microcontrollers, the Raspberry Pi Pico W has carved a niche for itself as a versatile and affordable option for DIY projects, learning, and prototyping. Its compact size, powerful capabilities, and extensive community support make it an ideal choice for both beginners and experienced tinkerers. However, working with microcontrollers often involves a fair share of challenges, especially when it comes to managing files, deploying code, and interacting with the device. This is where rshell comes to the rescue.

rshell, a remote MicroPython shell tool, empowers developers to effortlessly communicate with their microcontrollers, manage files, and execute commands as if they were working directly on the device. Whether you're a hobbyist wanting to upload scripts without the hassle of physically connecting to your Raspberry Pi Pico W, or a professional seeking an efficient way to deploy firmware, rshell can significantly streamline your workflow.

In this blog post, we'll embark on a journey to discover the capabilities of rshell and learn how it can be seamlessly integrated with the Raspberry Pi Pico W. We'll explore its installation, set-up, and walk through practical examples of managing files and running scripts. By the end, you'll have a valuable addition to your toolkit that will not only save you time but also broaden the horizons of what you can achieve with your Raspberry Pi Pico W.

So, buckle up and get ready to uncover the world of remote microcontroller management with rshell. Whether you're working on robotics, home automation, or simply enhancing your programming skills, the insights shared in this blog will undoubtedly empower you to make the most out of your Raspberry Pi Pico W projects.

Before reading the remainder, be sure to subscribe and support the channel if you have not!

Subscribe:

Youtube

Support:

https://www.buymeacoffee.com/mmshilleh

 

Prerequisites:

  • Python 3 on your computer
  • Raspberry Pi Pico or Pico W
  • MicroPython installed on your Raspberry Pi Pico W

Step 1-) Pip install rshell

  • Since rshell is a Python package we can simply run -> pip install rshell , in the terminal or cmd of your computer

Step 2-) Enter rshell

Entering rshell is very easy after you have it installed, ensure your Raspberry Pi Pico W is plugged in. Simply type the command rshell in your terminal to enter the environment.

There are many commands you can run in rshell on the Pico, type in help, to see what commands you have available. We will be using a command to allow us to write live code to prototype quickly on the device in MicroPython.

To run live interactive code on your device, type the command repl, you will see three right arrows “>>>” pop up, meaning you can start scripting. We will write a simple program to blink the LED on the Pico W. Type in the following line by line:

from machine import Pin
led = Pin("LED", Pin.OUT)
led.toggle()

Running this should turn off/on your LED which is confirmation that this works! Pretty cool.

Conclusion:

For more on how to use REPL please watch the Youtube video above where I go over how to move files onto the device. Overall REPL can be convenient for quick prototyping and some people may prefer coding in such an environment, believe it or not. Hope you learned something new and simple. I surely did.

Create a free account to access full content.

All access to code and resources on ShillehTek.

Signup Now

Already a member? Sign In

Explore More on Our Blog

Create Tabular Product Descriptions on Your Shopify Store

Create Tabular Product Descriptions on Your Shopify Store

Enhance your Shopify store's product pages with our comprehensive guide on implementing tabular descriptions. Learn how to add a...

SSH Into Raspberry Pi with Tailscale VPN

SSH Into Raspberry Pi with Tailscale VPN

Effortlessly access and manage your Raspberry Pi from anywhere using Tailscale's secure mesh VPN.

Send Email with Lua and the ESP32

Send Email with Lua and the ESP32

In this tutorial, we delve into sending emails with the ESP32-S3 using Lua, focusing on the Xedge IDE's built-in SMTP...

How to Code with Lua on ESP32 with XEdge32

How to Code with Lua on ESP32 with XEdge32

Learn how to set up Xedge32 and start coding on the ESP32-S3 with Lua programming!

Stream Audio From Raspberry Pi to Local Computer

Stream Audio From Raspberry Pi to Local Computer

Discover the simplicity of streaming live audio directly from a USB microphone connected to your Raspberry Pi to...

SSH Raspberry Pi via Cell Phone

SSH Raspberry Pi via Cell Phone

This beginner-friendly guide will walk you through remotely controlling your Raspberry Pi using SSH through your cell phone.

Remotely Control Raspberry Pi via SSH from External Network

Remotely Control Raspberry Pi via SSH from External Network

Learn how to SSH into your Raspberry Pi from any network. This is critical in IoT since you can control...

Stream Video from Raspberry Pi Camera to YouTube Live

Stream Video from Raspberry Pi Camera to YouTube Live

Learn how to stream to YouTube from a Raspberry Pi Camera.

How to Connect BH1750 with Arduino: Measure Ambient Light

How to Connect BH1750 with Arduino: Measure Ambient Light

Learn how to measure ambient light for smart lighting control using Arduino and the BH1750 Light Intensity Module.

How to Connect MPU9250 and Raspberry Pi (Part 2 - Calibration)

How to Connect MPU9250 and Raspberry Pi (Part 2 - Calibration)

Learn how to calibrate the MPU9250 in Python with the Raspberry Pi to get more accurate acceleration and gyroscopic...

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.