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.

Keine Verbindung zu BrickletIndustrialDigitalIn4 in Matlab

Featured Replies

Geschrieben

Hallo,

 

ich suche jetzt schon eine ganze Weile verzweifelt eine Lösung so folgendem Problem:

 

function matlab_example_simple()
    import com.tinkerforge.IPConnection;
    import com.tinkerforge.BrickletIndustrialDigitalIn4;

    HOST = 'localhost';
    PORT = 4223;
    UID = 'oae'; % Change XYZ to the UID of your Industrial Digital In 4 Bricklet

    ipcon = IPConnection(); % Create IP connection
    idi4 = handle(BrickletIndustrialDigitalIn4(UID, ipcon), 'CallbackProperties'); % Create device object

    ipcon.connect(HOST, PORT); % Connect to brickd
    % Don't use device before ipcon is connected

    % Get current value as bitmask
    valueMask = idi4.getValue();
    fprintf('Value Mask: %s\n', dec2bin(valueMask));

    input('Press key to exit\n', 's');
    ipcon.disconnect();
end

 

Dieser Code ist ein Beispiel-Code von tinkerforge.com. Er führt bei mir in Matlab zu folgendem Fehler:

 

Error using spielwiese (line 12)
Java exception occurred:
com.tinkerforge.NetworkException: Could not create socket: Connection refused: connect

at com.tinkerforge.IPConnectionBase.connectUnlocked(IPConnectionBase.java:513)

at com.tinkerforge.IPConnectionBase.connect(IPConnectionBase.java:469)

Caused by: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)

at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)

at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)

at java.net.AbstractPlainSocketImpl.connect(Unknown Source)

at java.net.PlainSocketImpl.connect(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at com.tinkerforge.IPConnectionBase.connectUnlocked(IPConnectionBase.java:511)

... 1 more

 

Auf meinem alten PC (Windows 7, Matlab 2014b) konnte ich die Verbindung ganz normal aufbauen. Seit ich den neuen PC habe (Windows 10, Matlab 2017a) funktioniert es leider nicht mehr.

 

Habe mich ganz genau an die Installationsanleitung von https://www.tinkerforge.com/de/doc/Software/API_Bindings_MATLAB.html#api-bindings-matlab-install gehalten.

 

Hat jemand eine Idee, woran das liegen könnte?

 

Vielen Dank!  :)

Geschrieben
  • Autor

Oh, ich bin so doof...

Das hatte ich vergessen. Ist schon so lange her...

Jetzt funktioniert es.

 

Vielen Dank!  :)

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.