When I tried to send data to device, I got a handle data-down payload error

Should use armv7 for raspberry pi 3?
Thanks

Yes, but there is no harm in trying it out :wink: In the worst case, you will get an error saying that there is an architecture mismatch between your system and the compiled binary.

Thanks @brocaar.
I tried to use compiled snapshot but app crashes after start service.
I get this logs:

May 01 22:29:50 GreenISys lora-app-server[19815]: time="2018-05-01T22:29:50+01:00" level=info msg="connecting to postgresql"
May 01 22:29:50 GreenISys lora-app-server[19815]: time="2018-05-01T22:29:50+01:00" level=info msg="setup redis connection pool"
May 01 22:29:50 GreenISys lora-app-server[19815]: time="2018-05-01T22:29:50+01:00" level=info msg="handler/mqtt: TLS config is empty"
May 01 22:29:50 GreenISys lora-app-server[19815]: time="2018-05-01T22:29:50+01:00" level=info msg="handler/mqtt: connecting to mqtt broker" server="tcp://localhost:1883"
May 01 22:29:50 GreenISys lora-app-server[19815]: time="2018-05-01T22:29:50+01:00" level=info msg="applying database migrations"
May 01 22:29:50 GreenISys lora-app-server[19815]: time="2018-05-01T22:29:50+01:00" level=info msg="handler/mqtt: connected to mqtt broker"
May 01 22:29:50 GreenISys lora-app-server[19815]: time="2018-05-01T22:29:50+01:00" level=info msg="handler/mqtt: subscribing to tx topic" qos=0 topic=application/+/node/+/tx
May 01 22:29:50 GreenISys systemd[1]: lora-app-server.service: Main process exited, code=exited, status=1/FAILURE
May 01 22:29:50 GreenISys systemd[1]: lora-app-server.service: Unit entered failed state.
May 01 22:29:50 GreenISys systemd[1]: lora-app-server.service: Failed with result 'exit-code'.
May 01 22:29:50 GreenISys systemd[1]: lora-app-server.service: Service hold-off time over, scheduling restart.
May 01 22:29:50 GreenISys systemd[1]: Stopped LoRa App Server.
May 01 22:29:50 GreenISys systemd[1]: Started LoRa App Server.
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=warning msg="Deprecation warning! no configuration file found, falling back on environment variables. Update your configuration, see: https://docs.loraserver.io/lora-app-server/install/config/"
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=info msg="starting LoRa App Server" docs="https://docs.loraserver.io/" version=SNAPSHOT-a5e0304
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=info msg="connecting to postgresql"
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=info msg="setup redis connection pool"
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=info msg="handler/mqtt: TLS config is empty"
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=info msg="handler/mqtt: connecting to mqtt broker" server="tcp://localhost:1883"
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=info msg="applying database migrations"
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=info msg="handler/mqtt: connected to mqtt broker"
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=info msg="handler/mqtt: subscribing to tx topic" qos=0 topic=application/+/node/+/tx
May 01 22:29:50 GreenISys lora-app-server[19831]: time="2018-05-01T22:29:50+01:00" level=fatal msg="applying migrations error: pq: operator class \"gin_trgm_ops\" does not exist for access method \"gin\" handling 0027_global_search.sql"
May 01 22:29:50 GreenISys systemd[1]: lora-app-server.service: Main process exited, code=exited, status=1/FAILURE
May 01 22:29:50 GreenISys systemd[1]: lora-app-server.service: Unit entered failed state.
May 01 22:29:50 GreenISys systemd[1]: lora-app-server.service: Failed with result 'exit-code'.
May 01 22:29:51 GreenISys systemd[1]: lora-app-server.service: Service hold-off time over, scheduling restart.
May 01 22:29:51 GreenISys systemd[1]: Stopped LoRa App Server.
May 01 22:29:51 GreenISys systemd[1]: lora-app-server.service: Start request repeated too quickly.
May 01 22:29:51 GreenISys systemd[1]: Failed to start LoRa App Server.
May 01 22:29:51 GreenISys systemd[1]: lora-app-server.service: Unit entered failed state.
May 01 22:29:51 GreenISys systemd[1]: lora-app-server.service: Failed with result 'exit-code'.

Thanks

I see the correction here:
https://www.loraserver.io/lora-app-server/overview/changelog/

