Websocket response "Device not found."

Hi,

I have homegear running with pimatic as frontend. Everything was working until the last update to Homegear version 0.7.9-1375.

I have updated from 1.6 to 2.5 firmware with my HM-ES-PMSw1-Pl. The Devices are listed in peers list with the new version 2.5

      1 │                           │   4DA875 │    NEQ0881440 │ 0095 │               HM-CC-RT-DN │      1.4 │             No │      No │      No
      2 │                           │   4DA8C1 │    NEQ0881444 │ 0095 │               HM-CC-RT-DN │      1.4 │             No │      No │      No
      3 │                           │   4CE52E │    NEQ0872964 │ 0095 │               HM-CC-RT-DN │      1.4 │             No │      No │      No
      4 │                           │   4D19D9 │    NEQ0869138 │ 00D8 │        HM-LC-Sw1-Pl-DN-R1 │      2.6 │             No │      No │      No
      5 │                           │   4B3003 │    NEQ0386979 │ 00AC │            HM-ES-PMSw1-Pl │      2.5 │             No │      No │      No
      6 │                           │   4A7FE2 │    NEQ0385295 │ 00AC │            HM-ES-PMSw1-Pl │      2.5 │             No │      No │      No
      7 │                           │   4B302F │    NEQ0386952 │ 00AC │            HM-ES-PMSw1-Pl │      2.5 │             No │      No │      No

Manually switching the 5|6|7 is working and homegear broadcasts the state.
But for some reason calling setValue with id 7 fails with ‘Device not found’

10/03/17 21:14:15.435 RPC Server (Port 2001): Info: Client number 12 is calling RPC method: setValue (4) Parameters:
(Integer) 7
(Integer) 1
(String) STATE
(Boolean) 0
10/03/17 21:14:15.435 RPC Server (Port 2001): Response: 
(Struct length=2)
{
  [faultCode]
  {
    (Integer) -2
  }
  [faultString]
  {
    (String) Device not found.
  }
}

Has something fundamentally changed?

Anyone? I think this is an enormous problem since a fresh install to a clean debian armbian system leads to the same result.

auth: none

Using this { "jsonrpc": "2.0", "id": 125, "method": "getValue", "params": [5,2,'STATE']}

Prints the following error in the log:
10/08/17 14:10:32.309 RPC Server (Port 2001): Info: Connection from ::ffff:192.168.100.110:49170 accepted. Client number: 12
10/08/17 14:10:32.310 RPC Server (Port 2001): Info: RPC server client id for client number 12 is: 2
10/08/17 14:10:32.312 RPC Server (Port 2001): Error in file RPC/RPCServer.cpp line 666 in function void Rpc::RPCServer::analyzeRPC(std::shared_ptrRpc::RPCServer::Client, std::vector&, Rpc::RPCServer::PacketType::Enum, bool): Tried to decode invalid number.


Edit

Ok using double quotes for String leads to the initial “Device not found” error.

      1 │        │   4A7FE2 │    NEQ0385295 │ 00AC │     HM-ES-PMSw1-Pl │      2.5 │      No │      No │      No

{ 
  "id": 125,
  "jsonrpc": "2.0",
  "method": "getValue",
  "params": [1,2, "STATE"]
}

10/08/17 14:25:34.485 RPC Server (Port 2001): Info: Client number 15 is calling RPC method: getValue (3) Parameters:
(Integer) 1
(Integer) 2
(String) STATE
10/08/17 14:25:34.485 RPC Server (Port 2001): Response: 
(Struct length=2)
{
  [faultCode]
  {
    (Integer) -2
  }
  [faultString]
  {
    (String) Device not found.
  }
}
10/08/17 14:25:34.486 Encoding JSON struct.
10/08/17 14:25:34.486 Encoding JSON integer "-2".
10/08/17 14:25:34.486 Encoding JSON string.
10/08/17 14:25:34.487 Encoding JSON integer "125".
10/08/17 14:25:34.487 Encoding JSON string.
10/08/17 14:25:34.487 RPC Server (Port 2001): Response packet: HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Type: application/json
Content-Length: 78

{"error":{"code":-2,"message":"Device not found."},"id":125,"jsonrpc":"2.0"}

I do not understand why no one else has this problem.

Using integerValue64 result in 0, but 1 was given.

10/09/17 18:38:42.751 RPC Server (Port 2001): Info: Client number 9 is calling RPC method: getValue (3) Parameters:
(Integer) 1
(Integer) 2
(String) STATE
INT:   1
INT64: 0

This was changed from 0.7.8 -> 0.7.9 so it seems to be the problem here.

1 Like

Found the issue.

libhomegear-base/src/Variable.h is missing the integerValue64 assignment in the uint8_t constructor.

2 Likes

Hey @pheinrich,

you are not the only one who reported the problem. I would have looked into it tomorrow. So I was surprised to see the solution in your pull request on GitHub. Great job!

Cheers,

Sathya