Author Topic: Got my VP2 working with Moteino!  (Read 1913 times)

0 Members and 1 Guest are viewing this topic.

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Got my VP2 working with Moteino!
« on: July 29, 2018, 09:56:43 PM »
I upgraded from my older Ambient station to a Davis VP2 in March and have been tinkering ever since to get it working with Moteino and a BME280 (for temp/humidity/pressure). For the last 2 months it's been pretty reliable. Finally figure I should share the setup.

With help from mccrossley's GitHub repo (which is a fork of kobuki's), I was able to modify the code to fit my needs. The Moteino is capturing real time data from the ISS every 2.5 seconds, and outputs to serial. The Pi is running a Python script I wrote that listens on serial, sanitizes some data, then uploads it to weewx, MQTT and HomeAssistant instantly. Works great!

The modifications I made to the Moteino code was to add a "data packet" which has the packet number, lost packet stats, etc.. The Python script uses that to help keep an eye on things (e.g. alert me if too many lost packets).

I like how I didn't have to modify the console to get this data. There are some ups and downs with doing it this way. The biggest upside was that this cost me roughly $30 (not including the Pi, and a few months of my spare time tweaking code). Downside, I wish I was able to connect to the console to keep it's clock in sync. but for $30, I'll take a drifting clock on the console.

weewx is running a forked version of their meteobridge driver. The only modification I made here is for the driver to listen on a socket server instead of serial since the Moteino is not directly plugged into my weewx server. I needed a middle man to pass data back and forth, and ncat has been working great for me for years with my Ambient station.

So the Moteino is sending data to weewx in realtime, then weewx publishes to MQTT, which is then auto-updating my weather website automatically every 2.5 seconds (without refreshing it). If you're curious, you can view that here. https://belchertownweather.com - Great stuff!

Next step is to work on moving off the breadboard and into a case of some sort and documenting some of the setup.

Anyways, just thought I'd share!

 [ You are not allowed to view attachments ]
« Last Edit: July 30, 2018, 11:40:55 AM by drsprite »

Offline mcrossley

  • Forecaster
  • *****
  • Posts: 450
    • Wilmslow Astro
Re: Got my VP2 working with Moteino!
« Reply #1 on: July 30, 2018, 11:26:57 AM »
Yay! My Motenio has been running since January 2017, it's emulating an ISS as I still use the console for data access.
Mark

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #2 on: July 30, 2018, 11:37:48 AM »
Yay! My Motenio has been running since January 2017, it's emulating an ISS as I still use the console for data access.

Your GitHub helped save me countless hours (and it seemed to work a little better than kobuki's... I'm seeing less dropped packets - not sure what the difference is), thank you for that!

Edit: Oops, read that backwards. Your Moteino s sending, not receiving?

For receiving: I was hoping to use a NodeMCU, but had a lot of interference, so I chose the Pi. I'm curious how other's have theirs setup (on a window sill like me?  :lol: )
« Last Edit: July 30, 2018, 11:51:57 AM by drsprite »

Offline mcrossley

  • Forecaster
  • *****
  • Posts: 450
    • Wilmslow Astro
Re: Got my VP2 working with Moteino!
« Reply #3 on: July 31, 2018, 05:15:18 AM »
My Moteino is doing both, it is receiving from two "ISS" units* and combing the data to emulate a single ISS that the console can understand.

* 1x real ISS transmitter with Temp + Hum + Rain, and 1x "Wind" transmitter with wind + Solar + UV
I wanted to get my solar sensors up on the roof with the wind sensors, and leave the temp/hum/rain low down.
Mark

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #4 on: August 08, 2018, 08:51:05 AM »
I purchased the Moteino M0 because I can attach the BME280 directly to the board. Looked at is as a way to compact my ISS receiver. It arrived the other day and the sketch wouldn't compile for it. I didn't realize the M0 is a different type of architecture using SAMD, and was hoping I could just "upgrade" my hardware. No such luck :)

After messing around, I found that the timer library used in DavisRFM69.cpp is the problem. I can get the sketch to compile now that the timers are gone, but haven't had much luck in receiving anything from the ISS. Do you know of a way to do timers on M0?

Hopefully there's a one-for-one timer library swap? I'm pretty new to it, so wanted to see if you had any guidance.

Offline ct

  • Contributor
  • ***
  • Posts: 101
Re: Got my VP2 working with Moteino!
« Reply #5 on: August 18, 2018, 06:00:59 AM »
This library https://github.com/michael71/Timer5 can be used on the SAMD.  I've used it successfully on the Adafruit M0.

