Divoom Aurabox + Timebox + TimeboxEvo [Update, kommunizieren funktioniert]

Begonnen von schwatter, 25 Dezember 2017, 23:37:43

Vorheriges Thema - Nächstes Thema

mumpitzstuff

Switch Screen: 45
  -> Clock: 00
    -> Format 12/24h (optional): 00 - 01
    -> Color as rgb (optional): 000000 - FFFFFF
   
  -> Temperature: 01
    -> Format Celsius/Fahrenheit (optional): 00 - 01
    -> Color as rgb (optinal): 000000 - FFFFFF
 
  -> Switchoff Screen: 02
 
  -> Animation (hardcoded): 03
    -> Type: 00 - 06
   
  -> Equalizer: 04
    -> Type: 00 - 06
      -> Type 0 lines as rgb (optional): 000000 - FFFFFF
      -> Type 0 spikes as rgb (optional): 000000 - FFFFFF
 
  -> Image/Animation (preloaded within the app): 05
 
  -> Stopwatch: 06
    -> Control Halt/Reset (optional): 00 (Halt), 02 (Reset)
   
  -> Scoreboard: 07
    -> Control lower (optional): 0000 - 00FF
    -> Control upper (optional): 0000 - 00FF
    (needs further investigation because higher values than 255 are not possible at the moment)
   
   
Set Brightness: 32
  -> Level (0 = off, 01 - FF = brightness level): 00 - FF
 
Set Time: 18
  -> Year (XX = year % 100, YY = year / 100): XXYY
  -> Month: XX
  -> Day: XX
  -> Hours: XX
  -> Minutes: XX
  -> Seconds: XX
 
Set Volume: 08
  -> Level: 01 - 64
 
Get Volume: 09
  -> Level
 
Set FM Radio (untested!): 05
  -> State (on = 01, off = 00): 00 - 01
  -> Frequency (100.3 Mhz = YYX.X = 030A): XXYY
 
Get FM Radio Frequency: 60
  -> Frequency (100.3 Mhz = YYX.X = 030A): XXYY
 
Set FM Radio Frequency: 61
  -> Frequency (100.3 Mhz = YYX.X = 030A): XXYY
 
Set Mute: 0A
  -> State (on = 00, off = 01): 00 - 01
 
Get Mute: 0B
  -> State (on = 00, off = 01)
 
Set Image: 44000A0A04
  -> Data (Timebox): RGB (R = 4bit, G = 4bit, B = 4bit) => RGBRGB 2 pixels encoded into 2 bytes of data
  -> Data (Aurabox): Color Index (4bit per pixel) => 2 pixels encoded into 1 byte of data

Set Animation: 49000A0A04
  -> Frame Number: 00 - FF
  -> Time Delay: 00 - FF
  -> Data (Timebox): RGB (R = 4bit, G = 4bit, B = 4bit) => RGBRGB 2 pixels encoded into 2 bytes of data
  -> Data (Aurabox): Color Index (4bit per pixel) => 2 pixels encoded into 1 byte of data

Set Wakeup Call: 43
  -> Number: 00 - 02
  -> State (on = 01, off = 00): 00 - 01
  -> Hour: XX
  -> Minute: XX
  -> Day (bitcoded in the following order (highest bit always 0): Sat, Fri, Thu, Wed, Tue, Mon, Sun): XX
  -> Scene: XX
  -> Unknown: 010000
  -> Volume Level: 01 - 64


Das habe ich bisher zusammen getragen bzw. herausgefunden...


mumpitzstuff

Der Rand ist leider viel zu dick, ansonsten wäre der sync schon ein schönes Feature.

mumpitzstuff

Hier ist mal eine Liste meines Scans nach potentiellen Services, die mir aktuell noch nicht bekannt sind. Es scheinen auch ein paar low hanging fruits dabei zu sein, denn die Anzeige der Timebox hat sich beim Scanvorgang mehrfach geändert. Ich versuche dann mal durch probieren rauszukriegen, was dahinter steht. Falls du Lust hast, kannst du dich gern ebenfalls daran versuchen... :)

Send plain command: 06
Generated raw command: 0103060006090002
Send raw command: 0103060006090002
Device answer: 01
done

Send plain command: 0601
Generated raw command: 0104000603040b0002
Send raw command: 0104000603040b0002
Failed!
done

Send plain command: 0c
Generated raw command: 010306000c0f0002
Send raw command: 010306000c0f0002
Device answer: 01
done

Send plain command: 0c01
Generated raw command: 0104000c0304110002
Send raw command: 0104000c0304110002
Device answer: 01
done

Send plain command: 0d
Generated raw command: 010306000d100002
Send raw command: 010306000d100002
Device answer: 01
done

Send plain command: 0d01
Generated raw command: 0104000d0304120002
Send raw command: 0104000d0304120002
Device answer: 01
done

