Softata: Towards OTA Over The Air Sketch Updates - 5 (KISS Principle)
softata rpipico firmata arduino csharp grove swagger asp.net ota wdt watchdog
Softata: Keep It Simple Stupid! A quick and easy approach to getting started with Softata. Softata facilitates dynamically orchestrating a Raspberry Pi Pico W over WiFi from a .NET context. It can be driven from a local .NET Console or Blazor app. It can also be orchestrated from a Swagger or Blockly interface to a local web service. These last two can also be accessed from an existing Azure Static Web.
THIS PAGE IS INCOMPLETE. PLEASE WATCH THIS SPACE!
Nb: Local here means running on the same local network.
Getting Started
- Access the Softata Azure website softatawebapii azure websites
- Get the .zip file from Get the SoftataOTA bin and related batch files for upload without IDE: Download as zip
- Extract it into a folder.
KISS
With a RPi Pico W provisioned for Arduino, Softata can be uploaded directly over USB using a given batch file and downloadable prebuilt image. With tunnelling, it can be exposed to the Softata Azure Web site where Blockly can be use to drive it. There are a number of example programs in the Blockly site that can be used. This is all without needing the Arduino IDE.
If you have already installed the earlephilhower Arduino BSP onto your Pico W and you know its IP Address on the local WiFi network, you can skip the next section. Expand the next section if you need either:
BSP and IP Address
## Spoiler This does require that the Pico has previously been provisioned with the Arduino BSP via the Arduino IDE such that a sketch can be deployed to it from the IDE. Youcan provision the device via teh Arduino IDE: [Provision of RPi Pico W with Arduino BSP (_earlephilhower version_)](https://github.com/earlephilhower/arduino-pico?tab=readme-ov-file#installation) **But lets avoid the IDE if we can (KISS):** Connect the Pico via USB. ub2 will be used to upload. - Connect the USB cable to the Pico - Hold the BootSel button on the Pico and insert the USB cable into the PC. - D drive (or similar) will now become available - Copy ```SoftataOTA.ino.uf2``` to D (or whatever) drive. It will upload and flash the image! ***Simples*** > Issue: We need to get the WiFi connection details into that image in a "generic" manner. Also, you need the Pico W's WiFi IP Address in the local network. If you don't have it then run a Sketch that connects to the local WiFi and get its address. _(You will need the ID for this). For example, run this sketch: ```cpp #include> Past this point you don't need the Arduino IDE at all Nb: Also we don't need the COM port, and we don't need to Pico W's IP Address for getting started. ## ------------------------------------------------------ ## Continuing 1. Open a cmd terminal to the folder where the download from Azure was expanded. 2. Connect the Pico via USB. ub2 will be used to download. - Connect the USB cable to the Pico - Hold the BootSel button on the Pico and insert the USB cable into the PC. 3. Run the batch file ```USBSerial-pythoninpath.bat``` in the terminal. > Actually, this just repeated the previous upload! The Serial messages have been disabled _(actually, all Serial.print etc statements just invoke a 100ms delay)_ in this image so you will only see the the InBuilt LED flash. The serial flash terminal output: ``` USB-Serial uf2 deployment of (previously) built sketch uf2 Expecting python3 to be in Path Expecting the built sketch uf2 in Sketch folder\ota Expecting the uf2conv.py from tools in ota folder Also expect pyserial folder from tools in ota folder Remove device from USB, hold down BOOTSEL button, plug in USB, release BOOTSEL button. =================================================== Sketch: SoftataOTA Sketch Folder: .\SoftataOTA serialPort: uf2 =================================================== . Press any key to continue . . . Converting to uf2, output size: 1387520, start address: 0x2000 Scanning for RP2040 devices Flashing D: (RPI-RP2) Wrote 1387520 bytes to D:/NEW.UF2 Press any key to continue . . . ``` #### The (Serial) Boot Flash sequence - Booting: 5 short pulses - Got WiFi: 3 long pulses - Ready: 8 ultra short pulses - Finally you get the extra long flashes - Note that these are shorter when Softata apps are connected. > From now on you can use OTA to upload the bin to the Pico. Click below to expand.
OTA Boot
## OTA Boot Run the batch file ```OTA-pythoninpath.bat``` in the terminal. You will be prompted for the IP Address. ``` OTA deployment of (previously) built sketch bin Expecting python3 to be in Path Expecting the built sketch bin in Sketch folder\ota Expecting the espota.py in ota folder from tools folder: Enter ipaddress for device ... Or edit in this batch file =================================================== What IPAddress? Default: "192.168.0.20" Sketch: SoftataOTA Sketch Folder: .\SoftataOTA Device IPAdress: "192.168.0.20" OTA Port: "2040" =================================================== . Press any key to continue . . . Uploading............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ Complete Press any key to continue . . . PS C:\Users\david\Downloads\ota\ota> ``` #### The OTA Flash Sequence - Start OTA: 4 Ultra Short Flashes - _Error: 6 Ultra Long pulses_ - End OTA: 4 long pulses - Ready: 8 ultra short pulses - Then you get the Boot Flash sequence as its rebootingTopic | Subtopic | |
Next: > | Sample RPi Pico Sketches | Flash Setting and OTA Updates |
This Category Links | ||
Category: | Softata Index: | Softata |
Next: > | Softata | Arduino Startup Options |
< Prev: | Softata | Towards OTA Over The Air Sketch Updates - 3 (OTA Implementation) |