Commit b220e1df authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Merge branch 'master' of github.com:Elphel/elphel-init

parents 29e7a249 ffe56137
Loading
Loading
Loading
Loading

src/init_elphel393.py

100644 → 100755
+20 −1
Original line number Original line Diff line number Diff line
@@ -137,6 +137,11 @@ def start_gps_compass():
    """
    """
    shout("start_gps_compass.php")
    shout("start_gps_compass.php")
    
    
def disable_gpio_10389():
    gpio_10389 = "/sys/devices/soc0/elphel393-pwr@0/gpio_10389"
    shout("echo '0x101' > "+gpio_10389) #power on
    shout("echo '0x100' > "+gpio_10389) #power off
    time.sleep(1)


#main
#main


@@ -165,6 +170,11 @@ if len(sys.argv) > 1:
#pre
#pre
os.mkdir('/var/volatile/html')
os.mkdir('/var/volatile/html')


#need to disable fan for eyesis
if switch['eyesis']!=0:
    print('Eyesis mode: turn off gpio 10389')
    disable_gpio_10389()

#0
#0
if switch['usb_hub']==1:
if switch['usb_hub']==1:
    print('Initialize USB hub')
    print('Initialize USB hub')
@@ -213,12 +223,14 @@ if switch['eyesis']!=0:
        if sysfs_content=="mt9p006":
        if sysfs_content=="mt9p006":
            shout("wget -O - \"localhost/framepars.php?sensor_port="+str(i)+"&cmd=min_init\"")
            shout("wget -O - \"localhost/framepars.php?sensor_port="+str(i)+"&cmd=min_init\"")
    time.sleep(2)
    time.sleep(2)
    shout("cat /proc/interrupts")
    
    
    for i in range(4):
    for i in range(4):
        sysfs_content = init_port_readsysfs("sensor"+str(i)+"0")
        sysfs_content = init_port_readsysfs("sensor"+str(i)+"0")
        if sysfs_content=="mt9p006":
        if sysfs_content=="mt9p006":
            shout("wget -O - \"localhost/framepars.php?sensor_port="+str(i)+"&cmd=eyesis_trig\"")
            shout("wget -O - \"localhost/framepars.php?sensor_port="+str(i)+"&cmd=eyesis_trig\"")
    time.sleep(2)
    time.sleep(2)
    shout("cat /proc/interrupts")
    
    
else:
else:
    print(sys.argv[0]+": auto exposure and auto white balance")
    print(sys.argv[0]+": auto exposure and auto white balance")
@@ -269,4 +281,11 @@ else:
shout("mkdir /var/volatile/state")
shout("mkdir /var/volatile/state")


# start temperature monitor and let it control fan (set 'off' to disable fan control)
# start temperature monitor and let it control fan (set 'off' to disable fan control)
if switch['eyesis']!=0:
    print("Eyesis: fan off")
    shout("tempmon.py --control_fan off &")
else:
    print("Fan on")
    shout("tempmon.py --control_fan on &")
    shout("tempmon.py --control_fan on &")
    
print("init_elphel393.py DONE")