Send plain command: 10
Generated raw command: 0103060010130002
Send raw command: 0103060010130002
Device answer: 01
done

Send plain command: 1001
Generated raw command: 010400100304150002
Send raw command: 010400100304150002
Device answer: 01
done

Send plain command: 11
Generated raw command: 0103060011140002
Send raw command: 0103060011140002
Device answer: 01
done

Send plain command: 1101
Generated raw command: 010400110304160002
Send raw command: 010400110304160002
Device answer: 01
done

Send plain command: 12
Generated raw command: 0103060012150002
Send raw command: 0103060012150002
Device answer: 01
done

Send plain command: 1201
Generated raw command: 010400120304170002
Send raw command: 010400120304170002
Failed!
done

Send plain command: 13
Generated raw command: 0103060013160002
Send raw command: 0103060013160002
Device answer: 01
done

Send plain command: 1301
Generated raw command: 010400130304180002
Send raw command: 010400130304180002
Device answer: 01
done

Send plain command: 16
Generated raw command: 0103060016190002
Send raw command: 0103060016190002
Device answer: 01
done

Send plain command: 1601
Generated raw command: 0104001603041b0002
Send raw command: 0104001603041b0002
Device answer: 01
done

Send plain command: 17
Generated raw command: 01030600171a0002
Send raw command: 01030600171a0002
Device answer: 01
done

Send plain command: 1701
Generated raw command: 0104001703041c0002
Send raw command: 0104001703041c0002
Device answer: 01
done

Send plain command: 1b
Generated raw command: 010306001b1e0002
Send raw command: 010306001b1e0002
Device answer: 01
done

Send plain command: 1b01
Generated raw command: 0104001b0304200002
Send raw command: 0104001b0304200002
Device answer: 01
done

Send plain command: 1c
Generated raw command: 010306001c1f0002
Send raw command: 010306001c1f0002
Device answer: 01
done

Send plain command: 1c01
Generated raw command: 0104001c0304210002
Send raw command: 0104001c0304210002
Device answer: 01
done

Send plain command: 27
Generated raw command: 01030600272a0002
Send raw command: 01030600272a0002
Device answer: 01
done

Send plain command: 2701
Generated raw command: 0104002703042c0002
Send raw command: 0104002703042c0002
Device answer: 01
done

Send plain command: 29
Generated raw command: 01030600292c0002
Send raw command: 01030600292c0002
Device answer: 01
done

Send plain command: 2901
Generated raw command: 0104002903042e0002
Send raw command: 0104002903042e0002
Device answer: 01
done

Send plain command: 30
Generated raw command: 0103060030330002
Send raw command: 0103060030330002
Device answer: 01
done

Send plain command: 3001
Generated raw command: 010400300304350002
Send raw command: 010400300304350002
Device answer: 01
done

Send plain command: 31
Generated raw command: 0103060031340002
Send raw command: 0103060031340002
Device answer: 01
done

Send plain command: 3101
Generated raw command: 010400310304360002
Send raw command: 010400310304360002
Device answer: 01
done

Send plain command: 32
Generated raw command: 0103060032350002
Send raw command: 0103060032350002
Device answer: 01
done

Send plain command: 3201
Generated raw command: 010400320304370002
Send raw command: 010400320304370002
Device answer: 01
done

Send plain command: 35
Generated raw command: 0103060035380002
Send raw command: 0103060035380002
Device answer: 01
done

Send plain command: 3501
Generated raw command: 0104003503043a0002
Send raw command: 0104003503043a0002
Device answer: 01
done

Send plain command: 37
Generated raw command: 01030600373a0002
Send raw command: 01030600373a0002
Device answer: 01
done

Send plain command: 3701
Generated raw command: 0104003703043c0002
Send raw command: 0104003703043c0002
Device answer: 01
done

Send plain command: 38
Generated raw command: 01030600383b0002
Send raw command: 01030600383b0002
Device answer: 01
done

Send plain command: 3801
Generated raw command: 0104003803043d0002
Send raw command: 0104003803043d0002
Device answer: 01
done

Send plain command: 40
Generated raw command: 0103060040430002
Send raw command: 0103060040430002
Device answer: 01
done

Send plain command: 4001
Generated raw command: 010400400304450002
Send raw command: 010400400304450002
Device answer: 01
done

Send plain command: 41
Generated raw command: 0103060041440002
Send raw command: 0103060041440002
Device answer: 01
done

Send plain command: 4101
Generated raw command: 010400410304460002
Send raw command: 010400410304460002
Device answer: 01
done

Send plain command: 42
Generated raw command: 0103060042450002
Send raw command: 0103060042450002
Device answer: 01
done

Send plain command: 4201
Generated raw command: 010400420304470002
Send raw command: 010400420304470002
Device answer: 01
done

