ecoli Posted September 27, 2015 at 11:57 AM Share Posted September 27, 2015 at 11:57 AM Hallo, ich verstehe es nicht: auf dem RED Brick läuft kein Octave *.m File. Aufbau: RED-Master-Humidity bricklet - Beispieldatei "Simple" von der Tinkerforge webseite des Humidity Bricklet genommen, UID geändert, gestartet mit dem PC und es funktioniert einwandfrei - in der RED Console Octave Umgebung gestartet mit octave und danach das Programm. Es läuft auch. - in der RED Console eingegeben: octave Dateiname , Programm wird beendet ohne Fehlermeldung und ohne Ergebnis. Im Brickviewer, wird das Program gestartet(ohne Ergebnis) und danach gleich wieder beendet. Das gleiche Ergebnis mit LCD20x4 bricklet, Temperatur-IR Bricklet Als Warnmeldung von Octave wird nur: X11 Display environment variable not set ausgegeben Die Phyton Beispieldateien funktionieren auf dem RED. Octave *.m Dateien habe ich auf dem RED Brick nicht zum Laufen gebracht. Ist das ein Bug oder wo steckt der Fehler? Quote Link to comment Share on other sites More sharing options...
ecoli Posted September 27, 2015 at 04:05 PM Author Share Posted September 27, 2015 at 04:05 PM Ich habe es selber gelöst. Geht nur mit Octave Script keine Funktionen....... Quote Link to comment Share on other sites More sharing options...
ecoli Posted September 27, 2015 at 06:31 PM Author Share Posted September 27, 2015 at 06:31 PM octave script funktioniert auf dem RED. Allerdings ein einfaches Script mit einer Callback-Funktion nicht. Da kommt eine Fehlermeldung: error: free_scope: scope 83 not found! Auf PC läuft das Script auf dem RED nicht Kennt jemand das Problem? Quote Link to comment Share on other sites More sharing options...
photron Posted September 28, 2015 at 08:03 AM Share Posted September 28, 2015 at 08:03 AM Stimmt, die Beispiel sind Function Files. Es funktioniert wenn ich unter der Function Definition die Funktion direkt aufrufe. Ich füge da gleich einen Hinweis in der Dokumentation für ein. Bezüglich Callbacks: Ich habe gerade nochmal das Humidity Callback Example getestet und das funktioniert. Wie sieht dein Callback Test aus? Quote Link to comment Share on other sites More sharing options...
ecoli Posted September 28, 2015 at 02:19 PM Author Share Posted September 28, 2015 at 02:19 PM Ich habe lediglich die Function Definition Zeile, sowie das "end" der Funktion gelöscht! Was meinst du mit in der "Function Definition die Funktion aufrufen"? Wie hast du das hinbekommen... HOST = "localhost"; PORT = 4223; UID = "qRH"; % Change to your UID ipcon = java_new("com.tinkerforge.IPConnection"); % Create IP connection h = java_new("com.tinkerforge.BrickletHumidity", UID, ipcon); % Create device object ipcon.connect(HOST, PORT); % Connect to brickd % Don't use device before ipcon is connected % Set Period for rh callback to 1s (1000ms) % Note: The callback is only called every second if the % humidity has changed since the last call! h.setHumidityCallbackPeriod(1000); % Register humidity callback to function cb_humidity h.addHumidityCallback(@cb_humidity); input("Press any key to exit...\n", "s"); ipcon.disconnect(); % Callback function for humidity callback (parameter has unit %RH/10) function cb_humidity(e) fprintf("Relative Humidity: %g %%RH\n", e.humidity/10.0); end Quote Link to comment Share on other sites More sharing options...
photron Posted September 28, 2015 at 02:41 PM Share Posted September 28, 2015 at 02:41 PM Siehe hier: http://www.tinkerforge.com/de/doc/Software/API_Bindings_MATLAB.html#function-vs-script-dateien Hier das Humidity Bricklet Callback Beispiel. Ich habe nur die letzte Zeile hinzugefügt und jetzt kann ich es per "octave octave_example_callback.m" von der Kommandozeile aus aufrufen und es funktioniert auch so auf dem RED Brick. function octave_example_callback() more off; HOST = "localhost"; PORT = 4223; UID = "qRH"; % Change to your UID ipcon = java_new("com.tinkerforge.IPConnection"); % Create IP connection h = java_new("com.tinkerforge.BrickletHumidity", UID, ipcon); % Create device object ipcon.connect(HOST, PORT); % Connect to brickd % Don't use device before ipcon is connected % Set Period for rh callback to 1s (1000ms) % Note: The callback is only called every second if the % humidity has changed since the last call! h.setHumidityCallbackPeriod(1000); % Register humidity callback to function cb_humidity h.addHumidityCallback(@cb_humidity); input("Press any key to exit...\n", "s"); ipcon.disconnect(); end % Callback function for humidity callback (parameter has unit %RH/10) function cb_humidity(e) fprintf("Relative Humidity: %g %%RH\n", e.humidity/10.0); end octave_example_callback(); % Diese Zeile ist neu Quote Link to comment Share on other sites More sharing options...
ecoli Posted September 28, 2015 at 07:43 PM Author Share Posted September 28, 2015 at 07:43 PM PERFEKT DANKE! :D :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.