Hi Sathya,
bin gerade dabei via Homegear “init” Methode einen eigenen RPC Server zu registrieren.
Ich habe allerdings so einige Probleme damit.
Hier ein kurzer Auszug aus dem Logfile. Vielleicht hilft das ja bei der Fehlersuche.
08/20/15 21:21:26.806 RPC Server (Port 2001): Info: Client number 6732 is calling RPC method: init Parameters:
(String) http://10.100.200.111:8080/homeautomation/jsonrpc
(String) RpcClient
(Integer) 16
08/20/15 21:21:30.406 HomeMatic BidCoS packet received (My-CC1101, RSSI: 0x48): 0CD08470306FDC00000000DF3E
08/20/15 21:21:30.408 Module HomeMatic BidCoS: Info: HUMIDITY on channel 1 of HomeMatic BidCoS peer 26 with serial number LEQ1214104 was set to 0x3E.
08/20/15 21:21:30.409 Module HomeMatic BidCoS: Info: TEMPERATURE on channel 1 of HomeMatic BidCoS peer 26 with serial number LEQ1214104 was set to 0x00DF.
08/20/15 21:21:36.631 RPC Server (Port 2001): Info: Connection to client number 6732 closed (3).
08/20/15 21:21:36.807 Info: Calling XML RPC method "system.listMethods" on server http://10.100.200.111 and port 8080.
08/20/15 21:21:36.807 Info: Connecting to host 10.100.200.111 on port 8080...
08/20/15 21:21:36.812 Info: Connected to host 10.100.200.111 on port 8080. Client number is: 6733
08/20/15 21:21:36.922 Error in file Modules/Base/Encoding/XMLRPCDecoder.cpp line 161 in function virtual std::shared_ptr<BaseLib::RPC::Variable> BaseLib::RPC::XMLRPCDecoder::decodeResponse(std::vector<char>&): expected <
08/20/15 21:21:36.923 Error in RPC response from 10.100.200.111 on port 8080: faultCode: -32700 faultString: Parse error. Not well formed: expected <
08/20/15 21:21:36.923 Warning: Error calling XML RPC method "system.listMethods" on server http://10.100.200.111 with port 8080. Error struct:
(Struct length=2)
{
[faultCode]
{
(Integer) -32700
}
[faultString]
{
(String) Parse error. Not well formed: expected <
}
}
Der Java JsonRPC Service sieht so aus
[code]package de.drazil.homegear.jsonrpc;
import java.util.ArrayList;
import java.util.List;
import com.googlecode.jsonrpc4j.JsonRpcMethod;
import com.googlecode.jsonrpc4j.JsonRpcService;
@JsonRpcService("/jsonrpc")
public class RpcService
{
@JsonRpcMethod(“system.listMethods”)
public List listMethods()
{
List methodList = new ArrayList();
methodList.add(“system.listMethods”);
methodList.add(“event”);
methodList.add(“error”);
return methodList;
}
@JsonRpcMethod("event")
public void event(String interfaceId, Integer peerId, Integer channel, String parameterName, Object value)
{
System.out.println("interfaceId:" + interfaceId + " peerId:" + peerId + " channel:" + channel + " parameterName:" + parameterName + " value" + value);
}
@JsonRpcMethod("event")
public void event(String interfaceId, String address, String parameterName, Object value)
{
System.out.println("interfaceId:" + interfaceId + " address:" + address + " parameterName:" + parameterName + " value" + value);
}
@JsonRpcMethod("error")
public void error(String interfaceId, Integer level, String message)
{
System.out.println("interfaceId:" + interfaceId + " level:" + level + " message" + message);
}
}
[/code]
Weiss gerade nicht weiter
Gruss
Guido