HTTP API problems

Hi All
I’m new user of Arylic products and new forum user.
I’m currently working on integrating Arylic Up2stream AMP v4 with openHAB and openHASP touchscreen.

I found some problems:

  1. Code provided on HTTP API documentation after porting to javascript works only for ASCII encoded Artist/Album/Title. I got garbage when UTF-8 encoded strings are provided as hexed string. Random code from Stack Overflow works better.

  2. When listening to radio stream only title is provided as hexed string. Album and Artist is literally “unknown”. Example HTTP API response for
    http://192.168.2.73/httpapi.asp?command=getPlayerStatus
    is
    {"type":"0","ch":"0","mode":"10","loop":"2","eq":"0","status":"pause","curpos":"858142","offset_pts":"858142","totlen":"-4","Title":"416E747920526164696F","Artist":"unknown","Album":"unknown","alarmflag":"0","plicount":"1","plicurr":"1","vol":"4","mute":"0"}
    For a workaround my code checks if string is ‘unknown’ and leaves is as is if so. Otherwise it decodes string.

  3. I would like also to read Preset list to display it on touch screen so user can conveniently choose one of presets without having to remember what’s hdeing under each number. Unfortunately I can’t see this functionality in HTTP API.

  4. As improvement to HTTP API it would be easier to integrate Arylic products with openHAB (and probably other systems too) if using the same names and numbers for the same functions.
    Let’s take a look at getPlayerStatus ‘mode’ key - we have numbers here which are representing modes (states): 0 - Idling, 1 - airplay streaming and so on (13 states are descripted). This is read only property. To change mode we use setPlayerCmd:switchmode command and here we select mode using keywords: wifi -wifi mode, bluetooth - bluetooth mode and so on(7 choices).
    API is incosistent because you can set input to ‘wifi’ but to read what is current input you have to map mode 1,2,10,20,31 to wifi (maybe 99 also?). Is 0 only idle in wifi or in all modes? Who knows?

Any advice appreciated.

Best Regards
kamiKAC

1 Like

Hi Kami,

Thanks for the interests and efforts, the platform is not well documented. There’s a workaround UPNP method and which could be treat as an API. And we did not write the document yet, but wrote some demostrating scripts for functions. If you’re a programmer, you should have no difficulty to read it :wink:

With these UPNP method, you could read music information more accurately and including the link for cover, should be same with APP, read the preset lists, rowse current queue, create your own queue and play it.

Dear Frank

Thanks for the prompt reply. Looks like those scripts are self explanatory :slight_smile:
I will try to play with it next week.

BTW: I’m not professional developer but I have some coding skills :wink:

Best regards