PiLight Fail Json error - help please :)

Hi there

I’m new to OMG, trying to get my Nexa remote and plugs automated. I’ve got a ESP-WROOM-32 dev board, connected to a CC1101, running the web-upload firmware espdev-plight-cc1101 v1.60.

I’m able to set everything up and I can see the MQTT messages via MQTT Explorer. I am getting a ‘Fail Json’ message when I send what I think is valid.

This is the output when the device starts:

N: OpenMQTTGateway URL: http://192.168.0.38/
N: ZwebUI setup done
N: RF_EMITTER_GPIO: 12 
N: RF_RECEIVER_GPIO: 27 
N: Switching to Pilight Receiver: 433.92
E: deserialize config failed: EmptyInput, buffer capacity: 0
W: failed to load json config
N: OpenMQTTGateway modules: ["WebUI","Pilight"]
N: ************** Setup OpenMQTTGateway end **************
W: MQTT connection...
N: Connected to broker
N: Send on /SYStoMQTT msg {"uptime":4,"version":"v1.6.0","discovery":true,"ohdiscovery":false,"env":"esp32dev-pilight-cc1101","freemem":191856,"mqttport":"1883","mqttsecure":false,"minfreemem":187344,"tempc":49.44444,"freestack":5200,"rssi":-58,"SSID":"VM8275411","BSSID":"A4:05:D6:24:4F:26","ip":"192.168.0.38","mac":"08:D1:F9:D1:D1:F8","actRec":1,"mhz":433.92,"modules":["WebUI","Pilight"]}
N: Send on /WebUItoMQTT msg {"displayMetric":true,"webUISecure":true,"displayQueue":1}
N: Update check, free heap: 194336N: Send on /RLStoMQTT msg {"latest_version":"v1.6.0","title":"OpenMQTTGateway","release_url":"https://github.com/1technophile/OpenMQTTGateway/releases/tag/v1.6.0","installed_version":"v1.6.0","entity_picture":"https://github.com/1technophile/OpenMQTTGateway/raw/development/docs/img/Openmqttgateway_logo_mini_margins.png","release_summary":""}
N: Send on /SYStoMQTT msg {"uptime":124,"version":"v1.6.0","discovery":true,"ohdiscovery":false,"env":"esp32dev-pilight-cc1101","freemem":194988,"mqttport":"1883","mqttsecure":false,"minfreemem":126244,"tempc":48.33333,"freestack":3132,"rssi":-61,"SSID":"VM8275411","BSSID":"A4:05:D6:24:4F:26","ip":"192.168.0.38","mac":"08:D1:F9:D1:D1:F8","actRec":1,"mhz":433.92,"modules":["WebUI","Pilight"]}
N: Send on /WebUItoMQTT msg {"displayMetric":true,"webUISecure":true,"displayQueue":1}

Pushing a single button on the remove that turns on the switch outputs the following:

N: Send on /PilighttoMQTT msg {"message":{"id":15062442,"unit":1,"state":"on"},"protocol":"smartwares_switch","length":"15062442","value":"15062442","repeats":2,"status":2}
N: Send on /PilighttoMQTT msg {"message":{"id":15062442,"unit":1,"state":"on"},"protocol":"arctech_switch","length":"15062442","value":"15062442","repeats":2,"status":2}
N: Send on /PilighttoMQTT msg {"message":{"id":15062442,"unit":1,"state":"up"},"protocol":"arctech_screen","length":"15062442","value":"15062442","repeats":2,"status":2}
N: Send on /PilighttoMQTT msg {"message":{"id":15062442,"unit":1,"state":"on"},"protocol":"arctech_dimmer","length":"15062442","value":"15062442","repeats":2,"status":2}
N: Send on /PilighttoMQTT msg {"message":{"id":15062442,"unit":1,"state":"opened"},"protocol":"arctech_contact","length":"15062442","value":"15062442","repeats":2,"status":2}

