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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
PyPCC
Commits
b403e92b
Commit
b403e92b
authored
1 year ago
by
Paulus Kruger
Browse files
Options
Downloads
Patches
Plain Diff
lmp id bug fix
parent
52d19d86
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#70214
failed
1 year ago
Stage: run
Stage: image
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pypcc/testing/check_ip.py
+16
-16
16 additions, 16 deletions
pypcc/testing/check_ip.py
with
16 additions
and
16 deletions
pypcc/testing/check_ip.py
+
16
−
16
View file @
b403e92b
...
...
@@ -5,23 +5,23 @@ IP_APSCT_TEST='10.99.100.100'
import
logging
import
subprocess
try
:
from
.lmp_id
import
get_LMP_ID
except
:
from
lmp_id
import
get_LMP_ID
#
try:
#
from .lmp_id import get_LMP_ID
#
except:
#
from lmp_id import get_LMP_ID
#
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
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
def
get_eth0_ip_ifconfig
():
result
=
subprocess
.
run
([
'
ifconfig
'
,
'
eth0
'
],
stdout
=
subprocess
.
PIPE
).
stdout
.
decode
()
...
...
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