aideen
Posts: 17
Joined: Fri Jun 15, 2012 11:43 pm
Location: Cambridge, UK

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Wed Jan 09, 2013 10:55 am

I've posted some notes and pictures of my experiences using Kevin's software with Ciseco's EVE Alpha add-on board for thePi. Works well and was fun to do!

http://amcc.me.uk/2013/01/eve-alpha-col ... ther-data/

Aideen

kenmc
Posts: 58
Joined: Fri May 04, 2012 8:02 am
Location: Dublin, Ireland
Contact: Website

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Wed Jan 09, 2013 1:41 pm

kenmc wrote: Will try get the code updated asap...
Updated code is here : https://github.com/kenmcc/wh1080listener.git if anyone is interested. It's not based on Kevins' latest code changes though.
this is the running code. it expects a bmp085, and a rev1 board.

some #defines at the top of weatherlogger.c indicate the storage for the data.
http://goatstownweather.eu.pn

hystrix
Posts: 50
Joined: Mon Jan 07, 2013 12:44 pm

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Fri Jan 11, 2013 2:07 pm

Does anyone have a circuit diagram to show how to connect an RFM12B and BST-BMP085 to the Raspberry Pi?

I am currently using pywws with my Fine Offset and get the common lock-up problem with the base unit, so I am keen to have a go at bypassing the base unit. Any help will be appreciated.

Btw, I have changed from LiveLog.py to Hourly.py running every 10 minutes just to see how that goes.

Many thanks.

dickydodds
Posts: 25
Joined: Sun Oct 14, 2012 10:40 am

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sat Jan 12, 2013 11:24 am

Have a look at Kevins page and use the RFM01 - he found it much better than the 12B he was using until he blew it up!
http://www.susa.net/wordpress/2012/08/r ... nd-rfm12b/

I am using the RFM01 and kevins instructions and its been working great as a rats nest on my living room table for nearly a week now - its brilliant. Also, as of last night I got the data into an RRD database - been busy with work so didn't have the time!

And this forum is all about working with it if you would like to read from the start.

Cheers,

Dicky

chsims1
Posts: 18
Joined: Wed May 23, 2012 9:00 am

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 9:53 am

This all looks very interesting. I've been fiddling with pywws on my RPi in anticipation of my (faithful) Linksys NSLU2 dying in the not too distant future, but had been a bit disheartened by the usb problems.

I wish that I had seen the EVE kickstarter mentioned by Aideen:

http://amcc.me.uk/2013/01/eve-alpha-col ... ther-data/

as this board would have been the easiest way to proceed for a soldering-capable, but novice electronics DIYer.

Kevin's article was informative:

http://www.susa.net/wordpress/2012/08/r ... nd-rfm12b/

but I could do with a bit more hand-holding. For example, is it necessary to mount the RFM01 or can it simply be wired directly to a header, what is the role of 'pull-up resistors' and how exactly are they incorporated? What is the easiest way to get the data out from the C-routines into, say python?

I like the idea of letting pywws still handle the processing of the raw data etc. in Ken's approach:

https://github.com/kenmcc/wh1080listener

Any chance of some more details here Ken in how these routines are used in tandem with pywws?

It would be nice to have all these approaches written up as a project that is easily followed, and suggest sources for the bits such as Maplin for the RFM01 etc.

Keep up the good work guys,

Ian Sutherland

aideen
Posts: 17
Joined: Fri Jun 15, 2012 11:43 pm
Location: Cambridge, UK

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 10:18 am

Hi Ian,

On the software side:
I plan to use MQTT or more specifically http://mosquitto.org/ to publish the data from Kevin's C code (see: http://mosquitto.org/api/files/mosquitt ... to_publish) so that other utilities such as pywws can subscribe. This is a useful and flexible approach since you might want to use the data in different ways over time. I'll try and write up some notes in due course.

For some inspiration see: http://mqtt.org/2012/11/mqtt-inventors-speak-at-tedx

I really like Jeelabs http://jeelabs.org as a source of information and inspiration. I think I heard about EVE in the forums there.

Aideen

