09.05.2021, 14:28
Hi.
I normally control my HifiBerry amplifiers with NodeRed and the HifiBerry API. I now try to do the same with my LM5, but i just get an error code. I want to send % volume to the amplifier. Anyone here who knows what to adjust to get this to work?
HifiBerry API documentation:
https://github.com/hifiberry/audiocontro...doc/api.md
Error:
* arg: 1
* string:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>Error: 500 Internal Server Error</title>
<style type="text/css">
html {background-color: #eee; font-family: sans;}
body {background-color: #fff; border: 1px solid #ddd;
padding: 15px; margin: 15px;}
pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
</style>
</head>
<body>
<h1>Error: 500 Internal Server Error</h1>
<p>Sorry, the requested URL <tt>'http://192.168.1.91:81/api/volume'</tt>
caused an error:</p>
<pre>Internal Server Error</pre>
</body>
</html>
* arg: 2
* number: 500
I normally control my HifiBerry amplifiers with NodeRed and the HifiBerry API. I now try to do the same with my LM5, but i just get an error code. I want to send % volume to the amplifier. Anyone here who knows what to adjust to get this to work?
Code:
http = require('socket.http')
ltn12 = require('ltn12')
body = require('json').encode({
percent = event.getvalue()
})
res, code = http.request({
url = 'http://192.168.1.91:81/api/volume',
method = 'POST',
headers = {
['Content-Length'] = #body,
},
source = ltn12.source.string(body)
})
log(res, code)
HifiBerry API documentation:
https://github.com/hifiberry/audiocontro...doc/api.md
Error:
* arg: 1
* string:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>Error: 500 Internal Server Error</title>
<style type="text/css">
html {background-color: #eee; font-family: sans;}
body {background-color: #fff; border: 1px solid #ddd;
padding: 15px; margin: 15px;}
pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
</style>
</head>
<body>
<h1>Error: 500 Internal Server Error</h1>
<p>Sorry, the requested URL <tt>'http://192.168.1.91:81/api/volume'</tt>
caused an error:</p>
<pre>Internal Server Error</pre>
</body>
</html>
* arg: 2
* number: 500
BR
Kai-Roger
Kai-Roger