-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle raw readings published on device/sck/device_token:/readings/raw
#185
Conversation
Nice job @vicobarberan ! 👏 I am adding a test for the Todo:
Example output after parsing this test data I copied from the Firmware example:
JSON.parse(reading)
{"recorded at"=>":2017-03-24T13:35:14Z", "sensors"=>[{"id"=>29, "value"=>48.45}, {"id"=>13, "value"=>66}, {"id"=>12, "value"=>28}, {"id"=>10, "value"=>4.45}]} |
Thanks for your fast response!! |
@vicobarberan I will add the tests. But do you know why are we manually creating a JSON object here: smartcitizen-api/app/lib/mqtt_messages_handler.rb Lines 47 to 53 in 88c1b97
I think if we already have the data on the server, we just need to send it to the This is a normal This is the new I think we could simply add the values as a Ruby Hash Then Line 47 could start like this: |
I updated the code to use the Hash and we are progressing. Now when using a normal
|
GitHub actions still fails this test
Add handling for raw readings published by the kit in
device/sck/device_token:/readings/raw
topic.With this change the size of the payload is reduced to around 35% of original size.
This is the firmware commit that enables raw readings publishing on the kit side.