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

Backup Camera on Startup #15

Open
Xantha123 opened this issue Oct 3, 2023 · 9 comments
Open

Backup Camera on Startup #15

Xantha123 opened this issue Oct 3, 2023 · 9 comments

Comments

@Xantha123
Copy link

Hello,
is it possible with this firmware to set the default camera on startup as the rear camera? This would be very helpful.
Thank you

@350d
Copy link
Owner

350d commented Oct 6, 2023

Try this script https://github.com/350d/70Mai_A800S_Firmware/blob/main/Scripts/autorun_camera_select.sh
Im not sure about rear value, try back also

@Xantha123
Copy link
Author

Hey, thanks for the reply. I tried rear and back. Neither seemed to work for me. I have the autrun script placed in the root sd card folder. I am also on the newest custom firmware.

@350d
Copy link
Owner

350d commented Oct 6, 2023

Same thing on next reboot?

@Xantha123
Copy link
Author

Yes, i tried a second reboot aswell with both rear and back. Can try again though to be sure. The autorun scripts are changeable without reflashing the firmware, right?

@350d
Copy link
Owner

350d commented Oct 6, 2023

Sure, you can update the scripts any way you won't to.
Maybe this front/rear just for RTSP preview stream settings...

@Xantha123
Copy link
Author

Is there any way to be certain what it is called in the preview?

@Xantha123
Copy link
Author

I just tried to use the network_off script. It does not seem to work for me. If i check in the camera settings, it says wifi is on. Seems like there might be a problem with executing scripts in general for me?

@beY6ai7u
Copy link

beY6ai7u commented Mar 24, 2024

Exactly the same problem... telnet commands do work for some things, but I haven't managed to change the camera feed on the screen. I've tried the following, and different combinations of "back" "rear" "0" "1".

echo "Source back" > /tmp/cardv_fifo
echo "Source rear" > /tmp/cardv_fifo
nvconf set 0 Camera.Preview.Source.1.Camid back
nvconf set 0 Camera.Preview.Source.1.Camid rear

The only somehow interesting thing i found was that when pressing the physical button on the unit to switch the screens, this appears in the log file (/tmp/cardv.log, referenced in /bootconfig/demo.sh)

<<fifo_data =disp switch 1
hand fifo =disp switch 1
disp cmd [2052] mode [0]
CarDV_DispStopPreview ok
disp cmd [2051] mode [1]
jiangc CarDV_DispStartPreview  u8CamId:1 
 jiangc g_CamSwitchBySrcChange :1 FirstCamSwitchPlay:0   eDispMode:1 
<<fifo_data =audioplay 1 /customer/audio/Button.wav
hand fifo =audioplay 1 /customer/audio/Button.wav
audio:3,0, 3
<<fifo_data =disp switch 0
hand fifo =disp switch 0
disp cmd [2052] mode [1]
CarDV_DispStopPreview ok
disp cmd [2051] mode [0]
jiangc CarDV_DispStartPreview  u8CamId:0 
 jiangc g_CamSwitchBySrcChange :1 FirstCamSwitchPlay:1   eDispMode:0 
<<fifo_data =audioplay 1 /customer/audio/Button.wav
hand fifo =audioplay 1 /customer/audio/Button.wav
audio:3,0, 3

No idea what to do with it though, any help or cue appreciated!

edit:

got it working with

echo "disp switch 1" > /tmp/cardv_fifo

so just put that as an autorun file on the SD card (e.g. autorun_rearcamera.sh) and it shows the rear camera on boot :)

#!/bin/sh

##############################
## CGI_CMD
##############################
export PATH=/sbin:/bin:/customer/wifi:/usr/bin:/usr/sbin
export LD_LIBRARY_PATH=/lib:/customer/wifi/lib
REC_STATUS=/tmp/rec_status
VIDEOPARAM=/tmp/cardv_fifo
FW_SETENV=/config/bin/fw_setenv

##############################

sleep 3
echo "disp switch 1" > /tmp/cardv_fifo # display the rear
sync

@Xantha123
Copy link
Author

Oh wow! Thought I could not change it and gave up since I do not know much about programming. Will try this tomorrow. Hope this works for me too. This would be awesome. Thanks!

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

No branches or pull requests

3 participants