Offline azchrisf

  • Cobra Weather Dominator Operator
  • Senior Contributor
  • ****
  • Posts: 240
    • Copperwood WX
Re: Got my VP2 working with Moteino!
« Reply #6 on: August 25, 2018, 09:03:17 AM »
Something I've kinda asked before - Please share the scripts if your are going to be posting "look what I did"-type threads if you can. Others could benefit from it that don't have the same level of programming skill, or get ideas from it.

Offline bheiland

  • Member
  • *
  • Posts: 1
Re: Got my VP2 working with Moteino!
« Reply #7 on: January 11, 2019, 04:51:50 AM »
Yay! My Motenio has been running since January 2017, it's emulating an ISS as I still use the console for data access.
When you say you are emulating an ISS , does that mean that you are capturing radio data transmitted from the VP2 and using it like it came from the davis console?  I am trying to put together a device to do this and I am looking for help to get started.

Offline mcrossley

  • Forecaster
  • *****
  • Posts: 450
    • Wilmslow Astro
Re: Got my VP2 working with Moteino!
« Reply #8 on: January 11, 2019, 12:58:08 PM »
I'm capturing the data from two real "ISS" transmitters (ids 1 & 3), combining the data, then transmitting it as an ISS with id 2.
My console is tuned to only pick up ISS id 2.

ISS id 1 = Wind, Solar, UV (on my roof)
ISS id 3 = Rain, Temp, Hum (in my garden)

Fake ISS id 2 = Wind, Solar, UV, Rain, Temp, Hum
Mark

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #9 on: April 21, 2019, 10:47:27 AM »
Bringing back an older thread because I received another Moteino and it's not quite like the other one I have. I'm on the US bands.

One has been running for a year now without problem - compiled VPTools in May 2018. I decided to buy a 2nd one to have as a backup. When I use mcrossley's VPTools fork on it, it counts every packet as well as every packet as a lost packet.

I think this is affecting the timer because I definitely have more lost packets now.

My first Moteino which was compiled last year is at about 99% Rx rate, where this new one is around 89% (you can see the decline in the attached screenshot and in the chart at https://belchertownweather.com/about/).

It seems the conditional in DavisRFM69.cpp for the last seen rx is off a little bit or a library has changed? I can't figure it out. I've changed the #define LATE_PACKET_THRESH 5000L to 7000L and it seems to make it a little better, I think? But that also makes it count every lost packet twice. For every 1 lost packet, it counts it as 2. So I don't think that's the right fix.

Anything come to mind on what might have changed and how to maybe fix it?

 [ You are not allowed to view attachments ]

Offline jgentry

  • Forecaster
  • *****
  • Posts: 452
Re: Got my VP2 working with Moteino!
« Reply #10 on: April 21, 2019, 03:02:52 PM »
I upgraded from my older Ambient station to a Davis VP2 in March and have been tinkering ever since to get it working with Moteino and a BME280 (for temp/humidity/pressure). For the last 2 months it's been pretty reliable. Finally figure I should share the setup.

With help from mccrossley's GitHub repo (which is a fork of kobuki's), I was able to modify the code to fit my needs. The Moteino is capturing real time data from the ISS every 2.5 seconds, and outputs to serial. The Pi is running a Python script I wrote that listens on serial, sanitizes some data, then uploads it to weewx, MQTT and HomeAssistant instantly. Works great!

The modifications I made to the Moteino code was to add a "data packet" which has the packet number, lost packet stats, etc.. The Python script uses that to help keep an eye on things (e.g. alert me if too many lost packets).

I like how I didn't have to modify the console to get this data. There are some ups and downs with doing it this way. The biggest upside was that this cost me roughly $30 (not including the Pi, and a few months of my spare time tweaking code). Downside, I wish I was able to connect to the console to keep it's clock in sync. but for $30, I'll take a drifting clock on the console.

weewx is running a forked version of their meteobridge driver. The only modification I made here is for the driver to listen on a socket server instead of serial since the Moteino is not directly plugged into my weewx server. I needed a middle man to pass data back and forth, and ncat has been working great for me for years with my Ambient station.

So the Moteino is sending data to weewx in realtime, then weewx publishes to MQTT, which is then auto-updating my weather website automatically every 2.5 seconds (without refreshing it). If you're curious, you can view that here. https://belchertownweather.com - Great stuff!

Next step is to work on moving off the breadboard and into a case of some sort and documenting some of the setup.

Anyways, just thought I'd share!

 [ You are not allowed to view attachments ]

So are you using the BME 280 to measure the outdoor temp and humidity instead of Davisí Sensirion SHT-31?
Davis Vantage Pro2. SHT-75. WU: KXALJEMI2 & KALTHORS2. CWOP/APRS: C6353 & E6358

  

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #11 on: April 21, 2019, 03:09:22 PM »
No that is for indoor temp, humidity and pressure.

The Moteino gets all the other data from the outdoor ISS.

I linked the GitHub code repo in the first post in this thread which has all the code and scripts.

Offline jgentry

  • Forecaster
  • *****
  • Posts: 452
Re: Got my VP2 working with Moteino!
« Reply #12 on: April 21, 2019, 04:51:43 PM »
No that is for indoor temp, humidity and pressure.

The Moteino gets all the other data from the outdoor ISS.

I linked the GitHub code repo in the first post in this thread which has all the code and scripts.

Gotcha. Thanks.
Davis Vantage Pro2. SHT-75. WU: KXALJEMI2 & KALTHORS2. CWOP/APRS: C6353 & E6358

  

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #13 on: April 24, 2019, 09:11:00 PM »
Bringing back an older thread because I received another Moteino and it's not quite like the other one I have. I'm on the US bands.

One has been running for a year now without problem - compiled VPTools in May 2018. I decided to buy a 2nd one to have as a backup. When I use mcrossley's VPTools fork on it, it counts every packet as well as every packet as a lost packet.

I think this is affecting the timer because I definitely have more lost packets now.

