Jump to content

DMX Bricklet - MQTT - write_frame : Error required argument is not an integer


hdb3

Recommended Posts

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

Link to comment
Share on other sites

Hi Jérémie,

I've got two ideas:

  1. Did you change the UID from XYZ to the UID of your Bricklet? The UID is shown in Brick Viewer.
  2. 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

Link to comment
Share on other sites

Hello Erik,

Thanks for your quick reply.

  1. I use the right UID instead XYZ (EJi)
  2. 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

Edited by hdb3
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...