Send plain command: 46
Generated raw command: 0103060046490002
Send raw command: 0103060046490002
Device answer: 01
done

Send plain command: 4601
Generated raw command: 0104004603044b0002
Send raw command: 0104004603044b0002
Device answer: 01
done

Send plain command: 4a
Generated raw command: 010306004a4d0002
Send raw command: 010306004a4d0002
Device answer: 01
done

Send plain command: 4a01
Generated raw command: 0104004a03044f0002
Send raw command: 0104004a03044f0002
Device answer: 01
done

Send plain command: 4b
Generated raw command: 010306004b4e0002
Send raw command: 010306004b4e0002
Device answer: 01
done

Send plain command: 4b01
Generated raw command: 0104004b0304500002
Send raw command: 0104004b0304500002
Device answer: 01
done

Send plain command: 4c
Generated raw command: 010306004c4f0002
Send raw command: 010306004c4f0002
Device answer: 01
done

Send plain command: 4c01
Generated raw command: 0104004c0304510002
Send raw command: 0104004c0304510002
Device answer: 01
done

Send plain command: 4d
Generated raw command: 010306004d500002
Send raw command: 010306004d500002
Device answer: 01
done

Send plain command: 4d01
Generated raw command: 0104004d0304520002
Send raw command: 0104004d0304520002
Device answer: 01
done

Send plain command: 4f
Generated raw command: 010306004f520002
Send raw command: 010306004f520002
Device answer: 01
done

Send plain command: 4f01
Generated raw command: 0104004f0304540002
Send raw command: 0104004f0304540002
Device answer: 01
done

Send plain command: 50
Generated raw command: 0103060050530002
Send raw command: 0103060050530002
Device answer: 01
done

Send plain command: 5001
Generated raw command: 010400500304550002
Send raw command: 010400500304550002
Device answer: 01
done

Send plain command: 53
Generated raw command: 0103060053560002
Send raw command: 0103060053560002
Device answer: 01
done

Send plain command: 5301
Generated raw command: 010400530304580002
Send raw command: 010400530304580002
Device answer: 01
done

Send plain command: 54
Generated raw command: 0103060054570002
Send raw command: 0103060054570002
Device answer: 01
done

Send plain command: 5401
Generated raw command: 010400540304590002
Send raw command: 010400540304590002
Device answer: 00Device answer: 00Device answer: 01Failed!
done

Send plain command: 55
Generated raw command: 0103060055580002
Send raw command: 0103060055580002
Device answer: 01
done

Send plain command: 5501
Generated raw command: 0104005503045a0002
Send raw command: 0104005503045a0002
Device answer: 01
done

Send plain command: 57
Generated raw command: 01030600575a0002
Send raw command: 01030600575a0002
Device answer: 01
done

Send plain command: 5701
Generated raw command: 0104005703045c0002
Send raw command: 0104005703045c0002
Device answer: 01
done

Send plain command: 58
Generated raw command: 01030600585b0002
Send raw command: 01030600585b0002
Device answer: 01
done

Send plain command: 5801
Generated raw command: 0104005803045d0002
Send raw command: 0104005803045d0002
Device answer: 01
done

Send plain command: 59
Generated raw command: 01030600595c0002
Send raw command: 01030600595c0002
Device answer: 01
done

Send plain command: 5901
Generated raw command: 0104005903045e0002
Send raw command: 0104005903045e0002
Device answer: 01
done

Send plain command: 5a
Generated raw command: 010306005a5d0002
Send raw command: 010306005a5d0002
Device answer: 01
done

Send plain command: 5a01
Generated raw command: 0104005a03045f0002
Send raw command: 0104005a03045f0002
Failed!
done

Send plain command: 62
Generated raw command: 0103060062650002
Send raw command: 0103060062650002
Device answer: 01
done

Send plain command: 6201
Generated raw command: 010400620304670002
Send raw command: 010400620304670002
Device answer: 01
done

Send plain command: 63
Generated raw command: 0103060063660002
Send raw command: 0103060063660002
Device answer: 01
done

Send plain command: 6301
Generated raw command: 010400630304680002
Send raw command: 010400630304680002
Failed!
done

Send plain command: 66
Generated raw command: 0103060066690002
Send raw command: 0103060066690002
Device answer: 01
done

Send plain command: 6601
Generated raw command: 0104006603046b0002
Send raw command: 0104006603046b0002
Device answer: 01
done

Send plain command: 67
Generated raw command: 01030600676a0002
Send raw command: 01030600676a0002
Device answer: 01
done

Send plain command: 6701
Generated raw command: 0104006703046c0002
Send raw command: 0104006703046c0002
Device answer: 01
done

Send plain command: 68
Generated raw command: 01030600686b0002
Send raw command: 01030600686b0002
Device answer: 01
done

Send plain command: 6801
Generated raw command: 0104006803046d0002
Send raw command: 0104006803046d0002
Device answer: 01
done

