Jump to content

Recommended Posts

Posted

Hallo zusammen

 

ich versuche gerade das AmbientLightV2-Bricklet in PHP zum laufen zu bekommen. Leider wirfst selbst das einfache Beispiel folgende Warnung und gibt danach nur "Illuminance: 0 Lux" aus

 

Warning: unpack(): Type V: not enough input, need 4, have 2 in /.../Tinkerforge/BrickletAmbientLightV2.php on line 181

 

Ich benutzt MAMP als PHP Webserver und habe bereis verschiedene PHP Versionen versucht.

 

Kennt jemand das Problem oder hat einen Tipp :)?

 

Posted

Hast du vielleicht ein altes Ambient Light Bricklet und versuchst das Beispiel für das neue Ambient Light 2.0 Bricklet zu verwenden?

 

Das würde zur Fehlermeldung passen. Das alte Bricklet hat die Helligkeit als uint16 (2 Byte) übertragen. Das neue Bricklet überträgt die Helligkeit als uint32 (4 Byte). Das passt zur Fehlermeldung, dass 4 Byte erwartet wurden, aber nur 2 Byte empfangen wurden.

 

In dem Fall muss du einfach nur, dass Beispiel für das alte Ambient Light Bricklet nehmen: http://www.tinkerforge.com/de/doc/Software/Bricklets/AmbientLight_Bricklet_PHP.html#simple

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...