But now get other error:
e = Unimplemented desc = unknown method MigrateChannelConfigurationToGatewayProfile"
May 01 22:51:01 GreenISys lora-app-server[20568]: time=“2018-05-01T22:51:01+01:00” level=error msg=“finished client unary call” error=“rpc error: code = Unimplemented desc = unknown method MigrateChannelConfigurationToGatewayProfile” grpc.code=Unimplemented grpc.method=MigrateChannelConfigurationToGatewayProfile grpc.service=ns.NetworkServer grpc.time_ms=1.37 span.kind=client system=grpc
May 01 22:51:01 GreenISys lora-app-server[20568]: time=“2018-05-01T22:51:01+01:00” level=error msg=“gateway-profile migration failed” error=“migrate gateway-profiles for network-server error: migrate channel-configuration to gateway-profile error: rpc error: code = Unimplemented desc = unknown method MigrateChannelConfigurationToGatewayProfile”
May 01 22:51:03 GreenISys lora-app-server[20568]: time=“2018-05-01T22:51:03+01:00” level=error msg=“finished client unary call” error=“rpc error: code = Unimplemented desc = unknown method MigrateChannelConfigurationToGatewayProfile” grpc.code=Unimplemented grpc.method=MigrateChannelConfigurationToGatewayProfile grpc.service=ns.NetworkServer grpc.time_ms=1.834 span.kind=client system=grpc
May 01 22:51:03 GreenISys lora-app-server[20568]: time=“2018-05-01T22:51:03+01:00” level=error msg=“gateway-profile migration failed” error=“migrate gateway-profiles for network-server error: migrate channel-configuration to gateway-profile error: rpc error: code = Unimplemented desc = unknown method MigrateChannelConfigurationToGatewayProfile”
May 01 22:51:05 GreenISys lora-app-server[20568]: time=“2018-05-01T22:51:05+01:00” level=error msg=“finished client unary call” error=“rpc error: code = Unimplemented desc = unknown method MigrateChannelConfigurationToGatewayProfile” grpc.code=Unimplemented grpc.method=MigrateChannelConfigurationToGatewayProfile grpc.service=ns.NetworkServer grpc.time_ms=1.793 span.kind=client system=grpc
May 01 22:51:05 GreenISys lora-app-server[20568]: time=“2018-05-01T22:51:05+01:00” level=error msg=“gateway-profile migration failed” error=“migrate gateway-profiles for network-server error: migrate channel-configuration to gateway-profile error: rpc error: code = Unimplemented desc = unknown method MigrateChannelConfigurationToGatewayProfile”

Are you on the latest LoRa Server version?

Updated to latest version and works. I will test downlink encode function tomorrow.

Thanks @brocaar for your excellent work.

I think I encountered this problem today. Here is the message from the log:

time=“2018-05-02T15:53:20-06:00” level=error msg=“handle data-down payload error: marshal codec payload to binary error: function must return type slice, got: []int64” application_id=2 dev_eui=647fda000000066c reference=abcd1234

Did you use the binary from the dropbox link (scroll a bit up)? If not: that is exactly what this snapshot is trying to fix and I’m planning to release this soon.

If you do use this snapshot, please let me know how to reproduce this issue, so I can fix this before the next release.

I did not download the snapshot yet … I wanted to confirm this was the same issue. As a temporary workaround, I used floats for all my values.

If you have time to test it, please share your feedback. It should also give you the encoder / decoder errors on the .../error MQTT topic + live device events in the web-interface :slight_smile:

I installed the snapshot from the drop box but I still get the type conversion error.

Here is the log:

time=“2018-05-03T09:52:27-06:00” level=error msg=“handle data-down payload error: marshal codec payload to binary error: invalid slice value, int64” application_id=3 dev_eui=647fda0000000765 reference=abcd1234

Here is the mqtt error topic:

May 03 09:52:27 application/3/node/647fda0000000765/error {“applicationID”:“3”,“applicationName”:“test”,“deviceName”:“tektelic-industrial”,“devEUI”:“647fda0000000765”,“type”:“CODEC”,“error”:“invalid slice value, int64”}

Also, I had an instance where an int32 type did not work either.

And if you push an array of floats as one of the elements in the array, it fails as well:

May 03 12:31:26 application/3/node/647fda0000000765/error {“applicationID”:“3”,“applicationName”:“p263-crusher-shutdown-control”,“deviceName”:“tektelic-industrial”,“devEUI”:“647fda0000000765”,“type”:“CODEC”,“error”:“invalid slice value, []float64”}

Hi,
I tested the snapshot with my encode function:

function Encode(fPort, obj) {
  return [obj.timestamp>>24 && 0xFF,obj.timestamp>>16 && 0xFF,obj.timestamp>>8 && 0xFF,obj.timestamp && 0xFF];
} 

In this case downlink happens but i just receive 0xFF bytes. I changed the mask symbol to this:

function Encode(fPort, obj) {
  return [obj.timestamp>>24 & 0xFF,obj.timestamp>>16 & 0xFF,obj.timestamp>>8 & 0xFF,obj.timestamp & 0xFF];
}

And now i’m getting this error:

May 03 20:43:54 GreenISys lora-app-server[19994]: time="2018-05-03T20:43:54+01:00" level=info msg="handler/mqtt: publishing message" qos=0 topic=application/2/node/0004a30b001ebebc/error
May 03 20:43:54 GreenISys lora-app-server[19994]: time="2018-05-03T20:43:54+01:00" level=error msg="handle data-down payload error: marshal codec payload to binary error: function must return type slice of ints or floats, got: []int32" application_id=2 dev_eui=0004a30b001ebebc reference=abcd1234 

My encoder function is wrong?
Thanks

Thanks for the feedback @ruben_gr and @sslupsky. I will look into it!

That is expected, btw. As it will make your array look like [a, b, c, [d, e, f]] which is not a valid byte array.

My assumption was that the JS VM would only return certain types and I was wrong (assumptions…). I’ve updated the code to handle every possible int / float in the returned array:

@ruben_gr @sslupsky I think this should solve all the reported issues. Thanks again for reporting these. As different Encode functions are returning different types, these errors did not show up in my testing.

Could you test (hopefully) one more time? I’ve created new snapshots including the above change:

Fixes for the above issues have released: https://forum.loraserver.io/t/release-lora-server-0-26-2-and-lora-app-server-0-20-2/1271

Hi @brocaar

Now it’s working (I tested from last snapshot not the release version). I send 1522266426 and receive in RN2483 5ABBF13A in first max_rx.

Why i’m not receiving mac_tx_ok after mac_rx 10 5ABBF13A? Do you know?

Thanks

You can post the steps you followed to receive data to your device. Also the structure of your file to send the data.
I have not been successful yet, my device says it has not received packages.
Thank you.