helium / console

A management console to onboard and manage devices running on the Helium blockchain network.
Apache License 2.0
104 stars 31 forks source link

Feature Request: For the Helium console to decode base64 #1149

Closed hpssjellis closed 2 years ago

hpssjellis commented 2 years ago

Feature Request: For the Helium console to have a simple decode of base64

A simple base64 decoding would be very useful for setting up simple integrations, without having to make a custom decoder. This would make basic testing of sensors much easier.

For example in the Integration JSON to be able to enter something like this without making a decoder.

{"value" : {{payload.decoded}} }
jdgemm commented 2 years ago

Given the current system, it appears a prebuilt 64 decoder would solve this use case, correct?

Combining integration and decoding functionality creates additional complexity and confusion.

hpssjellis commented 2 years ago

@jdgemm can we have a few others look at this feature request, perhaps @kent-williams and @jthiller. I get your concern about added complexity, but as a 30 year coding teacher the ease of a quick base64 decoder from the Helium Console JSON area (for people who want it) would actually add integration debugging simplification and reduce confusion.

vicmgs commented 2 years ago

@jdgemm need explanation on what exactly I need to change here

hpssjellis commented 2 years ago

@vicmgs Not sure exactly what you should do but here is the problem. If someone wants to view the original raw data sent to Helium from your Integration you need a decoder like https://github.com/helium/console-decoders/blob/master/debugDecodeBase64.js

and then this for your integration JSON

{ "value": {{decoded.payload.value}} }

A long drawn-out explanation of how to do this using the Arduino PortentaH7 is in the Helium DOCs here

Showing the raw data that was sent to Helium in your integration needs to be easier than using a decoder. If you can figure out how to do this directly in the integration custom JSON, that would be very useful.

vicmgs commented 2 years ago

@hpssjellis just to clarify, you want the ability to skip the function creation to decode base64 payloads, but use the integration json instead to do this simple decoding task.

The ideal workflow would be: you create the device, create the integration, update the integration json with the above, connect the device and integration in flows, and be all done and ready for device testing right?

https://github.com/helium/router/blob/master/src/channels/router_channel_utils.erl#L123-L141

vicmgs commented 2 years ago

it looks like you could do something like the below in the integration json and not connect a function and still decode the base64 somehow. Does that work for what you need?

{ "value": {{base64_to_hex(payload)}} } or { "value": {{base64_to_bytes(payload)}} }

hpssjellis commented 2 years ago

it looks like you could do something like the below in the integration json and not connect a function and still decode the base64 somehow. Does that work for what you need?

{ "value": {{base64_to_hex(payload)}} } or { "value": {{base64_to_bytes(payload)}} }

Thanks @vicmgs I will try that out and yes, if that works it would solve the whole issue, just need it communicated to more people. I should be able to test that today.

hpssjellis commented 2 years ago

@vicmgs

{
"value": {{base64_to_bytes(payload)}}
}

Works awesome I can close this now.

Is there a spot in the Helium Docs that mentions this?

vicmgs commented 2 years ago

awesome, that is great to hear. I will get the docs team involved to write this up.