Author Topic: Moteino + Spark Core gateway instead of Pi - Solar Powered Weather Station  (Read 20816 times)

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6007
  • Country: us
    • LowPowerLab
Very elegant, thanks for the update!!  :)

syrinxtech

  • Sr. Member
  • ****
  • Posts: 306
  • Country: us
    • Syrinx Technologies
Thanks Felix.

My brother-in-law put in a boatload of hours making the wooden enclosure.  It has screen around the inside of the four slats to keep out bugs.  He made a groove across the bottom in which a perf board slides which connects to a PCB that holds the electronics.  It makes for a lot of air flow and keeps the temperature stable.  All of the corners are mitred and it was a shame to paint it.  Everything is pluggable for easy removal.

The best s/w feature for me is I can do OTA by keeping the radio alive for 2 seconds after the last set of three packet deliveries are made.  It usually takes one or two tries to time the OTA but it works quite well.

The highest wind recorded was during a recent really bad storm at 82mph.


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6007
  • Country: us
    • LowPowerLab
The best s/w feature for me is I can do OTA by keeping the radio alive for 2 seconds after the last set of three packet deliveries are made.  It usually takes one or two tries to time the OTA but it works quite well.
Interesting, So you don't use the Listen mode to wake for OTA?

syrinxtech

  • Sr. Member
  • ****
  • Posts: 306
  • Country: us
    • Syrinx Technologies
I played around with it and to be honest, didn't see where it would fit into my situation.

Please correct me if I'm wrong, but the real value of Listen mode is to sit quietly for some amount of time until you're woken up by an external packet.  In my case, the external weather unit never stops sending packets so sitting quietly for even a second isn't possible.  The wind speed code constantly interrupts the processor and the rain unit interrrupts every time a rain reading of 0.01" is detected.  With the radio constantly transmitting (minus the 8 second sleep I manage to slip in), would Listen mode work in this case?

The only way I got it to work reliably was to simply keep it awake up to 2 seconds after the last packet was transmitted.  If no OTA request is received during that 2 seconds, it then sleeps for 8 seconds and starts the whole process over again.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6007
  • Country: us
    • LowPowerLab
Oh I see what you're doing now. For your case where you have a solar cell that probably gives more than enough juice it's probably good enough.
But I think the ListenMode would totally be of use in your case, you'd reduce the total OTA delay to the delay window of the listen wakeup window, I think the default was 3seconds.
So basically in the "8second sleep time" you would sleep everything except the radio which sits in ListenMode (that's mostly sleep too, with tiny pulses of RX ON). Then a ListenMode burst would wake it up and make it wait until the burst window expires at which point you can actually do the OTA.

syrinxtech

  • Sr. Member
  • ****
  • Posts: 306
  • Country: us
    • Syrinx Technologies
If you want to see it on Freeboard, check it out:

https://freeboard.io/board/MCsvrV

The max lipo battery charge is 4.2V, which it stays at pretty much all day.  At night it will drop to somewhere around 4.17 but within an hour of the sun coming up it's back to 4.2V.  The LIPO is 4400mAh.

So, does the Windows OTA programmer send this "ListenMode burst"?  If not, what sends the wake-up call? 

And, if no OTA request is received, the unit sleeps for the entire 8 seconds and then wakes up as normal and begins sending data packets again?




Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6007
  • Country: us
    • LowPowerLab
Well embarrasingly I have not done OTA yet with ListenMode. The windows client might need to be updated when I do and I have a proven pattern that works.
The above is just the theory. ListenMode works nicely to keep a very low power unit in rx mode (ability to wake up at cost of some delay).
I guess the "programmer" unit used for OTA could send the burst first, but still the windows GUI has a limited timeout which might limit this.
I hope to get this working sometime :)

syrinxtech

  • Sr. Member
  • ****
  • Posts: 306
  • Country: us
    • Syrinx Technologies
Thanks for the update.

The biggest issue I had with placing the weather unit outside was the OTA consideration.  It's sitting 9ft in the air in the back of my yard so anything other than OTA updates was simply not doable. 

If ListenMode will work with OTA and still let me stream data in real time then I'll certainly consider it.  Otherwise I have to just add one some time like I'm doing now.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6007
  • Country: us
    • LowPowerLab
Like anything it's a matter of tradeoffs .. like how often you do it, how concerning is the power consumption, etc.
In your case it's already working so why fix something that works.
But I'd like to make it easy(er) and improve OTA at some point to work with ListenMode. If you try it, use another mote and when it works reliably update your real station.

syrinxtech

  • Sr. Member
  • ****
  • Posts: 306
  • Country: us
    • Syrinx Technologies
I agree completely.

I'm sure the majority of people would love to have OTA integrated with ListenMode, but like you said, you're only one person and you certainly seem to have more than enough on your plate so it will take time.


jra

  • Jr. Member
  • **
  • Posts: 81
  • Country: us
Very nice.  How well did the solar/LiPo combo work during the winter months?

syrinxtech

  • Sr. Member
  • ****
  • Posts: 306
  • Country: us
    • Syrinx Technologies
No problems.  The combination of the 4400 mAh battery and the 6"x6" solar panel kept the battery fully charged.

We connected a thermistor to the charging board which helps prevent charging when the unit gets too hot or too cold.

TomWS

  • Hero Member
  • *****
  • Posts: 1892
No problems.  The combination of the 4400 mAh battery and the 6"x6" solar panel kept the battery fully charged.
What part of the country are you?  How many sunny days a year or, more important, how many sustained cloudy days?

Tom

syrinxtech

  • Sr. Member
  • ****
  • Posts: 306
  • Country: us
    • Syrinx Technologies
I'm in Richmond, VA.

The most cloudy days in a row I can remember in recent years is about 6 days.  Even during cloudy days I'm charging at just above 20 mA which keeps me just above break even. 

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
@syrinxtech: I *almost* have the same setup - I'm using a BME280 though for getting temp/humidity and pressure and a small 3" solar panel (you can't see it on the photo it's flat behind the fence)

I tried to use the ListenMode as well but could not get it to work reliably (probably my code though) so I added a solar panel and just have the bananaPi get data every minute or when my iPhone app requests it - I try to put the moteino to sleep as often as possible but the wind interrupt kinda ruins the whole thing. I'm wondering if I'm better off just detaching the interrupt for the wind just keep it for the rain and when the Pi requests data just sample for 10s...

Wanted to use a ESP8266 and try to add an RFM69 instead of the PI but I'm running home bridge on the PI now as well, and asking siri for the outside humidity is just too funny to pass...

I like your enclosure! (my 3D printed one is very flimsy...) - I"ve attached my radio code in case someone has any feedback though it's not very pretty so dont hurt yourself!
« Last Edit: July 17, 2016, 11:38:42 AM by xavier »