Send plain command: 70
Generated raw command: 0103060070730002
Send raw command: 0103060070730002
Device answer: 01
done

Send plain command: 7001
Generated raw command: 010400700304750002
Send raw command: 010400700304750002
Device answer: 01
done

Send plain command: 71
Generated raw command: 0103060071740002
Send raw command: 0103060071740002
Failed!
done

Send plain command: 7101
Generated raw command: 010400710304760002
Send raw command: 010400710304760002
Device answer: 01
done

Send plain command: 72
Generated raw command: 0103060072750002
Send raw command: 0103060072750002
Failed!
done

Send plain command: 7201
Generated raw command: 010400720304770002
Send raw command: 010400720304770002
Device answer: 01
done

Send plain command: 73
Generated raw command: 0103060073760002
Send raw command: 0103060073760002
Device answer: 01
done

Send plain command: 7301
Generated raw command: 010400730304780002
Send raw command: 010400730304780002
Device answer: 01
done

Send plain command: 74
Generated raw command: 0103060074770002
Send raw command: 0103060074770002
Device answer: 01
done

Send plain command: 7401
Generated raw command: 010400740304790002
Send raw command: 010400740304790002
Device answer: 01
done

Send plain command: 80
Generated raw command: 0103060080830002
Send raw command: 0103060080830002
Device answer: 01
done

Send plain command: 8001
Generated raw command: 010400800304850002
Send raw command: 010400800304850002
Device answer: 01
done

Send plain command: 81
Generated raw command: 0103060081840002
Send raw command: 0103060081840002
Device answer: 01
done

Send plain command: 8101
Generated raw command: 010400810304860002
Send raw command: 010400810304860002
Device answer: 01
done

Send plain command: 82
Generated raw command: 0103060082850002
Send raw command: 0103060082850002
Device answer: 01
done

Send plain command: 8201
Generated raw command: 010400820304870002
Send raw command: 010400820304870002
Failed!
done

Send plain command: 90
Generated raw command: 0103060090930002
Send raw command: 0103060090930002
Device answer: 01
done

Send plain command: 9001
Generated raw command: 010400900304950002
Send raw command: 010400900304950002
Device answer: 01
done

Send plain command: 92
Generated raw command: 0103060092950002
Send raw command: 0103060092950002
Device answer: 01
done

Send plain command: 9201
Generated raw command: 010400920304970002
Send raw command: 010400920304970002
Device answer: 01
done

Send plain command: 93
Generated raw command: 0103060093960002
Send raw command: 0103060093960002
Device answer: 01
done

Send plain command: 9301
Generated raw command: 010400930304980002
Send raw command: 010400930304980002
Device answer: 01
done

Send plain command: 96
Generated raw command: 0103060096990002
Send raw command: 0103060096990002
Device answer: 01
done

Send plain command: 9601
Generated raw command: 0104009603049b0002
Send raw command: 0104009603049b0002
Device answer: 01
done

Send plain command: a0
Generated raw command: 01030600a0a30002
Send raw command: 01030600a0a30002
Device answer: 01
done

Send plain command: a001
Generated raw command: 010400a00304a50002
Send raw command: 010400a00304a50002
Device answer: 01
done

Send plain command: a1
Generated raw command: 01030600a1a40002
Send raw command: 01030600a1a40002
Device answer: 01
done

Send plain command: a101
Generated raw command: 010400a10304a60002
Send raw command: 010400a10304a60002
Device answer: 01
done

Send plain command: a2
Generated raw command: 01030600a2a50002
Send raw command: 01030600a2a50002
Device answer: 01
done

Send plain command: a201
Generated raw command: 010400a20304a70002
Send raw command: 010400a20304a70002
Device answer: 01
done

Send plain command: a7
Generated raw command: 01030600a7aa0002
Send raw command: 01030600a7aa0002
Device answer: 01
done

Send plain command: a701
Generated raw command: 010400a70304ac0002
Send raw command: 010400a70304ac0002
Device answer: 01
done

Send plain command: a8
Generated raw command: 01030600a8ab0002
Send raw command: 01030600a8ab0002
Device answer: 01
done

Send plain command: a801
Generated raw command: 010400a80304ad0002
Send raw command: 010400a80304ad0002
Device answer: 01
done

Send plain command: aa
Generated raw command: 01030600aaad0002
Send raw command: 01030600aaad0002
Device answer: 01
done

Send plain command: aa01
Generated raw command: 010400aa0304af0002
Send raw command: 010400aa0304af0002
Device answer: 01
done

Send plain command: ac
Generated raw command: 01030600acaf0002
Send raw command: 01030600acaf0002
Device answer: 01
done

Send plain command: ac01
Generated raw command: 010400ac0304b10002
Send raw command: 010400ac0304b10002
Device answer: 01
done

Send plain command: b0
Generated raw command: 01030600b0b30002
Send raw command: 01030600b0b30002
Device answer: 01
done

Send plain command: b001
Generated raw command: 010400b00304b50002
Send raw command: 010400b00304b50002
Device answer: 01
done

Send plain command: b2
Generated raw command: 01030600b2b50002
Send raw command: 01030600b2b50002
Device answer: 01
done

Send plain command: b201
Generated raw command: 010400b20304b70002
Send raw command: 010400b20304b70002
Device answer: 01
done

Send plain command: b3
Generated raw command: 01030600b3b60002
Send raw command: 01030600b3b60002
Device answer: 01
done

Send plain command: b301
Generated raw command: 010400b30304b80002
Send raw command: 010400b30304b80002
Device answer: 01
done



schwatter

So, alles durchgetestet. Viel hab ich nicht. Ich denke, da die AuraBox älter ist, haben die auf die App als
Source gebaut. Die neueren Boxen haben bestimmt mehr Pics im Speicher. Mal abgesehen von dem
anderen Funktionsumfang.

Bereich 50

5001 = blinkendes Herz
5002 = calling Speaker
5003 = rotes Telefon
5004 = grünes ?
5005 = blau/weißes ?
5006 = skype ?
5007 = Line
5008 = WeChat
5009 = Pinguin

mumpitzstuff

50 sind die Benachrichtigungen wie es scheint.

Leider habe ich auch nicht sehr viel mehr gefunden, habe aber in der App mal den Sleep Timer, Kalender, Terminplaner, Spectrum Light und Wetter mitgeschnitten und hoffe für diese 5 Funktionen noch irgendwas raus zu bekommen (für eine Analyse ist es heute schon zu spät, das muss noch ein wenig warten).

Hier ist mein aktueller Stand der Dinge:

Switch Screen: 45
  -> Clock: 00
    -> Format 12/24h (optional): 00 - 01
    -> Color as rgb (optional): 000000 - FFFFFF
   
  -> Temperature: 01
    -> Format Celsius/Fahrenheit (optional): 00 - 01
    -> Color as rgb (optional): 000000 - FFFFFF
 
  -> Switchoff Screen: 02
 
  -> Animation (hardcoded): 03
    -> Type: 00 - 06
   
  -> Equalizer: 04
    -> Type: 00 - 06
      -> Type 0 lines as rgb (optional): 000000 - FFFFFF
      -> Type 0 spikes as rgb (optional): 000000 - FFFFFF
 
  -> Image/Animation (preloaded within the app): 05
 
  -> Stopwatch: 06
    -> Control Halt/Reset (optional): 00 (Halt), 02 (Reset)
   
  -> Scoreboard: 07
    -> Control lower (optional): 0000 - 00FF
    -> Control upper (optional): 0000 - 00FF
    (needs further investigation because higher values than 255 are not possible at the moment)
   
Set Brightness: 32 or 74
  -> Level (0 = off, 01 - FF = brightness level): 00 - FF
 
Set Time: 18
  -> Year (XX = year % 100, YY = year / 100): XXYY
  -> Month: XX
  -> Day: XX
  -> Hours: XX
  -> Minutes: XX
  -> Seconds: XX
 
Set Volume: 08
  -> Level: 01 - 64
 
Get Volume: 09
  -> Level
 
Set FM Radio (untested!): 05
  -> State (on = 01, off = 00): 00 - 01
  -> Frequency (100.3 Mhz = YYX.X = 030A): XXYY
 
Get FM Radio Frequency: 60
  -> Frequency (100.3 Mhz = YYX.X = 030A): XXYY
 
Set FM Radio Frequency: 61
  -> Frequency (100.3 Mhz = YYX.X = 030A): XXYY
 
Set Mute: 0A
  -> State (on = 00, off = 01): 00 - 01
 
Get Mute: 0B
  -> State (on = 00, off = 01)
 
Set Image: 44000A0A04
  -> Data (Timebox): RGB (R = 4bit, G = 4bit, B = 4bit) => RGBRGB 2 pixels encoded into 2 bytes of data
  -> Data (Aurabox): Color Index (4bit per pixel) => 2 pixels encoded into 1 byte of data

Set Animation: 49000A0A04
  -> Frame Number: 00 - FF
  -> Time Delay: 00 - FF
  -> Data (Timebox): RGB (R = 4bit, G = 4bit, B = 4bit) => RGBRGB 2 pixels encoded into 2 bytes of data
  -> Data (Aurabox): Color Index (4bit per pixel) => 2 pixels encoded into 1 byte of data

Set Wakeup Call: 43
  -> Number: 00 - 02
  -> State (on = 01, off = 00): 00 - 01
  -> Hour: XX
  -> Minute: XX
  -> Day (bitcoded in the following order (highest bit always 0): Sat, Fri, Thu, Wed, Tue, Mon, Sun): XX
  -> Scene: XX
  -> Unknown: 010000
  -> Volume Level: 01 - 64
 
Set Notification: 50
  -> Type: 00 - FF
 
Set Calendar or Appointment Planer: 54
  -> needs further investigation
 
Screen Off: 41XX or 62XX
 
Show/Set Stopwatch/Scoreboard: 71
  -> Type (00 = Stopwatch, 01 = Scoreboard): 00 - 01
  -> strange behaviour (needs further investigation)
 
Set Game: A0
  -> State (on = 01, off = 00): 00 - 01
  -> Type: XX
  -> Control???
 
Set Talking Faces: A1
  -> State (on = 01, off = 00): 00 - 01
  -> Type (optional): XX
 

mumpitzstuff

#81
Ich habe jetzt geändert das man das Timeout im sendPlain oder sendRaw auch als 0.1 angeben kann. Bisher war 1 Sekunde das untere Limit. Außerdem habe ich mal eine Animation erstellt (siehe unten im Code). Dadurch kann man diese Animation auf das Gerät laden und sie wird dann endlos ohne weiteres zutun abgespielt. Hierbei ist zu beachten, das man unbedingt den neuen optionalen dritten Parameter immer auf 0 setzen muss. Das scheint nur hier notwendig zu sein, bei allen anderen Kommandos kann man den dritten Parameter, wie bisher, weg lassen. Die 0 bewirkt, das nicht auf eine Antwort gewartet wird. Die Timebox sendet hier anscheinend keine Antwort oder diese kann nicht mit sysread eingelesen werden. Ich muss da noch mal gucken woran es liegt.

Für die Aurabox muss man natürlich die convertImageAB() Funktion und als Size 10 verwenden.

#!/usr/bin/perl
use strict;
use warnings;
use Time::HiRes;
use Net::Bluetooth;
use IO::Select;
use Imager;

sub listDevices();
sub connectDivoom($);
sub disconnectDivoom();
sub sendRaw($$;$);
sub sendPlain($$;$);
sub convertRawToPlain($);
sub convertImageTB($;$);
sub convertImageAB($;$);

my $socket;
my $TIMEBOX;

sub listDevices()
{
  print "Search for devices...\n\n"; 

  my $device_ref = get_remote_devices();
 
  foreach my $addr (keys %$device_ref)
  {
    print "Address: $addr Name: $device_ref->{$addr}\n";
  }

  print "done\n\n";
}

sub connectDivoom($)
{
  my $device = shift;
  my $ret;
  my $success = 0;

  print "Create RFCOMM client ($device)...\n";

  $socket = Net::Bluetooth->newsocket("RFCOMM");
  return $success unless(defined($socket));
 
  if (0 != $socket->connect($device, 4))
  {
    $socket->close();
    return $success;
  }

  $TIMEBOX = $socket->perlfh();
 
  sysread($TIMEBOX, $ret, 256);
  if (defined($ret))
  {
    $ret =~ s/[^[:print:]]//g;
    print "Device answer: $ret";

    if ('HELLO' eq $ret)
    {
      $success = 1;
    }
    else
    {
      close($TIMEBOX);
      $socket->close();
    }
  }
 
  print "\ndone\n\n";

  return $success;
}

sub disconnectDivoom()
{
  close($TIMEBOX);
  $socket->close();
}

sub sendRaw($$;$)
{
  my $data = shift;
  my $timeout = shift;
  my $response = shift;
  my $ret;
  my $retry = 0;
  my $select = IO::Select->new($TIMEBOX);
 
  print "Send raw command: $data\n";

  $response = 1 if (!defined($response));

  $data =~ s/((?:[0-9a-fA-F]{2})+)/pack('H*', $1)/ge;
 
  do
  {
    syswrite($TIMEBOX, $data);

    if ($select->can_read(0.1))
    {
      sysread($TIMEBOX, $ret, 256);
      if (defined($ret))
      {
        $ret = unpack('(H2)*', $ret);
        $ret =~ s/[^[:print:]]+//g;
        print "Device answer: $ret\n";
      }
    }
    else
    {
      print "No answer from device!\n";
    }

    $retry++;
  } while (($response) && ($retry <= 3) && (!defined($ret) || '01' ne $ret));

  if ($retry > 3)
  {
    print "Failed!\n";
  }
  else
  {
    Time::HiRes::sleep($timeout);
  }

  print "done\n\n";
}

