Accessing SD card on a Pi connected to dev kit

Hi, we have a raspberry pi connected to the smart mooring through the dev kit and need to access the sd card on the pi. Is there any way to do this? Ideally over the Internet but I think that’s not possible - is there at least a way to access it from spotter on the surface - maybe through the usb-c? We just really want to avoid disconnecting the mooring line to write new data or retrieve large .wav files.


Hey there a quick clarifying question: are you hoping to access the SD card that is installed on the RasPi or the SD card that is in Spotter’s eBox?


1 Like

Yes, we’re looking for any way we can access the data on the SD card on the Pi.

Here some of the software components I imagine you would need to build in order to accomplish this.

On the Pi:

  • code to write to and read from the Pi’s SD card
  • code for communicating with the dev kit

On the Bristlemouth dev kit:

  • code for communicating with the Pi
  • expose a service with a topic string and a handler function by calling bm_service_register. See the echo service as an example, and we’ll be creating a guide on services in the coming months.

You know your own use case best, but if I’m guessing, maybe the request data could be commands like “count” to get the number of wav files, “list” to get a list of the filenames, “get [filename]” to retrieve the file contents. You’ll have to manage the file transfer in chunks of 1024 bytes which is the current limit on a service response.

One of the things we’d like accomplish this year toward the goal of making Bristlemouth firmware more accessible is making an easy-to-use high-level file transfer protocol. When we get there, this part of your project becomes easier. I discussed this yesterday in the community update. @zack_j will post the recording soon.

The last thing you’d need would require product development here at Sofar Ocean to enable arbitrary Bristlemouth pub-sub communication via Spotter’s USB console. It’s certainly in our sights but not on the short term roadmap. An alternative would be a separate Bristlemouth node, even just an unmodified dev kit, that is close enough to the surface to pull onto the deck and connect USB while leaving the mooring anchored. From there you could make requests to the service exposed on the downstream dev kit.

I hope that helps you envision what would be required to accomplish your goal! Good luck!

The Spotter can also be told to act like an SD card reader, when connected to a computer (like a Pi).

Connect the Spotter’s USB-C port to a computer. Then, connect over USB Serial terminal so you can issue one of the following commands, depending on your use case:

  • Use sd usb to mount SD card in read only mode (Use this unless you have to write to files!)
  • Use sd usbrw to mount SD card in read/write mode

Please note:

  • Due to many reasons, the SD card can only be accessible by either the logging system or USB.
  • Mounting SD card over USB will unmount from firmware (no SD logs until next reset).
  • If the SD card has been mounted over USB, the device will reboot when USB is disconnected.