NorthStar4BytesDecoder - npolar/argos-ruby GitHub Wiki
Bird-borne North Star Argos transmitters use a 4-byte sensor data format, see MESSAGE FORMATS FOR THE FOUR-BYTE SENSOR DATA BROADCAST BY North Star PTT TRANSMITTERS for detailed documentation.
The argos-ruby project contains a decoder for all 4 message types.
argos-ruby git:(master) ✗ rspec spec/argos/northstar_4bytes_decoder_spec.rb
Argos::NorthStar4BytesDecoder
#sensor_data= forces data to array of 10-base integers
#data
message type 0: [0,1,248,249]
#data is a Hash with current_season and activity_count: {"message_type":0,"current_season":1,"activity_count":248}
message type 1: [1,3,245,255]
#data is a Hash with transmissions (count): {"message_type":1,"transmissions":1013}
message type 2: [2,174,20,184]
#data is Hash with voltage and temperature: {"message_type":2,"voltage":3.48,"temperature":20}
message type 3: [3,2,162,163]
#data is Hash with system_weeks, system_hours, and run_time (seconds): {"message_type":3,"system_weeks":2,"system_hours":162,"run_time":1797980.16}
#temperature (Celsius)
[+]
positive temperature is equal to sensor byte 3 (of 4)
[-]
negative temperature is the complement of the binary number plus 1
#voltage (V)
183 = 3.66V
Finished in 0.00226 seconds (files took 0.23126 seconds to load)
8 examples, 0 failures
Temperature
Temperature data is in the 3rd byte, when the first byte is "02".
Blake Henke, North Star:
On a living bird, the bird’s body heat tends to keep the PTT temperature about 10-15 degrees C above ambient.
- Numbers <= 127 are positive temperatures (in Celsius)
- Numbers >= 128 are negative numbers, they need a conversion
Negative numbers conversion: complement (flip) the 8-bit byte string, add 1, and set to negative
Example query Temperature data of Argos platform 83287 (CSV)
measured platform latitude longitude individual sensor_data
2009-04-06T22:07:11Z ds 83287 35.771 -78.849 10 02|174|20|184
2009-04-06T17:32:24Z ds 83287 10 02|179|54|135
2009-04-06T17:28:24Z ds 83287 10 02|179|54|135
2009-04-06T17:04:23Z ds 83287 10 02|178|48|128
2009-04-06T17:04:23Z diag 83287 10 02|178|48|128
2009-04-06T16:40:21Z ds 83287 35.758 -78.816 10 02|178|48|128
2009-04-06T16:39:51Z diag 83287 35.758 -78.816 10 02|178|48|128
2009-04-06T15:20:18Z ds 83287 10 02|175|21|184
2009-04-06T15:20:17Z diag 83287 36.999 -85.3 10 02|175|21|184
The same data as JSON Array