Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot send HTTP request #564

Open
theMagicKnight opened this issue Jan 1, 2024 · 4 comments
Open

cannot send HTTP request #564

theMagicKnight opened this issue Jan 1, 2024 · 4 comments

Comments

@theMagicKnight
Copy link

Hallo,

es gibt ja nun schon zu dem Thema ein Beitrag aber wie wurde den nun das Problem behoben?

Sobald die MSG leer ist, kann der Befehl httpRequest nicht ausgeführt werden und BW bleibt stehen.

danke

@Schrolli91
Copy link
Owner

Hast du ein paar mehr Infos?
Wieso bleibt BOSWatch "stehen"?
Gibt es einen Log dazu?

@theMagicKnight
Copy link
Author

theMagicKnight commented Jan 6, 2024

Bei mir läuft die Boswatch 2.5.2 auf einen PI3 mit Buster als OS

06.01.2024 22:17:05 - regexFilter     [DEBUG   ] found Filter: poc_http =
06.01.2024 22:17:05 - regexFilter     [DEBUG   ] Filter passed: poc_http
06.01.2024 22:17:05 - alarmHandler    [DEBUG   ] call Plugin: httpRequest
06.01.2024 22:17:05 - configHandler   [DEBUG   ] read [httpRequest] from config file
06.01.2024 22:17:05 - configHandler   [DEBUG   ]  - fms_url =
06.01.2024 22:17:05 - configHandler   [DEBUG   ]  - zvei_url =
06.01.2024 22:17:05 - configHandler   [DEBUG   ]  - poc_url = https://meineurl.com/bw_test/received/?ric=%RIC%&subric=%FUNC%&msg=%MSG%
06.01.2024 22:17:05 - wildcardHandler [DEBUG   ] wildcards been replaced
06.01.2024 22:17:05 - httpRequest     [DEBUG   ] send POC HTTP requests
06.01.2024 22:17:28 - httpRequest     [ERROR   ] cannot send HTTP request
06.01.2024 22:17:28 - httpRequest     [DEBUG   ] cannot send HTTP request
Traceback (most recent call last):
  File "/opt/boswatchemes/plugins/httpRequest/httpRequest.py", line 103, in run
    urllib2.urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1241, in https_open
    context=self._context)
  File "/usr/lib/python2.7/urllib2.py", line 1195, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/lib/python2.7/httplib.py", line 1058, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1098, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 1054, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 892, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 854, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 1271, in connect
    HTTPConnection.connect(self)
  File "/usr/lib/python2.7/httplib.py", line 831, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 566, in create_connection
    sock.connect(sa)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
KeyboardInterrupt
06.01.2024 22:17:28 - alarmHandler    [DEBUG   ] return from: httpRequest

die index.php dazu sieht ganz einfach aus...


require "../include/config.include.php";
require "../include/mysql_connect.include.php";
require "../include/date_time.include.php";

#poc_url = http://www.google.de?ric=%RIC%&subric=%FUNC%&msg=%MSG%

$ric = $_GET['ric'];
$message = $_GET['msg'];

if($message == '') {
  echo 'Message leer - Abbruch';
  exit();
}
if($ric == true) {
  $statement = $pdo->prepare("INSERT INTO $pocsag_tbl (time, function, ric, functionChar, msg, bitrate, description) VALUES (?, ?, ?, ?, ?, ?, ?)");
  $statement->execute(array($boswatch_time, '1', $ric, 'a', $message, '9999', $ric));  
} else { exit(); }

?>

danke

@flothi
Copy link
Collaborator

flothi commented Jan 6, 2024

Klappt es denn, wenn du die URL vom pi aus manuell (Konsole oder Desktop) aufrufst?

@theMagicKnight
Copy link
Author

image
image

Ja

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants