CodingArcher makes sense, we will try to push its priority higher. I believe that would work, especially with the help of encoding.
Thanks, Erik
store video on Oak-d localy?
Unfortunately we bought an OAK-1 POE in the hope that using the internal SD-Card for collection data would be possible. What is the actual state. I wasn't able to find any documantation on that. Would be a great fature. Mabe to store sole other data on the SD to use localized Recording (via connected GPS).
Hi FlorianRahe , This feature can be found at sdcard_support
branch on depthai-python, and an example can be found at script_jpeg_to_sdcard.py. I hope this helps!
Thanks, Erik
Hi FlorianRahe,
The script is set so it expects sd card at /media/mmcsd-0-0/(some index). Perhaps the path to your SD card is different for your machine, or the SD card has yet to be mounted.
Hope this helps,
Jaka
jakaskerl Sorry, I don't understan why for my machine? I want to use the sdcard which i put in the reader of the camera. That is the oak-1 poe. So since it should be a path on the device, it should always be the same. I changed the script and got the web-server running: there ist only /etc and /dev existing on the device. This should be completely independent from the host.
It seems, that I need to recomplibe the sdcard_support repository. Unfortunate it ist quite behind the actual branch. This is really sad, that it is not included in the main branch.
Hi FlorianRahe
Oh sorry, my bad, I assumed you were using SD on the host. It seems the branch is a bit problematic.
Let me know if recompiling works.
Thanks,
Jaka
FlorianRahe it should have prebuilt wheels. Are there any features required from the newer versions?
For all other: The prebuild wheels can be found at https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/depthai/ and one has to search for c2d04a3 (the commit number). With that wheel I got it working.
FlorianRahe alternatively, you can also checkout to the correct branch (in depthai-python) and call python examples/install_requirements.py
, which also fetches from artifacts.luxonis for the prebuilt wheels.
I'm somewhat really dissapointed. You are selling a device with sdcard slot, but in general the sdcard slot ist unusable.
I have code which is running in host and standalone mode on the main branch (not needing sdcard). But when I want to run the same code with the branch sdcard_support, the code only works in host mode. The only thing the code is doing: Serving the file system. So about nothing what could break. A nice side effect: The device is soft bricked after flashing the application.
I have one idea for a reason. Running the code in standalone in the main branch, the webserver serves the directory /media/mmcsd-0-0/ with the application file in it. In host mode this is not existing. But this is also the folder where the sdcard is mounted. So i think there is a conflict with that path and possibly the application cannot be loaded, since its not on the sdcard, which is now mounted at that path.
import time
import depthai as dai
# Create pipelinepipeline = dai.Pipeline()
# Define source and output
scriptServer = pipeline.create(dai.node.Script)
# Properties
scriptServer.setProcessor(dai.ProcessorType.LEON_CSS)
scriptServer.setScript("""
import http.server
import socketserver
import socket
import fcntl
import struct
import os
def get_ip_address(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_ntoa(fcntl.ioctl(
s.fileno(),
-1071617759, # SIOCGIFADDR
struct.pack('256s', ifname[:15].encode())
)[20:24])
# Note: `chdir` here will prevent unmount, this should be improved!
# os.chdir('/media/mmcsd-0-0/')
PORT = 80
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
ip = get_ip_address('re0')
node.warn(f'===== HTTP file server accessible at: http://{ip}')
httpd.serve_forever()""")
flash = True
# Flash the pipeline
if flash:
(f, bl) = dai.DeviceBootloader.getFirstAvailableDevice()
bootloader = dai.DeviceBootloader(bl)
progress = lambda p: print(f'Flashing progress: {p * 100:.1f}%')
bootloader.flash(progress, pipeline)
else:
# Connect to device and start pipeline
with dai.Device() as device:
device.startPipeline(pipeline)
print('======== Press C to capture JPEG images to SDcard')
while True:
key = input()[0]
if key == ord('q'):
break
time.sleep(1)
Hi FlorianRahe ,
We apologize for the inconvenience, if you are dissapointed with your purchase you can write to support@luxonis.com to get a refund. Alternatively, you could write feature request on depthai-core
repo to update this branch to the latest. It might be that sd-card path is clashing with nor/emmc flash, I am not sure.
Thanks, Erik
Hi Capen , We have an exmaple here: https://github.com/luxonis/depthai-python/blob/sdcard_support/examples/Script/script_jpeg_to_sdcard.py
Note it's not mainlined yet (on special branch), that's why you couldn't find any docs about it.
- Edited
erik ok. I have this error. I ran the branch seperately in a virtual environment and got this error:
depthai-python/examples/Script$ python3 script_jpeg_to_sdcard.py
[1844301001AEBD0F00] [88.103] [system] [warning] Device contains calibration data of version 1437204487 which is not supported in this version of depthai
======== Press C to capture JPEG images to SDcard
[1844301001AEBD0F00] [93.378] [Script(4)] [warning] Saving to SDcard: /media/mmcsd-0-0/1000.jpg
[1844301001AEBD0F00] [93.379] [Script(4)] [critical] FileNotFoundError: [Errno 2] N: '/media/mmcsd-0-0/1000.jpg'
At:
<script>(15): <module>
could you please suggest whats wrong,.