kenmc
Posts: 58
Joined: Fri May 04, 2012 8:02 am
Location: Dublin, Ireland
Contact: Website

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 12:01 pm

chsims1 wrote: https://github.com/kenmcc/wh1080listener
Any chance of some more details here Ken in how these routines are used in tandem with pywws?
Ian Sutherland
Hi Ian
I modified pywws very slightly, so that it doesn't try and access the USB link to the head unit, essentially it jumps into the process as if it had just done a successful read. I put the modified pywws up in the github repo in the pywws directory.

It runs every couple of minutes as the "hourly" script, but again I think I've modded that script to allow it to upload more than once an hour ( i think it was checking to see if the time since last operation was greater than a certain threshold )

I've piggybacked on the pywws and the sqlite to use dygraphs for the main graphing on the website, as i didn't like pywws graphs. So as part of the cron I run a couple of sql querys on the database which produces CSV files for the dygraphs which get uploaded by pywws to the webserver.

I'll try find time to write it up more, and with more specific details, but I hacked it all during moments of quiet time over the last few months, so it's a bit spaghettish I'm afraid, but hopefully there's enough to get you going.
K
http://goatstownweather.eu.pn

hystrix
Posts: 50
Joined: Mon Jan 07, 2013 12:44 pm

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 3:02 pm

I am interested too in having more information on getting the routines working with pywws, if someone has some specific details.

In the meantime, I have created a quick wiring diagram for connecting an RFM01 and BMP085 to a Pi:

http://sh.digitalvault.bt.com/invite/lo ... mg&lang=en

I am still unclear as to whether pull up resistors are needed on the SDO -> MISO and SDI -> MOSI connections, so some guidance on this would be appreciated. Have I missed anything else?

Many thanks.

chsims1
Posts: 18
Joined: Wed May 23, 2012 9:00 am

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 4:08 pm

Thanks Aideen & Ken. Useful diagram hystrix; you might want to include the 3V3 and ground for the sake of completeness.

hystrix
Posts: 50
Joined: Mon Jan 07, 2013 12:44 pm

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 5:10 pm

chsims1 wrote:Thanks Aideen & Ken. Useful diagram hystrix; you might want to include the 3V3 and ground for the sake of completeness.
I have added the VDD and GND connections to RFM01, plus the Antenna. Hopefully I haven't missed anything else.

I'll update again if I get any info on those pull-up resistors....

kenmc
Posts: 58
Joined: Fri May 04, 2012 8:02 am
Location: Dublin, Ireland
Contact: Website

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 6:30 pm

Ok, from what I can see, I just commented out the line in "Hourly.py" which says
# get weather station data
# LogData.LogData(params, raw_data)

Although I can't honestly remember what else I changed to make it work.Have a look in the github posted earlier, that's my running code.
http://goatstownweather.eu.pn

chsims1
Posts: 18
Joined: Wed May 23, 2012 9:00 am

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 7:07 pm

Thanks Ken. I assume that the transmission every 48 secs from the head unit is simply current conditions, so what happens about the pywss code checking stuff stored in the display unit (or am I totally barking up the wrong tree here).

Ian

dickydodds
Posts: 25
Joined: Sun Oct 14, 2012 10:40 am

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 8:35 pm

Regarding the resistors - I have not used any resistors at all and its currently a 'rats nest' of wires and working flawlessly! I am using a rev 2 board and connected up Kevin's diagnostic LED too. I don't have time to wire it onto a bit of vero etc at the moment.

The pi boots, I have 2 modprobe commands in /etc/rc.local and the run the code from rc.local too - and it just works! I havent even added the code to make the GPIO 27 an input line as it seems to default to input as is - like Kevin says.

In fact, its seems to be working better than PYWWS on my second pi - I am getting a few missing bits in the graphs but my RRD data graphs have not missed anything in over a week! It seems the RFM01 is very tolerant of poor wiring! Admittedly, I am creating a file with the data from Kevin's code and ftp it to a linux PC and run RRD there so that might be why I don't miss any data.

When the EVE board is on sale properly, I will likely get one of those as it will be easy to solder the RFM01 on it.

Gotta thank Kevin again for his code and article and help!

Dicky

chsims1
Posts: 18
Joined: Wed May 23, 2012 9:00 am

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 8:43 pm

Thanks for the info on the resistors Dicky. I would be happy though if one of those in the know could give a simple description as to why or why not they may be needed :)

Ian

ksangeelee
Posts: 192
Joined: Sun Dec 25, 2011 5:25 pm
Location: Edinburgh, UK
Contact: Website

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 8:48 pm

hystrix wrote:I am still unclear as to whether pull up resistors are needed on the SDO -> MISO and SDI -> MOSI connections, so some guidance on this would be appreciated.
I'm quite sure you don't need them; everything I've read on SPI states they're not needed (but I could never find any formal specification on SPI). They were added in the process of trying to get the module to work (my first experience of SPI), and simply never got removed.

I think that the original article questions the relevance of the resistors, and I've just read Dicky's confirmation that it all works without them (thanks - so, we're 100% sure then!)


kenmc
Posts: 58
Joined: Fri May 04, 2012 8:02 am
Location: Dublin, Ireland
Contact: Website

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Sun Jan 13, 2013 9:48 pm

chsims1 wrote:Thanks Ken. I assume that the transmission every 48 secs from the head unit is simply current conditions, so what happens about the pywss code checking stuff stored in the display unit (or am I totally barking up the wrong tree here).
Ian
Hi Ian,
the way it works is that every 48 seconds the head unit gets told the conditions outside. It also adds on the stuff it knows itself; pressure, internal temp, internal humidity and stores them in the headunit. PYWWS then goes along every X minutes (hourly i guess) and pulls the data from the headunit.

What I'm doing instead is taking the 48second transmission data and storing it in the same format as pywws stores it when it pulls it from the head unit. THen every 10 minutes (or however often you want) I tell pywws to go and "get" the data from the headunit and process it. Except that it's not talking to the head unit, that bit is commented out, so pywws just operates on the latest data it has, which is what we've captured and saved from the rfm01 and bmp085 (for pressure, inside temp). The only thing I don't bother with is the internal humidity, as it's not really that interesting to me tbh.

Does that make it clearer?
K
http://goatstownweather.eu.pn

chsims1
Posts: 18
Joined: Wed May 23, 2012 9:00 am

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Mon Jan 14, 2013 8:40 am

Thank you Ken, yes it does :)

RFM01 on the way, so I should hopefully be able to have a play next weekend.

Ian

kenmc
Posts: 58
Joined: Fri May 04, 2012 8:02 am
Location: Dublin, Ireland
Contact: Website

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Mon Jan 14, 2013 8:48 am

Cool so. If you've not got a bmp085 also, you'll need to comment out a bit in the code - I think Kevin has a #define in his, I think I have the same in my version too. If using my code, beware that it expects sqlite to be installed; it doesn't handle the case well where there's none.
K
http://goatstownweather.eu.pn

User avatar
KarlS
Posts: 42
Joined: Fri Oct 12, 2012 1:10 pm

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Mon Jan 14, 2013 8:45 pm

Hi Kevin

Here is another problem: I live in Canada and my National Geographic 265NC (re-branded Fine Offset WH1080) has a sticker on the back that says 915MHz.

I’m a retired software engineer, and when I studied my trade in the mid 70s, a standing joke was “Beware of programmers who carry soldering irons”. So my exposure to hardware and electronics in general was rather limited. Also, my knowledge of C programming dates back to this time and is a bit rusty at the moment (I still own a first edition of K&R The C Programming Language). However, a few more days and I will probably understand most of your program.

Here is what I did until now. I connected the 915MHz version of the RFM01 to the RasPi as described in your blog. I made some changes to the source code, namely in rfm01.h

Code: Select all

#define BAND_915                (3 << 11)

and in wh1080_rf.c

Code: Select all

