karawin / Ka-Radio

A wifi webradio with only low cost boards ESP8266 and VS1053 by Jp Cocatrix
Other
427 stars 91 forks source link

Optimise web code #67

Closed h1aji closed 5 years ago

h1aji commented 5 years ago

Is there any chance to look at the web server? First, It would be nice if CSS and JS would be optimised and there would be no need for yui compressor, which will simplify build. Second maybe LUA should be considered instead of micropython?

Do you have any plans on implementing web control API?

karawin commented 5 years ago

yui compressor is only for optimization of the flash size. I am pretty sure it can work without it.

micropython? Where.

Web api: HTML interface for the Wifi Webradio


Any browser or wget can be used to send basic commands to the webradio. A command format is http://yourip/?command[&command] If a command return some informations, it must be the last of the list or alone.

Commands are: version : return 'Release: x.x, Revision: x' infos : return 'vol: 46 the current volume num: 240 the current station number stn: Hotmix 80 the name of the current station tit: BANANARAMA - Venus ' the title of the son playing sts: 1 the state of the player: 0 stopped, 1: playing list=xxx : return the name of the station xxx (0 to 254)
stop : stop playing the current station. start : start playing the current station. next : play the next station prev : play the previous station play=xxx : with xxx from 0 to 254 play the station xxx volume=xxx : with xxx from 0 to 254 change the volume to xxx uart : uart baudrate at 115200 not saved on next reset instant="http://your url" : instant play a site Example: http://192.168.1.253/?instant="http://api.voicerss.org/?f=32khz_16bit_stereo&key=29334415954d491b85535df4eb4dd821&hl=en-us&src=hello?the-sun-is-yellow?and-i-like-it" the url must begin with http:// or https:// and be surrounded by " and no space char allowed.

Volume may be combined with other command. Example: 192.168.1.253/?volume=50&play=128&infos

Reminder: the url without parameter is the full web interface.