Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PyPCC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
PyPCC
Commits
2859abec
Commit
2859abec
authored
1 year ago
by
Paulus Kruger
Browse files
Options
Downloads
Patches
Plain Diff
lmp_id script added
parent
be7a03fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#70201
failed
1 year ago
Stage: run
Stage: image
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pypcc/testing/check_ip.py
+16
-11
16 additions, 11 deletions
pypcc/testing/check_ip.py
pypcc/testing/lmp_id.py
+18
-0
18 additions, 0 deletions
pypcc/testing/lmp_id.py
setup.cfg
+1
-0
1 addition, 0 deletions
setup.cfg
with
35 additions
and
11 deletions
pypcc/testing/check_ip.py
+
16
−
11
View file @
2859abec
...
@@ -3,20 +3,25 @@ IP_APSCT_TEST='10.99.100.100'
...
@@ -3,20 +3,25 @@ IP_APSCT_TEST='10.99.100.100'
#IP_APSCT_subrack='10.99.x.100'
#IP_APSCT_subrack='10.99.x.100'
import
logging
import
logging
import
RPi.GPIO
as
GPIO
import
subprocess
import
subprocess
def
get_LMP_ID
():
try
:
pins
=
[
21
,
20
,
16
,
12
,
7
,
8
]
from
.lmp_id
import
get_LMP_ID
Npins
=
len
(
pins
);
except
:
GPIO
.
setmode
(
GPIO
.
BCM
)
from
lmp_id
import
get_LMP_ID
for
i
,
pin
in
enumerate
(
pins
):
GPIO
.
setup
(
pin
,
GPIO
.
IN
)
value
=
0
;
#import RPi.GPIO as GPIO
for
pin
in
pins
:
#def get_LMP_ID():
value
=
2
*
value
+
1
if
GPIO
.
input
(
pin
)
else
2
*
value
# pins=[21,20,16,12,7,8]
return
value
# Npins=len(pins);
# GPIO.setmode(GPIO.BCM)
# for i,pin in enumerate(pins):
# GPIO.setup(pin,GPIO.IN)
#
# value=0;
# for pin in pins:
# value=2*value+1 if GPIO.input(pin) else 2*value
# return value
def
get_eth0_ip_ifconfig
():
def
get_eth0_ip_ifconfig
():
result
=
subprocess
.
run
([
'
ifconfig
'
,
'
eth0
'
],
stdout
=
subprocess
.
PIPE
).
stdout
.
decode
()
result
=
subprocess
.
run
([
'
ifconfig
'
,
'
eth0
'
],
stdout
=
subprocess
.
PIPE
).
stdout
.
decode
()
...
...
This diff is collapsed.
Click to expand it.
pypcc/testing/lmp_id.py
0 → 100644
+
18
−
0
View file @
2859abec
import
RPi.GPIO
as
GPIO
def
get_LMP_ID
():
pins
=
[
21
,
20
,
16
,
12
,
7
,
8
]
Npins
=
len
(
pins
);
GPIO
.
setmode
(
GPIO
.
BCM
)
for
i
,
pin
in
enumerate
(
pins
):
GPIO
.
setup
(
pin
,
GPIO
.
IN
)
value
=
0
;
for
pin
in
pins
:
value
=
2
*
value
+
1
if
GPIO
.
input
(
pin
)
else
2
*
value
return
value
if
__name__
in
[
'
__main__
'
,
'
pypcc.testing.lmp_id
'
]:
lmpid
=
get_LMP_ID
()
print
(
lmpid
)
exit
(
lmpid
)
This diff is collapsed.
Click to expand it.
setup.cfg
+
1
−
0
View file @
2859abec
...
@@ -26,6 +26,7 @@ where=.
...
@@ -26,6 +26,7 @@ where=.
console_scripts
=
console_scripts
=
hwtr
=
pypcc.pypcc
hwtr
=
pypcc.pypcc
pitr
=
pypcc.testing.pitr_main
pitr
=
pypcc.testing.pitr_main
read_lmp_id
=
pypcc.testing.lmp_id
[options.package_data]
[options.package_data]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment