Weather module: units?


#1

My weather module reports 10072 right now for pressure. In what unit is this value? According to https://gadgetoid.gitbooks.io/flotilla-protocol/content/weather.html this is Pascals, which if I convert to hPa, yields about 100.72. I’m not convinced this is correct.


#2

I’m thinking there’s a factor of 10 out… e.g. i’ve just found an image on Google of a typical barometer and 1000hPa =750mmhg, so, I would imagine your reading equates to 1007.2hPa rather than 100.72hPa.


#3

Certainly!

Further, looking at the code for the internet of seeds ( https://github.com/pimoroni/internet-of-seeds/blob/master/internet-of-seeds.py#L64 ) you can see that this is indeed the case.


#4

yes, the gitbook refers to the raw data obtained over serial, but if you check the flotilla API you’ll see that a factor 10 is applied.

… that said, the gitbook, while correct should probably use figures in plausible range, maybe the standard atmospheric pressure at sea level, or something. I’ll flag it to @gadgetoid next week!


#5

where would the flotilla API (doc?) be?


#6

Good point, it’s lacking :-)

… I rarely use anything these days without looking at the code itself though:


#7

ah, great!

BTW, I’m more than happy to look at source as documentation :)


#8

yes, we’ve just started adding docstrings to our libraries… I suspect the Flotilla API won’t be done for a long while, but I think that’s the plan eventually, alongside better documentation of the API.


#9

Brilliant. Thanks for the comment.


#10

On a related note, are there any docs for the protocol used in flotillad? I’m wondering whether I’m better with a python script using the client (which is exclusive) or running flotillad and having multiple clients connecting to it?


#11

The flotillad commands are a superset of individual module and dock commands, wrapped to target a specific dock.

  • subscribe:0 - Start receiving events from dock 0
  • unsubscribe:0 - Stop receiving events from dock 0
  • dock:0 data:<dock command> - Send <dock command> to dock 0

With the dock:0 data:<dock command> command, the Flotilla Daemon will parse the command and send anything beginning with s (the command for setting a value to a particular channel) to the relevant module update queue internally for that dock.

Anything else is queued as a command. So you can, for example, set the dock name by sending this to flotillad:

dock:0 data:n d dockie

Valid values for <dock command> can be found here: https://www.gitbook.com/book/gadgetoid/flotilla-protocol/details

If you have multiple docks connected, you can set the dock index accordingly and address any of them. Rockpool currently doesn’t support multiple docks, but the protocol should be complete enough for you to use.


#12

Excellent! Thanks a bunch!