Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SD card support #445

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Add SD card support #445

wants to merge 4 commits into from

Conversation

alex-luxonis
Copy link
Collaborator

@alex-luxonis alex-luxonis commented Dec 3, 2021

Accessible from Script nodes usually at:
/media/mmcsd-0-0 - first partition
/media/mmcsd-0-1 - second partition
...
The partition(s) should be pre-formatted as FAT32.
Note the Script node must set: .setProcessor(dai.ProcessorType.LEON_CSS)

An example is added: examples/Script/script_jpeg_to_sdcard.py

  • displays an uncompressed preview stream of RGB camera at 640x360
  • creates a HTTP server listing all files on the first partition of the SDcard
  • when C is pressed, saves a 12MP JPEG capture to SDcard, file names starting from 1000.jpg

When the device is shut down gracefully, the POSIX sync() function is called.
Additionally, an auto-unmount for /media/mmcsd-0-0 is attempted; to succeed, it needs to file or directory handles to be left opened (e.g. os.chdir('/media/mmcsd-0-0') won't allow unmounting).

Related PR: luxonis/depthai-core#293

Note for non-PoE boards (or PoE boards running over USB):

Currently a separate branch is needed: sdcard_no_eth , diff: sdcard_support...sdcard_no_eth
(the HTTP server will not be enbled there)

  /media/mmcsd-0-0    -- first partition
  /media/mmcsd-0-1    -- second partition
  ...
The partition(s) should be pre-formatted as FAT32.
Note the Script node must set: .setProcessor(dai.ProcessorType.LEON_CSS)
- displays an uncompressed preview stream of RGB camera at 640x360
- creates a HTTP server listing all files on the first partition of the SDcard
- when `C` is pressed, saves a 12MP JPEG capture to SDcard, file names starting from 1000.jpg
No file handles should be left opened for unmount to succeed, not even `os.chdir('/media/mmcsd-0-0')`.
Anyway, a `sync()` is attempted first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant