Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

Hallo,

 

mein Anfang war sehr erfolgreich. Ausgepackt, angeschlossen, Brickd und Brickv installiert. Alles wunderbar.

 

brickviewer.jpg

 

Aber jetzt will ich über WAMP zugreifen und das geht nicht.

 

<?php
echo "Test 1<br>";
require_once('../../../source/Tinkerforge/IPConnection.php');
require_once('../../../source/Tinkerforge/BrickMaster.php');
echo "Test 2<br>";

use Tinkerforge\IPConnection;
use Tinkerforge\BrickMaster;
echo "Test 3<br>";

$host = 'localhost';
$port = 4223;

$uid = '94wpecnBBF8'; // Change to your UID
#$uid = 'ayNfRV5u9Vg'; // Change to your UID
echo "Test 4 $host $port $uid<br>";

$ipcon = new IPConnection($host, $port); // Create IP connection to brickd
echo "Test 5.1<br>";
$master = new BrickMaster($uid); // Create device object
echo "Test 5.2<br>";

$ipcon->addDevice($master); // Add device to IP connection
// Don't use device before it is added to a connection
echo "Test 6<br>";

// Get voltage and current from stack (in mV/mA)
$voltage = $master->getStackVoltage();
$current = $master->getStackCurrent();
echo "Test 7<br>";

echo "Stack Voltage: " . $voltage / 1000.0 . " V\n";
echo "Stack Current: " . $current / 1000.0 . " A\n";
echo "Test 8<br>";

echo "Press key to exit\n";
fgetc(fopen('php://stdin', 'r'));
$ipcon->destroy();

?>

 

php1.jpg

 

Leider baut er die Verbindung nicht auf. Was mache ich falsch?

 

Danke

Tippel

Geschrieben

Lässt du dir Fehler anzeigen? Normalerweise wirft der Konstruktor der IPConnection Exceptions wenn was schiefgeht, das müsstest du sehen wenn dein PHP Fehlermeldungen ausgibt.

 

Zu Fuß gehts aber auch:

Frei nach w3schools:

try
{
  $ipcon = new IPConnection($host, $port);
}
catch(Exception $e)
{
  echo 'Message: ' .$e->getMessage();
}

Geschrieben
  • Autor

da liegt irgendwie das Problem.

$ipcon = new IPConnection($host, $port);

da ist Schluss.

 

catch(Exception $e)

{

  echo 'Message: ' .$e->getMessage();

}

Es kommt keine Fehlermeldung mehr.

Geschrieben
  • Autor

Danke, ändert leider nichts. Ich nehme mal einen anderen Rechner und Linux.

Geschrieben

Du solltest aber erweiterte Fehlermeldungen sehen, damit könnten wir dem Fehler weiter auf den Grund gehen.

Geschrieben
  • Autor

Sorry, ich sehe wirklich nichts neues, ich bekomme die selbe Ausgabe.

 

Geschrieben

Steht im Logfile deines Webservers etwas?

Geschrieben
  • Autor

Ja, hätte ich auch gleich mal schauen können. Der Webserver hatte die Berechtigungen nicht unter Vista. Läuft jetzt alles perfekt.

 

Danke noch mal.

Join the conversation

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

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.