Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-web-393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-web-393
Commits
e2b98afe
Commit
e2b98afe
authored
May 11, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+system information
parent
5dae054c
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
935 additions
and
2 deletions
+935
-2
Makefile
Makefile
+1
-1
Makefile
src/diagnostics/Makefile
+21
-0
diagnostics.css
src/diagnostics/diagnostics.css
+48
-0
diagnostics.js
src/diagnostics/diagnostics.js
+520
-0
diagnostics.php
src/diagnostics/diagnostics.php
+274
-0
index.html
src/diagnostics/index.html
+61
-0
index.html
src/multicam/index.html
+5
-0
multicam.css
src/multicam/multicam.css
+4
-0
multicam.js
src/multicam/multicam.js
+1
-1
No files found.
Makefile
View file @
e2b98afe
# Runs 'make', 'make install', and 'make clean' in specified subdirectories
SUBDIRS
:=
src/php_top src/python_tests src/debugfs-webgui src/jp4-canvas src/update src/eyesis4pi src/index src/pointers src/snapshot src/jp4-viewer src/photofinish src/multicam
# src1
SUBDIRS
:=
src/php_top src/python_tests src/debugfs-webgui src/jp4-canvas src/update src/eyesis4pi src/index src/pointers src/snapshot src/jp4-viewer src/photofinish src/multicam
src/diagnostics
# src1
INSTALLDIRS
=
$
(
SUBDIRS:%
=
install-%
)
CLEANDIRS
=
$
(
SUBDIRS:%
=
clean-%
)
...
...
src/diagnostics/Makefile
0 → 100644
View file @
e2b98afe
DOCUMENTROOT
=
$(DESTDIR)
/www/pages
OWN
=
-o
root
-g
root
INSTDOCS
=
0644
INSTALL
=
install
DOCS
=
index.html
\
diagnostics.js
\
diagnostics.css
PHP_SCRIPTS
=
diagnostics.php
all
:
@
echo
"make all in src"
install
:
@
echo
"make install in src"
$(INSTALL)
$(OWN)
-d
$(DOCUMENTROOT)
$(DOCUMENTROOT)
/diagnostics
$(INSTALL)
$(OWN)
-m
$(INSTDOCS)
$(DOCS)
$(DOCUMENTROOT)
/diagnostics
$(INSTALL)
$(OWN)
-m
$(INSTDOCS)
$(PHP_SCRIPTS)
$(DOCUMENTROOT)
clean
:
@
echo
"make clean in src"
src/diagnostics/diagnostics.css
0 → 100644
View file @
e2b98afe
#display_general
,
#display_pars
,
#display_ts
{
padding
:
5px
;
}
#gen_table
th
,
#pars_table
th
,
#ts_table
th
{
padding
:
2px
5px
;
text-align
:
center
;
border
:
1px
solid
rgb
(
150
,
150
,
150
);
}
#gen_table
td
{
padding
:
2px
5px
;
text-align
:
center
;
border
:
1px
solid
rgb
(
150
,
150
,
150
);
}
#pars_table
td
,
#ts_table
td
{
padding
:
0px
5px
;
border
:
1px
solid
rgb
(
150
,
150
,
150
);
}
.center
{
text-align
:
center
;
}
.right
{
text-align
:
right
;
}
.left
{
text-align
:
left
;
}
h4
{
padding
:
0px
5px
;
}
.vtop
{
vertical-align
:
top
;
}
.timestamps
{
font-size
:
0.9em
;
}
.framenumbers
{
font-size
:
0.9em
;
}
\ No newline at end of file
src/diagnostics/diagnostics.js
0 → 100644
View file @
e2b98afe
This diff is collapsed.
Click to expand it.
src/diagnostics/diagnostics.php
0 → 100644
View file @
e2b98afe
<?php
// GLOBALS
// path to sysfs for port scanning
$portspath
=
"/sys/devices/soc0/elphel393-detect_sensors@0"
;
// total number of ports in 10393
$nports
=
4
;
$muxports
=
3
;
$port0
=
2323
;
$ports
=
getports
();
$sample_port
=
get_sample_port
(
$ports
);
$master_port
=
elphel_get_P_value
(
$sample_port
,
ELPHEL_TRIG_MASTER
);
//print("<pre>");
//print_r($ports);
//print("sample port = ".$sample_port);
$res
=
""
;
$res
.=
"<camera ip='"
.
$_SERVER
[
'SERVER_ADDR'
]
.
"'>
\n
"
;
$res
.=
"
\t
<master_port>"
.
$master_port
.
"</master_port>
\n
"
;
$res
.=
"
\t
<systime>"
.
get_system_time
()
.
"</systime>
\n
"
;
$res
.=
"
\t
<systimestamp>"
.
time
()
.
"</systimestamp>
\n
"
;
$res
.=
"
\t
<uptime>"
.
get_uptime
()
.
"</uptime>
\n
"
;
$res
.=
"
\t
<temperature>"
.
get_temperature
()
.
"
\t
</temperature>
\n
"
;
$res
.=
"
\t
<storage>"
.
check_storage
()
.
"
\t
</storage>
\n
"
;
$res
.=
"
\t
<recorder name='camogm'>"
.
check_camogm_running
()
.
"</recorder>
\n
"
;
$res
.=
"
\t
<gps>"
.
check_gps
(
$master_port
)
.
"
\t
</gps>
\n
"
;
for
(
$i
=
0
;
$i
<
count
(
$ports
);
$i
++
){
$s
=
implode
(
', '
,
$ports
[
$i
][
'sensors'
]);
$m
=
$ports
[
$i
][
'mux'
];
$res
.=
"
\t
<port index='
$i
' sensor='
$s
' mux='
$m
'>"
.
get_port_info
(
$i
)
.
"
\t
</port>
\n
"
;
}
$res
.=
"</camera>
\n
"
;
// allow CORS
header
(
'Access-Control-Allow-Origin: *'
);
$xml
=
"<?xml version='1.0' standalone='yes'?>
\n
"
;
$xml
.=
"<Document>
\n
"
;
$xml
.=
$res
;
$xml
.=
"</Document>
\n
"
;
print
(
$xml
);
//functions
function
check_camogm_running
(){
$camogm_running
=
false
;
exec
(
'ps | grep "camogm"'
,
$arr
);
$check
=
implode
(
"<br/>"
,
$arr
);
foreach
(
$arr
as
$line
){
$result
=
preg_match
(
'/grep/'
,
$line
);
if
(
!
$result
)
{
$camogm_running
=
true
;
}
}
if
(
$camogm_running
)
$res
=
"on"
;
else
$res
=
"off"
;
return
$res
;
}
function
getports
(){
global
$nports
,
$muxports
,
$portspath
,
$port0
;
$res
=
array
();
for
(
$i
=
0
;
$i
<
$nports
;
$i
++
){
$subres
=
array
();
$subres
[
'mux'
]
=
read_port_file
(
$portspath
.
"/port_mux
{
$i
}
"
);
$subres
[
'sensors'
]
=
array
();
for
(
$j
=
0
;
$j
<
$muxports
+
1
;
$j
++
){
array_push
(
$subres
[
'sensors'
],
read_port_file
(
$portspath
.
"/sensor
{
$i
}{
$j
}
"
));
}
array_push
(
$res
,
$subres
);
}
return
$res
;
}
function
read_port_file
(
$file
){
$v
=
""
;
if
(
is_file
(
$file
)){
$v
=
trim
(
file_get_contents
(
$file
));
}
return
$v
;
}
function
get_sample_port
(
$a
){
$sample_found
=
false
;
// errors are not expected here
//$res = -1;
$res
=
0
;
foreach
(
$a
as
$k0
=>
$port
){
$b
=
$port
[
'sensors'
];
foreach
(
$b
as
$k1
=>
$sensor
){
if
(
$sensor
!=
'none'
){
$sample_found
=
true
;
break
;
}
}
if
(
$sample_found
){
$res
=
$k0
;
break
;
}
}
return
$res
;
}
function
check_storage
(){
$names
=
array
();
$regexp
=
'/([0-9]+) +(sd[a-z0-9]+$)/'
;
exec
(
"cat /proc/partitions"
,
$partitions
);
// the first two elements of an array are table header and empty line delimiter, skip them
for
(
$i
=
2
;
$i
<
count
(
$partitions
);
$i
++
)
{
// select SATA devices only
if
(
preg_match
(
$regexp
,
$partitions
[
$i
],
$name
)
==
1
)
{
$names
[
$name
[
2
]]
=
$name
[
1
];
$j
++
;
}
}
//print_r($names);
$res
=
""
;
foreach
(
$names
as
$name
=>
$size
){
if
(
preg_match
(
'/^sd[a-z]$/'
,
$name
,
$matches
))
{
$dev
=
$matches
[
0
];
$res
.=
"
\n\t\t
<device name='
$dev
' size='
$size
'>
\n
"
;
foreach
(
$names
as
$partition
=>
$psize
){
if
(
preg_match
(
'/^'
.
$dev
.
'[0-9]+$/'
,
$partition
)){
$res
.=
"
\t\t\t
<partition name='
$partition
' size='
$psize
'></partition>
\n
"
;
}
}
$res
.=
"
\t\t
</device>
\n
"
;
}
}
return
$res
;
}
function
check_gps
(
$port
){
$circbuf_pointers
=
elphel_get_circbuf_pointers
(
$port
,
1
);
$pointer
=
$circbuf_pointers
[
count
(
$circbuf_pointers
)
-
1
];
$exif
=
elphel_get_exif_elphel
(
$port
,
$pointer
[
'exif_pointer'
]);
if
((
isset
(
$exif
[
'GPSLongitude'
]))
&&
(
isset
(
$exif
[
'GPSLatitude'
]))){
$res
=
"
\n
"
;
$res
.=
"
\t\t
<lat>"
.
$exif
[
'GPSLatitude'
]
.
"</lat>
\n
"
;
$res
.=
"
\t\t
<lon>"
.
$exif
[
'GPSLongitude'
]
.
"</lon>
\n
"
;
}
else
{
$res
=
"N/A"
;
}
return
$res
;
}
function
get_system_time
(){
$res
=
exec
(
'date'
);
return
$res
;
}
function
get_uptime
(){
$res
=
exec
(
'uptime'
);
$res
=
trim
(
$res
);
$res
=
preg_replace
(
'/\s+/'
,
' '
,
$res
);
$res
=
explode
(
' '
,
$res
);
$out
=
trim
(
$res
[
2
],
','
);
return
$out
;
}
function
get_temperature
(){
$t_cpu
=
round
(
floatval
(
trim
(
file_get_contents
(
"/tmp/core_temp"
))),
1
);
$t_10389
=
""
;
$t_sda
=
""
;
$t_sdb
=
""
;
$temp1_input
=
"/sys/devices/soc0/amba@0/e0004000.ps7-i2c/i2c-0/0-001a/hwmon/hwmon0/temp1_input"
;
if
(
is_file
(
$temp1_input
)){
$t_10389
=
trim
(
file_get_contents
(
$temp1_input
));
$t_10389
=
intval
(
$t_10389
)
/
1000
;
}
$t_sda
=
exec
(
"smartctl -A /dev/sda | egrep ^194 | awk '{print $10}'"
);
if
(
$t_sda
==
""
)
$t_sda
=
"-"
;
else
$t_sda
=
intval
(
$t_sda
);
$t_sdb
=
exec
(
"smartctl -A /dev/sdb | egrep ^194 | awk '{print $10}'"
);
$t_sdb
=
""
;
if
(
$t_sdb
==
""
)
$t_sdb
=
"-"
;
else
$t_sdb
=
intval
(
$t_sdb
);
$res
=
"
\n\t\t
<cpu>
$t_cpu
</cpu>
\n
"
;
$res
.=
"
\t\t
<b10389>
$t_10389
</b10389>
\n
"
;
$res
.=
"
\t\t
<sda>
$t_sda
</sda>
\n
"
;
$res
.=
"
\t\t
<sdb>
$t_sdb
</sdb>
\n
"
;
return
$res
;
}
function
get_port_info
(
$port
){
$pars_res
=
""
;
$ts_res
=
""
;
$pars
=
array
(
'WB_EN'
=>
0
,
'AUTOEXP_EN'
=>
0
,
'COMPRESSOR_RUN'
=>
0
,
'SENSOR_RUN'
=>
0
,
'COLOR'
=>
0
,
'QUALITY'
=>
0
,
'EXPOS'
=>
0
,
'WOI_WIDTH'
=>
0
,
'WOI_HEIGHT'
=>
0
,
'TRIG'
=>
0
,
'TRIG_MASTER'
=>
0
,
'TRIG_PERIOD'
=>
0
,
'TRIG_CONDITION'
=>
0
,
'TRIG_OUT'
=>
0
,
'GAINR'
=>
0
,
'GAING'
=>
0
,
'GAINB'
=>
0
,
'GAINGB'
=>
0
,
);
$ps
=
elphel_get_P_arr
(
$port
,
$pars
);
$pars_res
.=
"
\n\t\t
<parameters>
\n
"
;
foreach
(
$ps
as
$k
=>
$v
){
$pars_res
.=
"
\t\t\t
<"
.
strtolower
(
$k
)
.
">
$v
</"
.
strtolower
(
$k
)
.
">
\n
"
;
}
$pars_res
.=
"
\t\t
</parameters>
\n
"
;
// get recent timestamps
$circbuf_pointers
=
elphel_get_circbuf_pointers
(
$port
,
1
);
$meta
=
array
();
foreach
(
$circbuf_pointers
as
$k
=>
$v
){
$meta
[
$k
]
=
array
(
'circbuf_pointer'
=>
$v
[
'circbuf_pointer'
],
'meta'
=>
elphel_get_interframe_meta
(
$port
,
$v
[
'circbuf_pointer'
]),
'Exif'
=>
elphel_get_exif_elphel
(
$port
,
$v
[
'exif_pointer'
])
);
}
$ts_res
.=
"
\t\t
<timestamps>
\n
"
;
foreach
(
$meta
as
$m
){
$sec
=
$m
[
'meta'
][
'timestamp_sec'
];
$usec
=
sprintf
(
"%06d"
,
$m
[
'meta'
][
'timestamp_usec'
]);
$ts_res
.=
"
\t\t\t
<ts frame='
{
$m
[
'Exif'
][
'FrameNumber'
]
}
'>
$sec
.
$usec
</ts>
\n
"
;
}
$ts_res
.=
"
\t\t
</timestamps>
\n
"
;
$res
=
$pars_res
.
$ts_res
;
return
$res
;
}
?>
src/diagnostics/index.html
0 → 100644
View file @
e2b98afe
<!DOCTYPE HTML>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<title>
System info
</title>
<script
src=
"../js/jquery-3.1.1.js"
></script>
<link
rel=
"stylesheet"
href=
"../js/bootstrap/css/bootstrap.css"
>
<script
type=
'text/javascript'
src=
'diagnostics.js'
></script>
<link
rel=
'stylesheet'
type=
'text/css'
href=
'diagnostics.css'
></link>
</head>
<body>
<h4>
General info
</h4>
<div
id=
'display_general'
>
<table
id=
'gen_table'
>
<tr>
<th>
ip
</th>
<th>
time
</th>
<th>
uptime
</th>
<th
title=
'Temperature, °C'
>
t
</th>
<th>
storage
</th>
<th>
camogm
</th>
<th>
master port
</th>
<th>
GPS
</th>
<th>
IMU
</th>
</tr>
</table>
</div>
<h4>
Port info
</h4>
<div
id=
'display_pars'
>
<table
id=
'pars_table'
>
<tr>
<th>
port
</th>
<th>
mux
</th>
<th>
sensors
</th>
<th>
sensor run
</th>
<th>
compressor run
</th>
<th
title=
'image format'
>
format
</th>
<th>
quality
</th>
<th>
wxh
</th>
<th>
TRIG
</th>
<th>
master
</th>
<th
title=
'TRIG_PERIOD'
>
period
</th>
<th
title=
'TRIG_OUT'
>
T_OUT
</th>
<th
title=
'TRIG_CONDITION'
>
T_COND
</th>
<th>
exposure
</th>
<th>
gainR
</th>
<th>
gainG
</th>
<th>
gainB
</th>
<th>
gainGB
</th>
</tr>
</table>
</div>
<h4>
Timestamps info
</h4>
<div
id=
'display_ts'
>
<table
id=
'ts_table'
>
</table>
</div>
</body>
</html>
\ No newline at end of file
src/multicam/index.html
View file @
e2b98afe
...
...
@@ -44,6 +44,11 @@
</div>
</td>
</tr>
<tr>
<td>
<button
id=
'system_tests'
title=
'system info'
class=
"btn btn-sm btn-success"
>
tests
</button>
</td>
</tr>
<tr>
<td
hidden
>
<br/>
...
...
src/multicam/multicam.css
View file @
e2b98afe
...
...
@@ -118,4 +118,8 @@ hr{
.port_preview
canvas
,
#display
{
padding
:
0px
;
}
#system_tests
{
margin
:
5px
;
}
\ No newline at end of file
src/multicam/multicam.js
View file @
e2b98afe
...
...
@@ -283,7 +283,7 @@ function rec_button_update_state(){
rec_button_switch
(
recording
);
}
refresh_previews_intvl
=
setInterval
(
refresh_previews
,
1
000
);
refresh_previews_intvl
=
setInterval
(
refresh_previews
,
2
000
);
refresh_status_intvl
=
setInterval
(
refresh_status
,
2000
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment