Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
motosat
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
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
motosat
Commits
789d365b
Commit
789d365b
authored
Oct 17, 2019
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cli argv
parent
88f9f20e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
8 deletions
+43
-8
log_phone_sensors.php
log_phone_sensors.php
+43
-8
No files found.
log_phone_sensors.php
View file @
789d365b
<?php
<?php
$phone_ip
=
"192.168.7.222"
;
$phone_ip
=
"192.168.
2.23"
;
// "192.168.
7.222";
$phone_port
=
"8123"
;
$phone_port
=
"8123"
;
$log_dir
=
dirname
(
get_included_files
()[
0
])
.
"/logs"
;
// "/home/eyesis/git/motosat/attic/logs/";
$log_dir
=
dirname
(
get_included_files
()[
0
])
.
"/attic/logs"
;
// "/home/eyesis/git/motosat/attic/logs/";
$log_name
=
"phone07.log"
;
$log_name
=
"phone08.log"
;
//http://localhost/motosat/log_phone_sensors.php?ip=192.168.2.23&log_name=phone10.log
if
(
isset
(
$_GET
[
"ip"
]))
{
$phone_ip
=
myfval
(
$_GET
[
"ip"
]);}
//php7.0 log_phone_sensors.php ip=192.168.2.23 log_name=phone11.log
if
(
isset
(
$_GET
[
"log_dir"
]))
{
$log_dir
=
myfval
(
$_GET
[
"log_dir"
]);}
if
(
isset
(
$argc
))
{
if
(
isset
(
$_GET
[
"log_name"
]))
{
$log_name
=
myfval
(
$_GET
[
"log_name"
]);}
unset
(
$argv
[
0
]);
foreach
(
$argv
as
$value
)
{
$a
=
parse_ini_string
(
$value
);
if
(
count
(
$a
)
>
0
){
foreach
(
$a
as
$k
=>
$v
){
$_GET
[
$k
]
=
$v
;
}
}
else
{
$_GET
[
$value
]
=
''
;
}
}
}
if
(
isset
(
$_GET
[
"ip"
]))
{
$phone_ip
=
$_GET
[
"ip"
];
}
if
(
isset
(
$_GET
[
"log_dir"
]))
{
$log_dir
=
$_GET
[
"log_dir"
];
}
if
(
isset
(
$_GET
[
"log_name"
]))
{
$log_name
=
$_GET
[
"log_name"
];
}
$phone_url
=
"http://"
.
$phone_ip
.
":"
.
$phone_port
;
$phone_url
=
"http://"
.
$phone_ip
.
":"
.
$phone_port
;
$log_file
=
fopen
(
trim
(
$log_dir
,
"/"
)
.
"/"
.
$log_name
,
"w"
);
$log_path
=
rtrim
(
$log_dir
,
"/"
)
.
"/"
.
$log_name
;
if
(
false
)
{
var_dump
(
$_GET
);
echo
'$phone_url ='
.
$phone_url
.
"
\n
"
;
echo
'log_path = '
.
$log_path
.
"
\n
"
;
exit
(
0
);
}
$log_file
=
fopen
(
$log_path
,
"w"
);
$ts_l
=
14
;
$ts_l
=
14
;
$acc_l
=
35
;
$acc_l
=
35
;
$mag_l
=
35
;
$mag_l
=
35
;
...
@@ -46,6 +75,12 @@ function getDishAngles($xml_state){
...
@@ -46,6 +75,12 @@ function getDishAngles($xml_state){
}
}
return
$DishAngles
;
return
$DishAngles
;
}
}
function
myfval
(
$s
)
{
$s
=
trim
(
$s
,
"
\"
"
);
return
floatval
(
$s
);
}
/*
/*
$xml=simplexml_load_string("<sensors><timestmap>1570632414615</timestmap><accelerometer>0.095215, -0.811707, 9.966614</accelerometer><magnetometer>-15.299988, 4.798889, 46.078491</magnetometer><azimuth>61.597424</azimuth><pitch>4.655828</pitch><roll>-0.547352</roll><longitude>-111.932889</longitude><latitude>40.723488</latitude><date>Wed Oct 09 14:46:54 MDT 2019</date></sensors>");
$xml=simplexml_load_string("<sensors><timestmap>1570632414615</timestmap><accelerometer>0.095215, -0.811707, 9.966614</accelerometer><magnetometer>-15.299988, 4.798889, 46.078491</magnetometer><azimuth>61.597424</azimuth><pitch>4.655828</pitch><roll>-0.547352</roll><longitude>-111.932889</longitude><latitude>40.723488</latitude><date>Wed Oct 09 14:46:54 MDT 2019</date></sensors>");
...
...
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