sub sendPlain($$;$)
{
  my $data = shift;
  my $timeout = shift;
  my $response = shift;
  my $crc = 0;
  my $ret;
  my $retry = 0;

  print "Send plain command: $data\n";

  # add length (length of data + length of checksum)
  $_ = (length($data) + 4) / 2;
  $data = sprintf("%02x", ($_ & 0xFF)).sprintf("%02x", (($_ >> 8) & 0xFF)).$data;

  # calculate crc
  while ($data =~ /(..)/g)
  {
    $crc += hex($1);
  }

  # add crc
  $data .= sprintf("%02x", ($crc & 0xFF)).sprintf("%02x", (($crc >> 8) & 0xFF)); 

  # escape data
  $data =~ s/(01|02|03)(?{ if (0 == ($-[0] & 1)) {'030'.(3+$1)} else {$1} })/$^R/g;

  # add prefix and postfix
  $data = '01'.$data.'02';

  print "Generated raw command: $data\n";

  sendRaw($data, $timeout, $response);
}

sub convertRawToPlain($)
{
  my $data = shift;

  print $data."\n";

  # remove prefix and postfix
  $data = substr($data, 2, -2);

  # unescape data
  $data =~ s/(03(04|05|06))(?{ if (0 == ($-[0] & 1)) {'0'.($2-3)} else {$1} })/$^R/g;
 
  #remove length
  $data = substr($data, 4);

  # remove checksum
  $data = substr($data, 0, -4);

  print $data."\n";

  return $data;
}

sub convertImageTB($;$)
{
  my $file = shift;
  my $size = shift;
  my @imgData = (0);
  my $image = Imager->new;
 
  $size = 11 if (!defined($size));
  $image->read(file=>$file) or die "Can't read image ".$file." (".$image->errstr.")\n";
 
  if ('paletted' eq $image->type)
  {
    print "Image: ".$image->getheight()."x".$image->getwidth()." (maxcolors: ".$image->maxcolors.", usedcolors: ".$image->getcolorcount().")\n";
  }
  else
  {
    print "Image: ".$image->getheight()."x".$image->getwidth()." (maxcolors: no palette found, usedcolors: ".$image->getcolorcount().")\n";
  }

  if (defined($image))
  {
    my ($r, $g, $b, $a);
    my $flicflac = 0;   
    my $imageResized = $image->scaleX(pixels=>$size)->scaleY(pixels=>$size);

    for (my $y = 0; $y < $size; $y++)
    {
      for (my $x = 0; $x < $size; $x++)
      {
        ($r, $g, $b, $a) = $imageResized->getpixel(x=>$x, y=>$y)->rgba();
       
        if (0 == $flicflac)
        {
          if ($a > 32)
          {
            $imgData[-1] = (($r & 0xF0) >> 4) + ($g & 0xF0);
            push(@imgData, (($b & 0xF0) >> 4));
          }
          else
          {
            $imgData[-1] = 0;
            push(@imgData, 0);
          }

          $flicflac = 1;
        }
        else
        {
          if ($a > 32)
          {
            $imgData[-1] += ($r & 0xF0);
            push(@imgData, (($g & 0xF0) >> 4) + ($b & 0xF0));
          }
          else
          {
            $imgData[-1] += 0;
            push(@imgData, 0);
          }
          push(@imgData, 0);

          $flicflac = 0;
        }
      }
    }
  }
  else
  {
    print "Error: Loading image failed!\n";
  }

  $_ = '';
  foreach my $byte (@imgData)
  {
    $_ .= sprintf("%02x", ($byte & 0xFF));
  }

  return $_;
}

sub convertImageAB($;$)
{
  my $file = shift;
  my $size = shift;
  my @imgData = ();
  my $image = Imager->new;
  my @color = (0, 1, 2, 11, 4, 5, 2, 5, 8, 1, 2, 3, 4, 13, 6, 7);

  $size = 10;# if (!defined($size));
  $image->read(file=>$file) or die "Can't read image ".$file." (".$image->errstr.")\n";

  if ('paletted' eq $image->type)
  {
    print "Image: ".$image->getheight()."x".$image->getwidth()." (maxcolors: ".$image->maxcolors.", usedcolors: ".$image->getcolorcount().")\n";
  }
  else
  {
    print "Image: ".$image->getheight()."x".$image->getwidth()." (maxcolors: no palette found, usedcolors: ".$image->getcolorcount().")\n";
  }

  if (defined($image))
  {
    my $flicflac = 0;
    #my $imageResized = $image->scaleX(pixels=>$size)->scaleY(pixels=>$size);

    for (my $y = 0; $y < $size; $y++)
    {
      for (my $x = 0; $x < $size; $x++)
      {
        my $index = $image->findcolor(color=>$image->getpixel(x=>$x, y=>$y));
        print "Warning: palette index (".$index.") outside of allowed range at x=".$x." y=".$y."\n" if ($index > 15);
        $index = $index % 16;
               
        if (0 == $flicflac)
        {
          push(@imgData, $color[$index]);

          $flicflac = 1;
        }
        else
        {
          $imgData[-1] += ($color[$index] << 4);

          $flicflac = 0;
        }
      }
    }
  }
  else
  {
    print "Error: Loading image failed!\n";
  }

  $_ = '';
  foreach my $byte (@imgData)
  {
    $_ .= sprintf("%02x", ($byte & 0xFF));
  }

  return $_;
}