uint16_t cmd_freq    = CMD_FREQ|0x7d0;    // 915 MHz --> F  = ((915 / (10 * 3)) - 30) * 4000
…
uint16_t cmd_config  = CMD_CONFIG|BAND_915|LOAD_CAP_12C0|BW_67;
This configuration produced the RSSI table and then the output stopped. I played around with the bandwidth, the rf frequency (after all I have no idea if the TX really broadcasts at 915MHz; it could be anything from 900.72 to 929.27MHz), the load cap values …

Anyway, you can guess from this description that I’m just fishing. I have no real understanding of what I am doing here. The only way to get more than just dots (for short packages) was to configure bandwidth to BW_200 or even BW_270. Here is an example:

Code: Select all

Initialising RFM01
SPI: mode 0, 8-bit, 1000 KHz
Ctrl+C to exit
  LNA_0,RSSI_73 idx 0     0.00    0.00    0.00    0.00    0.00    0.00  
  LNA_0,RSSI_79 idx 1     0.00    0.00    0.00    0.00    0.00    0.00  
  LNA_0,RSSI_85 idx 2     0.00    0.00    0.00    0.00    0.00    0.00  
  LNA_0,RSSI_91 idx 3     0.00    0.00    0.00    0.00    0.00    0.00  
  LNA_0,RSSI_97 idx 4     0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_0,RSSI_103 idx 5     0.00    0.00    8.51  100.00< 100.00  100.00  
  LNA_6,RSSI_73 idx 6     0.00    0.00    0.00    0.00    0.00    0.00  
  LNA_6,RSSI_79 idx 7     0.00    0.00    0.00    0.00    0.00    0.00  
  LNA_6,RSSI_85 idx 8     0.00    0.00    0.00    0.00    0.00    0.00  
  LNA_6,RSSI_91 idx 9     0.00    0.00    0.00    0.00    0.00    0.00  
  LNA_6,RSSI_97 idx 10    0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_6,RSSI_103 idx 11    0.00    0.00    0.00   35.11  100.00  100.00  
 LNA_14,RSSI_73 idx 12    0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_14,RSSI_79 idx 13    0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_14,RSSI_85 idx 14    0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_14,RSSI_91 idx 15    0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_14,RSSI_97 idx 16    0.00    0.00    0.00    0.00    0.00    0.00  
LNA_14,RSSI_103 idx 17    0.00    0.00    0.00    0.00    0.00   86.84  
 LNA_20,RSSI_73 idx 18    0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_20,RSSI_79 idx 19    0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_20,RSSI_85 idx 20    0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_20,RSSI_91 idx 21    0.00    0.00    0.00    0.00    0.00    0.00  
 LNA_20,RSSI_97 idx 22    0.00    0.00    0.00    0.00    0.00    0.00  
LNA_20,RSSI_103 idx 23    0.00    0.00    0.00    0.00    0.00   41.49  
RSSI Duty 99.68
Pulse stats: Hi: 146 - 969   Lo: 1045 - 5411  (53 point)
Data bits = 86   (offset 0) (31 short) No packet signature found
Pulse stats: Hi: 112 - 979   Lo: 1013 - 9683  (86 point)
Pulse stats: Hi: 109 - 973   Lo: 1086 - 22806  (55 point)
 Data bits = 81   (offset 0) (220 short) No packet signature found
Pulse stats: Hi: 115 - 992   Lo: 1021 - 6146  (81 point)
Pulse stats: Hi: 117 - 873   Lo: 1029 - 6314  (47 point)
 Data bits = 72   (offset 0) (226 short) No packet signature found
Pulse stats: Hi: 111 - 941   Lo: 1007 - 5075  (72 point)
 Data bits = 65   (offset 0) (226 short) No packet signature found
Pulse stats: Hi: 119 - 972   Lo: 1038 - 4952  (65 point)
Pulse stats: Hi: 149 - 896   Lo: 1003 - 5985  (43 point)
 Data bits = 235   (offset 0) (233 short) No packet signature found
Pulse stats: Hi: 112 - 995   Lo: 1003 - 5086  (235 point)
 Data bits = 67   (offset 60) (234 short) Packet signature found
Pulse stats: Hi: 114 - 978   Lo: 1008 - 5090  (67 point)
 Data bits = 115   (offset 0) (235 short) No packet signature found
