# OTA update for Raspberry Pi Pico

**URL:** <https://discuss.blues.com/t/ota-update-for-raspberry-pi-pico/1984>\
**Category:** Notecarrier B\
**Tags:** python\
**Created:** [February 24, 2024, 4:09pm UTC](https://discuss.blues.com/t/ota-update-for-raspberry-pi-pico/1984 "2024-02-24T16:09:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkauf](https://avatars.discourse-cdn.com/v4/letter/b/b4bc9f/32.png) [@bkauf](https://discuss.blues.com/u/bkauf)\
**Post date:** [February 24, 2024, 4:09pm UTC](https://discuss.blues.com/t/ota-update-for-raspberry-pi-pico/1984/1 "2024-02-24T16:09:43Z")

</div>

Hello,

I’m trying to setup over the air(OTA) updates for a Raspberry pi pico + notecard running circuit python. The code.py fie I would like to update is ~16Kb so I am attempting to do this via the [large file upload procedure.](https://dev.blues.io/guides-and-tutorials/notecard-guides/sending-and-receiving-large-binary-objects/?_gl=1*1ct597o*_ga*MTMzOTcyOTE0Ny4xNjk1NzI4NDg3*_ga_PJ7RGMWWBX*MTcwODc4NzIwNy4xMDMuMS4xNzA4Nzg3NDI5LjIzLjAuMA..&_ga=2.60424493.1243613755.1708783214-1339729147.1695728487#receiving-large-binary-objects)

I’m unsure of next steps with Circuit Python when it’s time to read the binary data as issuing a “req”: “card.binary.get” doesn’t seem to output anything. I was hoping I could load this binary into a variable and just save the variable to a file then restart the device. Any examples of OTA updates for Raspberry pi on circuit python would be great! Also the DFU documentation doesn’t include raspberry pi’s.

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [February 25, 2024, 3:25pm UTC](https://discuss.blues.com/t/ota-update-for-raspberry-pi-pico/1984/2 "2024-02-25T15:25:09Z")

</div>

Hi @bkauf,

Make sure your Notecard firmware is on at least v5.3.1 (I assume it is, but I just want to make sure!) and you’re following [these instructions](https://dev.blues.io/guides-and-tutorials/notecard-guides/sending-and-receiving-large-binary-objects/#receiving-binary-data-with-the-card-binary-apis) to use the card.binary APIs.

Normally I would suggest using [Outboard Firmware Update](https://dev.blues.io/guides-and-tutorials/notecard-guides/notecard-outboard-firmware-update/#notecard-outboard-firmware-update), but there are limitations on the Pico itself that prevent it from being supported.

Rob

---

<div class="post-metadata">

**Author:** ![bkauf](https://avatars.discourse-cdn.com/v4/letter/b/b4bc9f/32.png) [@bkauf](https://discuss.blues.com/u/bkauf)\
**Post date:** [February 25, 2024, 6:53pm UTC](https://discuss.blues.com/t/ota-update-for-raspberry-pi-pico/1984/3 "2024-02-25T18:53:01Z")

</div>

Hi Rob,

Thank you for the quick response. I am using v5.3.1. I’ve spent too many hours trying to troubleshoot and I cannot seem to get access to the downloaded data in the binary buffer of the nodecard.

The following code shows that the data has been loaded into the binary buffer but I cannot seem to access it. Any suggestions would be greatly appreciated.

```auto
req = {"req": "web.get"}
req["route"] = "updates"
req["binary"] = True
rsp = card.Transaction(req)
       
verifyDownload = card.Transaction({"req":"card.binary"})
print("Verify Download")
print(verifyDownload)
getFileData = card.Transaction({"req":"card.binary.get"})

print("Get File Data")
print(getFileData)

```

**Output**

```auto
Using transaction timeout of 30 seconds.
{"req":"card.binary","crc":"0002:21904900"}
{'status': '3955f35bcaa109fe75a1f3cd69d7d1e6', 'crc': '0002:2DB2CDC7', 'connected': True, 'max': 130554, 'cobs': 16353, 'length': 16288}
Verify Download
{'status': '3955f35bcaa109fe75a1f3cd69d7d1e6', 'crc': '0002:2DB2CDC7', 'connected': True, 'max': 130554, 'cobs': 16353, 'length': 16288}
Using transaction timeout of 30 seconds.
{"req":"card.binary.get","crc":"0003:e8b33053"}
{'crc': '0003:2C588317', 'status': '3955f35bcaa109fe75a1f3cd69d7d1e6'}
Get File Data
{'crc': '0003:2C588317', 'status': '3955f35bcaa109fe75a1f3cd69d7d1e6'}
publishSystemData finished ... 1708868887

```

Nothing else comes across the console. I’m expecting a flood of binary code but the above output is all I see.

---

<div class="post-metadata">

**Author:** ![bkauf](https://avatars.discourse-cdn.com/v4/letter/b/b4bc9f/32.png) [@bkauf](https://discuss.blues.com/u/bkauf)\
**Post date:** [February 25, 2024, 11:19pm UTC](https://discuss.blues.com/t/ota-update-for-raspberry-pi-pico/1984/4 "2024-02-25T23:19:26Z")

</div>

Quick update - I was able to break my payload file into multiple pieces and grab them with the web.get route manually not using the binary option. This seems to solve the use case I had.

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [February 27, 2024, 4:55pm UTC](https://discuss.blues.com/t/ota-update-for-raspberry-pi-pico/1984/5 "2024-02-27T16:55:14Z")

</div>

FYI if you’re using the [latest version of note-python](https://github.com/blues/note-python), there are card.binary helper functions you can use as well: [note-python/notecard/binary\_helpers.py at 3ecb772bd6b1a28d93bf9c0e45fd5a93ed241f9b · blues/note-python · GitHub](https://github.com/blues/note-python/blob/3ecb772bd6b1a28d93bf9c0e45fd5a93ed241f9b/notecard/binary_helpers.py)

Rob