Using MQTT Explorer to send the message back to turn on the switch (first line with “protocol”:“smartwares_switch” and replacing “state”:“on” to “on”:1, this is the output I get, and the relay on the switch remains quiet:

N: [ MQTT->OMG ]: {"message":{"id":15062442,"unit":1,"off":"1"},"protocol":"smartwares_switch","length":"15062442","value":"15062442","repeats":2}
E: MQTTtoPilight Fail json
N: Switching to Pilight Receiver: 433.92
E: deserialize config failed: EmptyInput, buffer capacity: 0
W: failed to load json config

I’ve spent the last 8 hours scouring the forums and general www for a solution, without any luck.

This post seems to have a similiar issue reported, without any resolution:
https://community.openmqttgateway.com/t/pilight-1-6-0-cant-see-cc1101/2576

Any help you might have would be appreciated, please

Hello,

Could you try to remove this from the message:
"length":"15062442","value":"15062442"

and try again with the different protocols

Thank you so much for getting back to me.

I tried as you suggested and got the same Json Fail messages :frowning:

N: [ MQTT->OMG ]: {"message":{"id":15062442,"unit":1,"on":1},"protocol":"arctech_contact","repeats":2,"status":2}
E: MQTTtoPilight Fail json
N: Switching to Pilight Receiver: 433.92

N: [ MQTT->OMG ]: {"message":{"id":"15062442","unit":"1","on":"1"},"protocol":"arctech_contact","repeats":2,"status":2}
E: MQTTtoPilight Fail json
N: Switching to Pilight Receiver: 433.92

N: [ MQTT->OMG ]: {"message":{"id":"15062442","unit":"1","on":"1"},"protocol":"smartwares_switch","repeats":2,"status":2}
E: MQTTtoPilight Fail json
N: Switching to Pilight Receiver: 433.92

N: [ MQTT->OMG ]: {"message":{"id":"15062442","unit":"1","on":"1"},"protocol":"arctech_switch","repeats":2,"status":2}
E: MQTTtoPilight Fail json
N: Switching to Pilight Receiver: 433.92

N: [ MQTT->OMG ]: {"message":{"id":"15062442","unit":"1","on":"1"},"protocol":"arctech_screen","repeats":2,"status":2}
E: MQTTtoPilight Fail json
N: Switching to Pilight Receiver: 433.92

N: [ MQTT->OMG ]: {"message":{"id":"15062442","unit":"1","on":"1"},"protocol":"arctech_dimmer","repeats":2,"status":2}
E: MQTTtoPilight Fail json
N: Switching to Pilight Receiver: 433.92

Try maybe to have only the necessary message and protocol, alternating “on”:0 and “on”:1

Thanks for the help. I did as you asked and more.

I spent an evening trying to debug. Confirmed my connections are correct and even setup a second MQTT gateway as a listener to see if anything was being transmitted. Fiddled around with the MQTT message to send to OMG and tried every combination of fields. Unfortunately nothing resolved the issue.- I’m still getting the ‘Fail Json’ error.

This does not mean that the RF message is not sent, are you close enough from the receiver?

Yes everything was in the same room and within 1m on each other. What concerned my most was the second omg “listener” didn’t pick up any transmissions from the first.

I’ve ordered a different tx/Rx combo to give it one last try. I enjoy tinkering bit I’m starting to wonder if the cc1101 might be a lost cause.

Thanks again for your help. I’ll report back here once the new hardware is tested

1 Like

I have it working with v1.6.0, a CC1101 and these examples:

home/OMG_ESP32_Pilight-CC1101/commands/MQTTtoPilight
{
  "message": "{\"id\":29,\"unit\":13,\"off\":1}",
  "protocol": "arctech_switch_old"
}
home/OMG_ESP32_Pilight-CC1101/commands/MQTTtoPilight
{
  "message": "{\"id\":29,\"unit\":13,\"on\":1}",
  "protocol": "arctech_switch_old"
}