Jump to content

[Perl] Mehrere IP Connections zu verschiedenen Bricks


Recommended Posts

Hallo zusammen,

 

ich habe gerade folgendes Problem bei der Nutzung der Perl bindings: Nach dem connect zu einem zweiten Stapel ist die Verbindung zum ersten Stapel nicht mehr nutzbar. Folgendes Beispiel:

 

#!/usr/bin/perl

use lib '../bindings/perl/source/lib';

use strict;
use warnings;
use Tinkerforge::IPConnection;
use Tinkerforge::BrickletTemperature;

my $ipcon1  = Tinkerforge::IPConnection->new();
my $b_temp1 = Tinkerforge::BrickletTemperature->new('dHw', $ipcon1);
my $ipcon2  = Tinkerforge::IPConnection->new();
my $b_temp2 = Tinkerforge::BrickletTemperature->new('aH3', $ipcon2);

$ipcon1->connect('tf-1', 4223);
$ipcon2->connect('tf-2', 4223);

print "temp1: " . ($b_temp1->get_temperature / 100.0) . "\n";
print "temp2: " . ($b_temp2->get_temperature / 100.0) . "\n";

$ipcon1->disconnect;
$ipcon2->disconnect;

 

Die Ausgabe ist folgendermaßen:

 

root@pi-1:/opt/tinkerforge/software/display# ./test2.pl
Did not receive response for function 1 in time at ./test2.pl line 18
Perl exited with active threads:
6 running and unjoined
0 finished and unjoined
0 running and detached

 

In C/C++ funktioniert das problemlos.

 

Daten zum System:

root@pi-1:/opt/tinkerforge/software/display# perl -v

This is perl 5, version 14, subversion 2 (v5.14.2) built for arm-linux-gnueabihf-thread-multi-64int
(with 89 registered patches, see perl -V for more detail)
[...]
root@pi-1:/opt/tinkerforge/software/display# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 7.10 (wheezy)
Release:	7.10
Codename:	wheezy

 

Es ist ein Raspbian Wheezy.

 

Gibt es ein bekanntes Problem mit den Perl Bindings und mehreren IP Connections?

 

Viele Grüße

Robin

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...