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

Compile From Source in Pascal (Delphi/Lazarus) scheint noch nicht zu klappen. Compiler findet das "tinkerforge" package auf dem (Fast-) Image nicht, siehe Screenshot. Kann ich das lösen mit Angabe des passenden Path in Umgeb.Var oder Makefile ?

 

Ebenso frohe Weihnachten.

Clipboard01.png.75a9223cb84e466ae29b6d5e5e190255.png

Geschrieben

Verdammt, noch ein Bug den wir uns durch eine Last-Minute-Änderung eingefangen haben :(. Wochenlanges Testen und dann sowas...

 

Die aktuell Veröffentlichen FPC Bindings lassen sich nicht mit dem Makefile compilieren, das ist beim bauen des Images fehlgeschlagen aber nicht aufgefallen. Dadurch ist die FPC Library gar nicht installiert auf dem RED Brick :o.

 

Du kannst das wie folgt über die Console fixen:

 

sudo su
# password = tf

cd /usr/tinkerforge/bindings/delphi/source/
sed -i -e 's/BrickRED//g' Makefile.fpc
export FPCDIR=/usr/lib/fpc/`ls /usr/lib/fpc/ | grep -E [0-9].[0-9].[0-9] | head -n1`
fpcmake
make
make install

 

Danach funktioniert dann alles wie erwartet, getest hab ich mit folgendem Beispiel:

 

Makefile.fpc:

[target]
programs=ExampleEnumerate

[require]
packages=tinkerforge

 

ExampleEnumerate.pas:

program ExampleEnumerate;

{$ifdef MSWINDOWS}{$apptype CONSOLE}{$endif}
{$ifdef FPC}{$mode OBJFPC}{$H+}{$endif}

uses
  SysUtils, IPConnection, Device;

type
  TExample = class
  private
    ipcon: TIPConnection;
  public
    procedure EnumerateCB(sender: TIPConnection;
                          const uid: string; const connectedUid: string; const position: char;
                          const hardwareVersion: TVersionNumber; const firmwareVersion: TVersionNumber;
                          const deviceIdentifier: word; const enumerationType: byte);
    procedure Execute;
  end;

const
  HOST = 'localhost';
  PORT = 4223;

var
  e: TExample;

{ Print incoming enumeration }
procedure TExample.EnumerateCB(sender: TIPConnection;
                               const uid: string; const connectedUid: string; const position: char;
                               const hardwareVersion: TVersionNumber; const firmwareVersion: TVersionNumber;
                               const deviceIdentifier: word; const enumerationType: byte);
begin
  WriteLn('UID:               ' + uid);
  WriteLn('Enumerate Type:    ' + IntToStr(enumerationType));

  if (enumerationType <> IPCON_ENUMERATION_TYPE_DISCONNECTED) then begin
    WriteLn('Connected UID:     ' + connectedUid);
    WriteLn('Position:          ' + position);
    WriteLn('Hardware Version:  ' + IntToStr(hardwareVersion[0]) + '.' +
                                    IntToStr(hardwareVersion[1]) + '.' +
                                    IntToStr(hardwareVersion[2]));
    WriteLn('Firmware Version:  ' + IntToStr(firmwareVersion[0]) + '.' +
                                    IntToStr(firmwareVersion[1]) + '.' +
                                    IntToStr(firmwareVersion[2]));
    WriteLn('Device Identifier: ' + IntToStr(deviceIdentifier));
  end;

  WriteLn('');
end;

procedure TExample.Execute;
begin
  { Create connection and connect to brickd }
  ipcon := TIPConnection.Create;
  ipcon.Connect(HOST, PORT);

  { Register enumerate callback to "EnumerateCB" }
  ipcon.OnEnumerate := {$ifdef FPC}@{$endif}EnumerateCB;

  { Trigger enumerate }
  ipcon.Enumerate;

  WriteLn('Press key to exit');
  ReadLn;
  ipcon.Destroy; { Calls ipcon.Disconnect internally }
end;

begin
  e := TExample.Create;
  e.Execute;
  e.Destroy;
end.

 

Auszuführende Executable ist "ExampleEnumerate".

 

Ergebnis im Log:

 

2014-12-24T16:21:00.234105+0100
-------------------------------------------------------------------------------
UID:               3df8jB
Enumerate Type:    1
Connected UID:     0
Position:          0
Hardware Version:  1.0.0
Firmware Version:  2.0.0
Device Identifier: 17

UID:               3df8jB
Enumerate Type:    0
Connected UID:     0
Position:          0
Hardware Version:  1.0.0
Firmware Version:  2.0.0
Device Identifier: 17

UID:               6CtsQi
Enumerate Type:    0
Connected UID:     3df8jB
Position:          1
Hardware Version:  2.1.0
Firmware Version:  2.3.0
Device Identifier: 13

UID:               fobar
Enumerate Type:    0
Connected UID:     6CtsQi
Position:          c
Hardware Version:  1.0.0
Firmware Version:  2.0.1
Device Identifier: 246

Geschrieben
  • Autor

Prima und danke, hat geklappt.

Allerdings scheint es erst beim 2 Versuch der Programmstart (Always) zu klappen, anbei das log:

2014-12-11T14:44:17.899223+0100
-------------------------------------------------------------------------------
An unhandled exception occurred at $00037794 :
ETimeoutException : Did not receive response in time for function ID 2
  $00037794
  $0001FF94
  $000087C0
  $000088A8



2014-12-11T14:44:21.468739+0100
-------------------------------------------------------------------------------

 

Das Programm was ich ausführe ist recht banal, siehe Attachment. Falls das o.g. ein Bug ist, reicht eine Behebung auch im nächsten Jahr ;)

ExampleCallback.pas

Geschrieben
  • Autor

Denkt ihr beim Upgrade des RED Images auch an diesen Bug.

Geschrieben
  • Autor

Sind eig. auf dem Fullimage Tools für Fernwartungszugriff ala VNC, Teamviewer etc. ?

Geschrieben
  • Autor

Aber dann über die Repos ?

Geschrieben

Alles was in Debian Wheezy enthalten ist, ist auch in der "RED-Distro" enthalten. Die "RED-Distro" ist Debian Wheezy mit einem großen Haufen zusätzlicher Pakete die wir für unser System benötigen.

 

 

Geschrieben
  • Autor

Hab es getestet und ist jetzt mit dem 1.2 Image gefixt und arbeitet problemlos.

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.