My first Moteino which was compiled last year is at about 99% Rx rate, where this new one is around 89% (you can see the decline in the attached screenshot and in the chart at https://belchertownweather.com/about/).

It seems the conditional in DavisRFM69.cpp for the last seen rx is off a little bit or a library has changed? I can't figure it out. I've changed the #define LATE_PACKET_THRESH 5000L to 7000L and it seems to make it a little better, I think? But that also makes it count every lost packet twice. For every 1 lost packet, it counts it as 2. So I don't think that's the right fix.

Anything come to mind on what might have changed and how to maybe fix it?

 [ You are not allowed to view attachments ]

I don't know if this makes a difference, but I am assuming it does. I didn't realize that the Moteinos are different revisions. The working on is a MoteinoUSB R6, and the not-so-reliable one is an R7.  @kobuki or @mcrossley any thoughts on if that would have an effect on the VPTools sketch?

Offline kobuki

  • Forecaster
  • *****
  • Posts: 737
Re: Got my VP2 working with Moteino!
« Reply #14 on: April 25, 2019, 08:03:57 AM »
No, the revision in itself shouldn't make a difference. Standard part variance can kick in regardless, maybe you're experiencing that. Is anything different between your samples besides the revision? Like a different transceiver module, different USB chip, etc. The reception is sensitive to noise coupled through USB cables, maybe try another hub. But the doubling packet loss counter looks like an algorithmic bug than anything.
« Last Edit: April 25, 2019, 11:02:31 AM by kobuki »

Offline safuser

  • Member
  • *
  • Posts: 25
Re: Got my VP2 working with Moteino!
« Reply #15 on: April 25, 2019, 10:45:29 AM »
I am also having an issue with the new usb versions as well.  I have a couple of the old ones with external usb-serial(yellow board with built in antenna) that work great.  I have two of the newer ones with built in USB and external antenna that I can not get to work?  They eventually lock in and receive ok, but they do not seem to transmit.  i.e. when they transmit nothing receives the packet. Neither the VP2 console or the old yellow moteinos. This is with latest wcrossley vptools sw on each.

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #16 on: April 25, 2019, 08:21:52 PM »
No, the revision in itself shouldn't make a difference. Standard part variance can kick in regardless, maybe you're experiencing that. Is anything different between your samples besides the revision? Like a different transceiver module, different USB chip, etc. The reception is sensitive to noise coupled through USB cables, maybe try another hub. But the doubling packet loss counter looks like an algorithmic bug than anything.

I'm using a 6-inch USB cable directly connected to a Pi. The same cable as the R6 which is at abour 98% Rx stats, but the R7 is at 68% Rx stats now. I could try altering the #define LATE_PACKET_THRESH 5000L to 7000L and see if that helps with the stats. I don't necessarily care about the lost packet STATS, I just care about the lost packets. 30% is quite the loss for 1 revision of board.

The transceivers all look the same

Offline kobuki

  • Forecaster
  • *****
  • Posts: 737
Re: Got my VP2 working with Moteino!
« Reply #17 on: April 26, 2019, 05:26:57 AM »
So same pi, sketch, cable, you just swap out the mote at the end and see 30% packet loss? That's interesting. What kind of antenna do you use? Have you tried changing the orientation, the antenna, etc? I usually have good reception even with a simple wire (cut to 79 mm for my band). TBH, I never used Moteinos with integrated USB, I always use a cheap separate adapter, even for permanent devices.

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #18 on: April 26, 2019, 08:04:35 PM »
So same pi, sketch, cable, you just swap out the mote at the end and see 30% packet loss? That's interesting. What kind of antenna do you use? Have you tried changing the orientation, the antenna, etc? I usually have good reception even with a simple wire (cut to 79 mm for my band). TBH, I never used Moteinos with integrated USB, I always use a cheap separate adapter, even for permanent devices.

Yeah all the same. I just swap the Mote. I'm using Moteino's helical antenna from their store. Same antenna for both. I have tried to move it around but literally both Mote's are next to each other with a 30% difference in lost packets.

The R7 has only 20% lost today though. The R6 is pretty rock solid at 98% Rx.

There must be an algorithm change from the R6 to the R7. I do have another 6" USB cable, I can try that just for giggles I guess.

Offline kobuki

  • Forecaster
  • *****
  • Posts: 737
Re: Got my VP2 working with Moteino!
« Reply #19 on: April 26, 2019, 09:21:26 PM »
There must be an algorithm change from the R6 to the R7.
What are you talking about?

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #20 on: April 26, 2019, 09:23:50 PM »
There must be an algorithm change from the R6 to the R7.
What are you talking about?

I have no idea what I'm talking about - that's part of the problem. I know something is wrong but don't know what it is.

So with that, I probably should have put a question mark at the end of the sentence for it to read:

Code: [Select]
There must be an algorithm change from the R6 to the R7 that needs to be applied to the VPTools sketch (since more missed packets, and changing LATE_PACKET_THRESH counts the missed packets 2x)?

Offline kobuki

  • Forecaster
  • *****
  • Posts: 737
Re: Got my VP2 working with Moteino!
« Reply #21 on: April 27, 2019, 05:37:24 AM »
Ah, I see. You said it like the Moteino itself had some software component that needs an algorithm change. It's of course just a board with an ATMega chip and support parts, the software/firmware is fully up to the user to create and maintain.

An algorithm change in the sketch should not be necessary. I suspect more RF noise is getting in the way with this design, you might be able to remedy it by using a better or different kind of antenna. I suggest trying out the straight wire antenna in place of the small helical. The small heli's most important advantage is its size, not much else. It has around 0 dBi gain IIRC and the wire monopole is around 2, I think, but definitely better.

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #22 on: April 27, 2019, 08:19:44 AM »
Ah, I see. You said it like the Moteino itself had some software component that needs an algorithm change. It's of course just a board with an ATMega chip and support parts, the software/firmware is fully up to the user to create and maintain.

An algorithm change in the sketch should not be necessary. I suspect more RF noise is getting in the way with this design, you might be able to remedy it by using a better or different kind of antenna. I suggest trying out the straight wire antenna in place of the small helical. The small heli's most important advantage is its size, not much else. It has around 0 dBi gain IIRC and the wire monopole is around 2, I think, but definitely better.

Ok I hope I have the monopole around, but I'll give that a try. I'll desolder the helical and add on the monopole and see how it goes.

Offline drsprite

  • Senior Member
  • **
  • Posts: 86
Re: Got my VP2 working with Moteino!
« Reply #23 on: April 27, 2019, 08:24:19 AM »
Do you think that the noise and antenna would also cause every packet to be counted as a lost packet? Even though it's received? Seems the lost packet function isn't accurate with the R7 revision?

Offline kobuki

  • Forecaster
  • *****
  • Posts: 737
Re: Got my VP2 working with Moteino!
« Reply #24 on: April 27, 2019, 08:30:35 AM »
If you lost the wire supplied with your mote, you can just cut some to size. Use one that you can conveniently solder in. Single core is better, but stranded should not make much of a difference. The length is important. This one is a nice guide, applicable to the Moteino as well.

Do you think that the noise and antenna would also cause every packet to be counted as a lost packet? Even though it's received? Seems the lost packet function isn't accurate with the R7 revision?
Again, the revision should not make a difference. But maybe a new revision of the transceiver board has some weird new behavior (maybe interrupts are fired twice, too early, too late, etc.) that hasn't been tested or seen. I'd expect better reception with a better antenna, but I don't think the doubling loss counter would be fixed by that. If your reception rate is good, that counter is just cosmetics. Though it's still weird, but it's Mark's code, not mine so he might be able to help you on that more effectively.

Could you make a photo of both your boards, RFM69 side?