hdb3 Geschrieben August 8, 2021 at 19:15 Geschrieben August 8, 2021 at 19:15 Hello there, I am working with bricklet DMX. I need to use it as DMX mode master and MQTT API. Unfortunately, when I publish on topic "tinkerforge/request/dmx_bricklet/XYZ/write_frame" a message with value "'{"frame": [255,128,0]}' " I get message "_ERROR": "required argument is not an integer (call of write_frame of dmx_bricklet XYZ)" on topic "tinkerforge/response/dmx_bricklet/XYZ/write_frame" It work perfectly with Brick Viewer. My setup: Hardware: DMX Bricklet with FW 2.0.3 on HAT Brick FW 2.0.2 MQTT brocker: mosquitto version 1.6.10 MQTT Client: MQTT-Explorer 0.4.0-beta Do you know if do something wrong? or if is it a bug? Thanks in advance for any help. Jérémie Zitieren
rtrbt Geschrieben August 9, 2021 at 07:08 Geschrieben August 9, 2021 at 07:08 Hi Jérémie, I've got two ideas: Did you change the UID from XYZ to the UID of your Bricklet? The UID is shown in Brick Viewer. Please check the quoting of your payload: 11 hours ago, hdb3 said: "'{"frame": [255,128,0]}' " If you quote with " at the outer-most layer, you have to escape the innner " around frame. However then the single quotes are unnecessary. I'm not sure how this works in MQTT explorer, but I would assume the correct way to quote would be either '{"frame": [255,128,0]}' or "{\"frame\": [255,128,0]}" depending on support for single quotes in MQTT explorer. If this does not help, my next question would be what version of the MQTT bindings you are running. Also you could check whether other functions work correctly. For example get_identity (does not require any parameters, i.e. you can just send an empty message). Cheers, Erik Zitieren
hdb3 Geschrieben August 9, 2021 at 08:00 Autor Geschrieben August 9, 2021 at 08:00 (bearbeitet) Hello Erik, Thanks for your quick reply. I use the right UID instead XYZ (EJi) I think it's not a quoting issue because when I don't put correct quotes, I get: {"_ERROR": "Could not parse payload for write_frame call of dmx_bricklet EJi as JSON: Extra data: line 1 column 4 (char 3)"} I also have a Segment Display 4x7 Bricklet and use similar synthax for function "set_numeric_value" and it work well. My MQTT bindings version is tinkerforge_mqtt 2.0.15 I try other function like "get_dmx_mode", "read_frame", "set_dmx_mode" and "get_dmx_mode". It work perfectly. Here is output of "get_identity": {"uid": "EJi", "connected_uid": "Lnk", "position": "a", "hardware_version": [1, 0, 0], "firmware_version": [2, 0, 3], "device_identifier": "dmx_bricklet", "_display_name": "DMX Bricklet"} Thanks for your help Jérémie bearbeitet August 9, 2021 at 08:01 von hdb3 Zitieren
rtrbt Geschrieben August 9, 2021 at 10:14 Geschrieben August 9, 2021 at 10:14 Hm thats strange. What is the Python version that you are running the MQTT bindings with? Please test again with the attached version of the bindings (and run the bindings with --debug ). I've added some details to the error message. tinkerforge_mqtt Edit: Nevermind I've just managed to reproduce the error. Let me take a look. Zitieren
rtrbt Geschrieben August 9, 2021 at 12:33 Geschrieben August 9, 2021 at 12:33 There was indeed a bug in the streaming logic used by write_frame. Does the attached version work on your side? If yes, the bugfix will be released with the next version of the bindings. Cheers, Erik tinkerforge_mqtt Zitieren
hdb3 Geschrieben August 9, 2021 at 20:23 Autor Geschrieben August 9, 2021 at 20:23 I just try this MQTT binding and it work perfectly. Issue is fixed. Thanks a lot for your very quick help on this topic. It's realy a pleasure to work with Tinkerforge! Jérémie Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.