my $pic1 = convertImageTB('1.png', 11);
my $pic2 = convertImageTB('2.png', 11);
my $pic3 = convertImageTB('3.png', 11);
my $pic4 = convertImageTB('4.png', 11);
my $pic5 = convertImageTB('5.png', 11);
my $pic6 = convertImageTB('6.png', 11);
my $pic7 = convertImageTB('7.png', 11);
my $pic8 = convertImageTB('8.png', 11);

if (connectDivoom('11:75:58:4F:A1:CB'))
{
  sendPlain('4500', 5);
  sendPlain('49000A0A040000'.$pic1, 0, 0);
  sendPlain('49000A0A040100'.$pic2, 0, 0);
  sendPlain('49000A0A040200'.$pic3, 0, 0);
  sendPlain('49000A0A040300'.$pic4, 0, 0);
  sendPlain('49000A0A040400'.$pic5, 0, 0);
  sendPlain('49000A0A040500'.$pic6, 0, 0);
  sendPlain('49000A0A040600'.$pic7, 0, 0);
  sendPlain('49000A0A040700'.$pic8, 20, 0);
  disconnectDivoom();
}

schwatter

#82
So Feierabend und gerade getestet. Das Feuerwerk knallt hier munter vor sich hin. Infinityloop im Speicher  :)

edit:

Hier nochmal meine Aussage von Seite 5. Ist bei dem Explizitpfaddisaster untergegangen.

-----------------------------------------------------------------------------------------------------

Habe my@color getweaked.


Vorher:
my @color = (0, 1, 2, 11, 4, 5, 2, 5, 8, 1, 2, 3, 4, 13, 6, 7);

Nachher:
my @color = (0, 1, 2, 11, 4, 5, 2, 15, 8, 1, 2, 3, 4, 13, 6, 7);


Ist das für dich nachvollziehbar?

mumpitzstuff

An der Stelle kann ich nichts nachvollziehen, da mir die Aurabox fehlt. Ich bin deshalb auf deinen Input angewiesen und übernehme die Änderung gern.

schwatter


mumpitzstuff

Kannst du bei dir mal bitte folgendes prüfen? Unter Tools kann man Kalendereinträge erstellen. Wenn man da drauf klickt, kann man rechts oben mit dem Notizblock Icon einen neuen Eintrag erstellen. Versuch mal bitte 2 Einträge mit unterschiedlichen Stunden zu erstellen, also z.b. 8 und 10 Uhr. Bei mir kann ich das zwar setzen, aber die Stunde steht jedes Mal wieder auf 7, wenn die die Einträge erneut öffne. Die Minuten und das Datum kann ich hingegen problemlos ändern.

mumpitzstuff

Und noch eine Frage. Hast du es geschafft 2 Geräte mit der Aurabox zu pairen, so das du mit der App und gleichzeitig mit FHEM auf die Aurabox zugreifen kannst? Ich muss aktuell immer das Pairing auf meinem Telefon aufheben, bevor FHEM wieder darauf zugreifen kann. Besser wäre es, wenn man einfach beide gepaired lassen könnte...

schwatter

Zum Pairing, leider nein. Bis jetzt auch nur 1 Device. Kalendereintrag probiere ich heute Abend.

schwatter

So, zu den Kalendereinträgen. Die App für die AuraBox ist eine extra App. Kalendereinträge sind damit nicht möglich. Gibt nur ein
Schlaftimer und Wecktimer. Sehr beschnitten, liegt wohl an der Box selber.

Was ich noch festgestellt habe. Bei mir sind 3 Settings der Helligkeit möglich. Hell, Dunkel, Schwarz(Aus). Soll das Display aus sein,
ist es besser, der Box ein black.bmp zu schicken. Grund, wurde das Schwarzsetting gewählt und es wird umgeschaltet, egal ob Bild,
Animation oder z.B Uhr, bleibt das Display schwarz. Erst umschalten auf Dunkel oder Hell bringt ein Bild zurück. Das switchen klappt
aber, obwohl nichts zu sehen ist. Vom black.bmp zu irgendwas klappt sofort.

mumpitzstuff

Hmm komisch. Bei mir ist das in der Mitte Links unter Tools. Da wo auch die Stopuhr, Anzeigetafel usw. zu finden sind.

Den Wecktimer habe ich ja schon entschlüsselt. Den Kalender vermutlich auch. Ich dachte erst die Box hat ein Bug, es scheint aber nur die Android App zu sein. Mit iOS gehts, nur kann ich damit leider nicht die Nachrichten sniffen. Den Sleeptimer habe ich nach hinten gestellt, da ich dafür keine Notwendigkeit sehe den über Fhem zu steuern.