Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
German Leon
Irradiar
Commits
77f2c8db
Commit
77f2c8db
authored
Feb 15, 2022
by
German Leon
Browse files
Añado configs3
parent
a1a6d261
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/serie.py
0 → 100755
View file @
77f2c8db
#! /usr/bin/python
import
sys
,
os
,
subprocess
,
random
,
time
,
datetime
timeout_hardware
=
30
;
from
multiprocessing
import
Process
import
time
inject
=
False
import
serial
def
watchdog_pro
(
serie
):
print
(
"Watchdog ini"
)
os
.
system
(
"tools/watchset "
+
`timeout_hardware`
)
serie
.
write
(
"Watchdog timeout value: "
+
`timeout_hardware`
+
"
\r\n
"
)
while
True
:
time
.
sleep
(
timeout_hardware
-
1
)
w
=
open
(
"/dev/watchdog0"
,
"r+"
)
serie
.
write
(
"Watchdog timeout value: "
+
`timeout_hardware`
+
"
\r\n
"
)
def
configurate_serie
():
#os.system("sudo stop ttyS0")
Puerto
=
"/dev/ttyS0"
try
:
serie
=
serial
.
Serial
(
Puerto
,
115200
)
serie
.
timeout
=
1
;
except
serial
.
SerialException
:
#-- Error al abrir el puerto serie
sys
.
stderr
.
write
(
"Error al abrir puerto (%s)
\n
"
%
Puerto
)
return
serie
def
main
():
configurate_serie
()
##############################################################################
main
()
Write
Preview
Supports
Markdown
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