EMQX Gateway Connection Error: frame_error, malformed_message_len

Hi there,
I am completely new and I don’t know to handle this error.
I am trying to connect mqtt-SN devices.
I have enabled mqtt-sn connection on port 1884.
When receiving an incoming message from a device I get the following error:
[error] crasher: initial call: emqx_gateway_conn:init/6, pid: <0.18762.1>, registered_name: [], exit: {#{context => function_clause,exception => error,stacktrace => [{emqx_sn_frame,type,[{frame_error,malformed_message_len}],[{file,“emqx_sn_frame.erl”},{line,451}]},{emqx_gateway_conn,inc_incoming_stats,3,[{file,“emqx_gateway_conn.erl”},{line,982}]},{emqx_gateway_conn,handle_incoming,2,[{file,“emqx_gateway_conn.erl”},{line,746}]},{emqx_gateway_conn,process_msg,2,[{file,“emqx_gateway_conn.erl”},{line,405}]},{emqx_gateway_conn,process_msg,2,[{file,“emqx_gateway_conn.erl”},{line,411}]},{emqx_gateway_conn,handle_recv,3,[{file,“emqx_gateway_conn.erl”},{line,368}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}]},[{emqx_gateway_conn,terminate,2,[{file,“emqx_gateway_conn.erl”},{line,589}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}]}, ancestors: [<0.2490.0>,esockd_sup,<0.1923.0>], message_queue_len: 0, messages: [], links: [<0.2490.0>], dictionary: [{incoming_bytes,90},{‘$logger_metadata$’,#{peername => “xx:xx:xx:xx:12078”}},{recv_pkt,1}], trap_exit: false, status: running, heap_size: 6772, stack_size: 28, reductions: 36877; neighbours:

The lprevious log message says:
[error] at_state: #{}, input_bytes: <<22,254,255,0,0,0,0,0,0,0,1,0,77,1,0,0,65,0,0,0,0,0,0,0,65,254,253,109,146,83,86,245,155,49,9,5,42,157,106,226,115,52,221,40,125,100,201,17,243,262,88,86,244,42,167,251,160,46,70,0,0,0,6,192,168,0,174,0,255,1,0,0,17,0,53,0,9,8,31,102,0,161,50,65,130,33,0,22,0,0>>, line: 725, mfa: emqx_gateway_conn:parse_incoming/2, msg: parse_frame_failed, peername:xx:xx.x:x::12078, reason: malformed_message_len, stacktrace: [{emqx_sn_frame,parse,3,[{file,“emqx_sn_frame.erl”},{line,69}]},{emqx_sn_frame,parse,2,[{file,“emqx_sn_frame.erl”},{line,64}]},{emqx_gateway_conn,parse_incoming,3,[{file,“emqx_gateway_conn.erl”},{line,711}]},{emqx_gateway_conn,parse_incoming,2,[{file,“emqx_gateway_conn.erl”},{line,698}]},{emqx_gateway_conn,process_msg,2,[{file,“emqx_gateway_conn.erl”},{line,405}]},{emqx_gateway_conn,handle_recv,3,[{file,“emqx_gateway_conn.erl”},{line,368}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}]

What does the error say and how can it be fixed? I can’t believe that the message length is malformed as the device had sent the data to another mqtt-sn broker without a problem.

I really hope you can help me out :slight_smile:

Hi, @anma
This should be caused by the fact that two MQTT-SN packets are merged into one UDP packet. EMQX does not support sticky packets yet.
You need to send them in two UDP packets.

Thank you very much for your help!