Pulse stats: Hi: 113 - 943   Lo: 1044 - 6885  (115 point)
Pulse stats: Hi: 111 - 995   Lo: 1072 - 11541  (44 point)
Pulse stats: Hi: 146 - 968   Lo: 1049 - 6422  (51 point)
Pulse stats: Hi: 147 - 966   Lo: 1004 - 7372  (57 point)
 Data bits = 192   (offset 0) (412 short) No packet signature found
Pulse stats: Hi: 113 - 987   Lo: 1011 - 5752  (192 point)
Pulse stats: Hi: 134 - 971   Lo: 1001 - 5319  (59 point)
At this point I have no clue about what to do next. Hopefully you or some other contributor to this thread can give me a hint.

Oh yes, before I forget: the RasPi is the ver.1 model connected to an Adafruit Pi Cobbler Breakout Kit. To minimize noise the RFM01 module is connected to the breadboard with 20cm long leads. The module and antenna are sitting next to the RX station, so the signal strength should be identical for both. Unless shoveling about 15m of 2m high snow, there is no way I can get to the TX module at the moment. Bringing it inside next to the Pi will have to wait till spring

Cheers

Karl

aideen
Posts: 17
Joined: Fri Jun 15, 2012 11:43 pm
Location: Cambridge, UK

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Tue Jan 15, 2013 1:18 pm

This configuration produced the RSSI table and then the output stopped.
Hi Karl, Not sure if this will help...

If you're not using the BMP085 don't forget to comment out the line defining it in wh1080_rf.h
If I leave it defined, the program stops the first time read_bmp085() is called.
I had much better results with LNA_14 than LNA_0

Snap with the 1st Ed K&R.... :-)

Aideen

kenmc
Posts: 58
Joined: Fri May 04, 2012 8:02 am
Location: Dublin, Ireland
Contact: Website

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Tue Jan 15, 2013 1:40 pm

Karl when you say "and then stopped" did it come back to a command prompt, or did it sit there waiting forever?
As Aideen said if you don't have the bmp in place comment out the code, otherwise it will go off and try and read a memory space which isn't there...
K
http://goatstownweather.eu.pn

User avatar
KarlS
Posts: 42
Joined: Fri Oct 12, 2012 1:10 pm

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Tue Jan 15, 2013 3:26 pm

Thanks for your replies. No, I don't have a BMP085 (yet), and yes, the #define line in wh1080_rf.h is commented out. The program did'nt go back to the prompt but just sat there forever with no output.

As I said in my post I played around with the configuration parameters, meaning I systematically changed all those parameters to see how they affect the RSSI table. Answer: very little and in no way predictable. I think the best next step would be to determine the exact frequency the TX uses. But how would I do that? I don't have a freq scanner and emailing Fine Offset is not an option; they don't answer "user" questions.

dickydodds
Posts: 25
Joined: Sun Oct 14, 2012 10:40 am

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Tue Jan 15, 2013 5:39 pm

One thing I notice from your posting is that your parameters (certainly at that point) are no good as you won't get anything with a setting of 100. I also found using a lower setting was bad for me too (ie those columns with a number between 0 and 100 so my advice is do not use those).

LNA_0,RSSI_103 idx 5 0.00 0.00 8.51 100.00< 100.00 100.00

I found you need to choose a setting of 0.00 - the first or second column in the case above.

It was pointed out to me we can use our car keys to make some fake inputs as they use the 433mhz frequency - if your keyfobs use the 915mhz you can try that - if you get the dots . . . . then it shows you are recieving something and your all connected up correctly.

chsims1
Posts: 18
Joined: Wed May 23, 2012 9:00 am

Re: Fine Offset WH1081 (Maplin N96GY) sensors working on Pi

Fri Jan 18, 2013 10:02 am

@hystrix: pin 17 is incorrect in your wiring diagram; this should be 3V3 according to: http://elinux.org/Rpi_Low-level_peripherals
Also, pin 4 is 5V0.

Ian

Return to “Automation, sensing and robotics”

Who is online

Users browsing this forum: InventorInventor350 and 11 guests