Skip to content

RajkumarGara/PicoScriptDeployer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This project automatically sends Python code to the Pico-W when it connects to the Raspberry Pi. Running PicoScriptDeployer.py fetches the Wi-Fi SSID, password and IP-address from the Pi and saves them in config.txt, without overwriting existing details if new ones aren't found. The script waits for a Pico connection. Once a Pico is connected to the Pi, it updates the Wi-Fi credentials in main.py with the details from "config.txt" and then transfers the updated code to the Pico. This project is an extension for pico-network-serial-port.

Installation of Prerequisites

  • Open terminal in Raspberry Pi and enter the below commands to install rshell.
    sudo apt update
    mkdir ~/python-environments
    cd ~/python-environments
    python -m venv rshell-env
    source ~/python-environments/rshell-env/bin/activate
    pip install rshell

Running the code

  • Copy PicoScriptDeployer.py, config.txt, and main.py (code that needs to run on Pico) to the path ~/python-environments.
  • Open terminal on the Raspberry Pi and enter below commands to run the code.
    cd ~/python-environments
    source ~/python-environments/rshell-env/bin/activate
    python PicoScriptDeployer.py

Setup

  • Connect Pico-W (the target board) to the Pi through usb cable. pi pico terminal

Developer Notes

  • The main.py will be deployed only to the most recently connected Pico if multiple Picos are attached to the Pi.
  • If PicoScriptDeployer.py cannot detect your Wi-Fi details, you can manually update config.txt with the correct credentials.
  • After the code is deployed to the Pico, it will automatically reset and run the code.
  • Files in the extras folder are optional for this project. See the points below for more details.

About

Deploy scripts to the Pico connected to pi.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages