Author Topic: Moteino Receiver Help  (Read 6200 times)

0 Members and 1 Guest are viewing this topic.

Offline Rexyboy

  • Member
  • *
  • Posts: 8
Moteino Receiver Help
« on: February 16, 2016, 06:56:02 AM »
Hi,
I have recently received my Moteino-USB R5 and using Kobuki's library (and a little help) I have been able to receive my VP2 ISS transmissions.  I do however have a couple of issues that I would love some help with:
  • When the controller is powered up I do not start receiving transmissions for 1 to 5 mins (sometimes never) which seems a little suspicious.  It is also a pain in the neck when playing with the data and making changes.
  • I have around 40% (or more) lost packets and RSSI values around -70% (or worse).  The location of the Moteino is only about 15m from the ISS and right beside the Davis Console which has minimal lost packets.

Other than formatting the output, I have made no changes to Kobuki's library and example ISSRx file.

Sample Transmissions apologies for the hacked json
Code: [Select]
{ "raw": "80-05-80-29-D9-00-9D-A7-FF-FF", "station": 0, "packets": [ 1466, 2000, 42.3 ], "channel": 49, "rssi": -69, "batt": "ok", "windv": 5, "winddraw": 128, "windd": 180, "temp": 19.4, "fei": -30, "delta": 2565056 }
{ "raw": "50-08-64-FF-71-00-15-91-FF-FF", "station": 0, "packets": [ 1467, 2001, 42.3 ], "channel": 0, "rssi": -72, "batt": "ok", "windv": 8, "winddraw": 100, "windd": 143, "rainsecs": -1, "fei": -30, "delta": 2565056 }
{ "raw": "80-07-70-29-D9-00-46-69-FF-FF", "station": 0, "packets": [ 1468, 2002, 42.31 ], "channel": 2, "rssi": -70, "batt": "ok", "windv": 7, "winddraw": 112, "windd": 159, "temp": 19.4, "fei": -30, "delta": 2564008 }
{ "raw": "50-07-78-FF-73-00-42-9F-FF-FF", "station": 0, "packets": [ 1469, 2003, 42.31 ], "channel": 4, "rssi": -69, "batt": "ok", "windv": 7, "winddraw": 120, "windd": 169, "rainsecs": -1, "fei": -31, "delta": 2565064 }
{ "raw": "80-0A-7E-29-DB-00-A3-2B-FF-FF", "station": 0, "packets": [ 1470, 2004, 42.31 ], "channel": 6, "rssi": -70, "batt": "ok", "windv": 10, "winddraw": 126, "windd": 177, "temp": 19.4, "fei": -30, "delta": 2565060 }
{ "raw": "50-09-49-FF-71-00-B1-08-FF-FF", "station": 0, "packets": [ 1471, 2005, 42.32 ], "channel": 8, "rssi": -67, "batt": "ok", "windv": 9, "winddraw": 73, "windd": 106, "rainsecs": -1, "fei": -29, "delta": 2565036 }


Does anyone have some ideas I can try to improve the above issues or some fault finding to get closer to a solution?

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #1 on: February 16, 2016, 07:34:40 AM »
1-5 mins startup for US frequencies is not bad. It uses a frequency hopping scheme which the receiver needs to sync to. -60-70 dB RSSI is not particularly bad either, through walls.

But the 40% packet loss is a little alarming, so something might be going on. I suggest changing channels or testing with the narrow/wideband setting. Check the antenna orientation, soldering and length. Putting the mote on a metallic surface often helps (forming a poor man's ground plane for the monopole).

Offline Rexyboy

  • Member
  • *
  • Posts: 8
Re: Moteino Receiver Help
« Reply #2 on: February 16, 2016, 05:03:09 PM »
Kobuki: good to know re the start up times although on occasions even after an hour it has not synced.  I have done the checks as suggested.  I changed to wideband and it never synced then changed back to narrow and it found the signal within a couple of mins.  The antenna is in good shape, vertical and measures bang on 82mm.  I tried placing the Moteino on the top of my metal server rack but the RSSI consistently dropped off to -80+.  I moved it back to the original location and the signal improved again.

Could you explain what you mean by 'change the channel'? I am a bit confused as I though the channel kept changing with every packet. How do I make this change?

The problem/ concern as you say, seems to be the high packet loss.  Any other tips on how I can get to the bottom of this? Any 'tuning' things I can try?

Thanks for your help.

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #3 on: February 16, 2016, 05:18:22 PM »
Well, I can't think of anything obvious. I don't have US equipment to test that band, sadly. Try lowering the RSSI threshold if you didn't do that yet (increase REG_RSSITHRESH in initialize() ). By channel I meant the station ID on the SIM. But it's probably irrelevant since your console has no problems with reception.

Do you have numStations set to 1 with a single station in the array (implying you haven't changed that part of the code yet)?

Offline Rexyboy

  • Member
  • *
  • Posts: 8
Re: Moteino Receiver Help
« Reply #4 on: February 17, 2016, 03:40:55 AM »
I have had a play with RSSITHRESH and found it is much more sensitive than I expected.  I moved the value from 190 to 200 at first and reception stopped completely (no sync). 

Then I was more gradual; 192 gave around 25-30% lost packets, 193 - 17% lost packets but a bit patchy on the sync, through to 195 - 4% yet only secured a couple of messages before losing sync. So in short; 190 is definitely the most robust but as you move towards 195 the lost packets drop off but as does the stability of sync.

BTW: I have the numStations set to 1 and a single ISS in the array.

Any chance this is a symptom of something else as the stability is obviously of importance?

Thanks

Offline DeKay

  • Forecaster
  • *****
  • Posts: 399
    • Mad Scientist Labs
Re: Moteino Receiver Help
« Reply #5 on: February 18, 2016, 02:06:37 PM »
Just for grins, try increasing the RSSI.  Higher sensitivity can mean higher susceptibility to noise and the reception of bad packets.  Been there, did that.

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #6 on: February 18, 2016, 02:17:01 PM »
Hm, yeah. Looking at the RSSI figures in the first post it should be good down to 160 (-80 dB)...

Offline Rexyboy

  • Member
  • *
  • Posts: 8
Re: Moteino Receiver Help
« Reply #7 on: February 21, 2016, 10:26:55 PM »
OK, I have done a load more playing around over the weekend with RSSI Thresholds and other areas to try to understand what is going on.  I should clarify that that the main problem at the moment is the lost packets.  That may have been obvious to you guys but it took me a little while to understand the sync time and RSSI levels were all good.  #-o

I have added a few serial.prints in the code to better see what is going on.  The key thing I found is that the messages are pretty consistently going SUCCESS, MISSED, SUCCESS, MISSED etc.  You probably could have seen that in the original post where the channel jumps to every second number.  After is goes through a handleTimerInt body, increments the channel it nearly always has success on the next message.  I have printed out the channels with the messages and the misses and I can see that the channels are incrementing correctly.

All of this makes me think that it is a timing or interval issue rather than a signal (RSSI) issue. ie after processing a successful packet it doesn't have time left to grab the next one.  I know this doesn't make a lot of sense because (a) we are talking ms processing time and (b) the code has proven to work elsewhere.  Out of interest, I have reduced the magical RX_WAIT (settle time) value to no improvement.

I should add that some of the RSSI levels in my previous post may be a 'red herring' as I have done loads more tests and the numbers I get vary every time so I can only say that my sample size may have been a little small.  :oops:

My only guess is there is something in DavisRFM69 that I should have configured that I have missed.  Something that was set for EU rather than US?

Going a little crazy. Thanks for your support.

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #8 on: February 22, 2016, 05:59:22 AM »
If you suspect that timeouts are occurring too early, then please try increasing LATE_PACKET_THRESH to something like 10-15k and let's see what happens. The Moteinos use resonators instead of xtals, in some samples it might be inaccurate, though it has proven to be good enough so far. Maybe try another radio or Moteino...

Offline Rexyboy

  • Member
  • *
  • Posts: 8
Re: Moteino Receiver Help
« Reply #9 on: February 22, 2016, 06:08:05 AM »
Kobuki, I've extended this out to 15k and get the same (consistent) result.  Below is a quick snap shot of the output with extra debugging:

Looks suspiciously consistent to me.  Does this spur any other ideas?

Code: [Select]
Initialise Station
Setup Complete
Packet passed CRC
1 Missed Packet/s: Below ReSync Threshold of 50
Packet passed CRC
Found Packet: decoding
{"raw":"50-03-FF-FF-71-00-21-EE-FF-FF","station":0,"packets":[1,1,50.00],"channel":2,"rssi":-70,"batt":"ok","windv":4,"windd":93,"rainsecs":-1,"fei":-30,"delta":2565040}

1 Missed Packet/s: Below ReSync Threshold of 50
Packet passed CRC
Found Packet: decoding
{"raw":"80-03-00-2C-B9-00-6D-C0-FF-FF","station":0,"packets":[2,2,50.00],"channel":4,"rssi":-69,"batt":"ok","windv":4,"windd":0,"temp":21.9,"fei":-31,"delta":2566044}

1 Missed Packet/s: Below ReSync Threshold of 50
Packet passed CRC
Found Packet: decoding
{"raw":"50-03-FE-FF-71-00-57-5A-FF-FF","station":0,"packets":[3,3,50.00],"channel":6,"rssi":-71,"batt":"ok","windv":4,"windd":92,"rainsecs":-1,"fei":-31,"delta":2566044}

1 Missed Packet/s: Below ReSync Threshold of 50
Packet passed CRC
Found Packet: decoding
{"raw":"80-02-FF-2C-B9-00-8C-32-FF-FF","station":0,"packets":[4,4,50.00],"channel":8,"rssi":-76,"batt":"ok","windv":3,"windd":93,"temp":21.9,"fei":-30,"delta":2565036}

1 Missed Packet/s: Below ReSync Threshold of 50
Packet passed CRC
Found Packet: decoding
{"raw":"50-03-00-FF-71-00-6A-4D-FF-FF","station":0,"packets":[5,5,50.00],"channel":10,"rssi":-70,"batt":"ok","windv":4,"windd":0,"rainsecs":-1,"fei":-30,"delta":2566032}

1 Missed Packet/s: Below ReSync Threshold of 50
Packet passed CRC
Found Packet: decoding
{"raw":"80-02-00-2C-B9-00-C7-91-FF-FF","station":0,"packets":[6,6,50.00],"channel":12,"rssi":-70,"batt":"ok","windv":3,"windd":0,"temp":21.9,"fei":-31,"delta":2565036}

1 Missed Packet/s: Below ReSync Threshold of 50
Packet passed CRC
Found Packet: decoding
{"raw":"50-02-00-FF-71-00-C0-1C-FF-FF","station":0,"packets":[7,7,50.00],"channel":14,"rssi":-74,"batt":"ok","windv":3,"windd":0,"rainsecs":-1,"fei":-30,"delta":2566048}

1 Missed Packet/s: Below ReSync Threshold of 50
Packet passed CRC
Found Packet: decoding
{"raw":"80-01-00-2C-B9-00-29-43-FF-FF","station":0,"packets":[8,8,50.00],"channel":16,"rssi":-70,"batt":"ok","windv":1,"windd":0,"temp":21.9,"fei":-30,"delta":2566052}

1 Missed Packet/s: Below ReSync Threshold of 50
Packet passed CRC
Found Packet: decoding
{"raw":"50-01-00-FF-71-00-2E-CE-FF-FF","station":0,"packets":[9,9,50.00],"channel":18,"rssi":-79,"batt":"ok","windv":1,"windd":0,"rainsecs":-1,"fei":-30,"delta":2565016}

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #10 on: February 22, 2016, 06:12:09 AM »
Sorry, not really. I'd prolly take some time to verify the frequencies using an SDR stick or something. Maybe the published frequencies aren't exactly spot on and the mote is simply trying to tune on the wrong ones. Or you indeed have a flaky RF69 module.

Offline Rexyboy

  • Member
  • *
  • Posts: 8
Re: Moteino Receiver Help
« Reply #11 on: February 22, 2016, 06:39:46 AM »
I have gone back and checked that I have seen packets received on all channels.  Within two cycles all channels have been successful; i.e. even numbered channels in the first round, odd numbered channels in the second round.... if that makes sense.

I think that indicates that the frequencies are not the issue although that may have been obvious. 

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #12 on: February 22, 2016, 12:43:43 PM »
Well, one thing is weird. The received packets follow each other by a single packet delay. If every second packet was missed it would be the double. My code definitely increments the channel by one, so something must be amiss in your code. Please post the code here or in PM so we can have a look too.

Offline mathgui

  • Member
  • *
  • Posts: 19
Re: Moteino Receiver Help
« Reply #13 on: December 08, 2017, 02:33:13 PM »
I know this is an older topic but I'm having pretty much the exact same problem and was wondering if there was a resolution.  I have been trying both Kobuki's and DeKay's examples.  Over a 20 minute period I getting about 35% good packets.  This was a big improvement after I change from Station ID 6 back to the default ID of 1.  When a good string is working it is still only every other packet.  Thanks for any help on this.
Ron

raw:50-01-DF-FF-73-0E-D5-8F-FF-FF station:0 packets:132/281/31.96 channel:30 rssi:-43 batt:ok windv:1 winddraw:223 windd:307 rainsecs:-1 fei:-35 delta:5129816
raw:70-01-E3-C4-83-8C-14-03-FF-FF station:0 packets:133/282/32.05 channel:32 rssi:-44 batt:ok windv:1 winddraw:227 windd:312 vsolar:2.6 fei:-34 delta:5129832
raw:50-02-E7-FF-71-04-55-5F-FF-FF station:0 packets:134/283/32.13 channel:34 rssi:-44 batt:ok windv:2 winddraw:231 windd:317 rainsecs:-1 fei:-35 delta:5129816
raw:30-02-E3-FF-83-83-54-7A-FF-FF station:0 packets:135/284/32.22 channel:36 rssi:-46 batt:ok windv:2 winddraw:227 windd:312 fei:-35 delta:5129840
raw:50-01-D8-FF-71-0A-A2-44-FF-FF station:0 packets:136/285/32.30 channel:38 rssi:-44 batt:ok windv:1 winddraw:216 windd:297 rainsecs:-1 fei:-34 delta:5129800

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #14 on: December 08, 2017, 03:27:30 PM »
Hm, that looks weird. Are you using my latest code from GitHub? Are you using the correct band for your country/devices?

Offline mathgui

  • Member
  • *
  • Posts: 19
Re: Moteino Receiver Help
« Reply #15 on: December 08, 2017, 05:09:20 PM »
Thanks for the reply.  Yes, I just cloned your code in the last couple of days and I changed ISSRx.ino to use FREQ_BAND_US.  I also defined only one station.

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #16 on: December 08, 2017, 05:28:26 PM »
Does the chosen band match your devices? Also, aren't by any chance you have multiple devices set to the same channel?

Offline mathgui

  • Member
  • *
  • Posts: 19
Re: Moteino Receiver Help
« Reply #17 on: December 08, 2017, 05:46:32 PM »
Yes, the band matches my device, Vantage Vue ISS set to ID 1, so I use:
 { 0, STYPE_ISS,         true },

That's the only station I have and only one defined.  The other funny thing is that looking at channel numbers, they are predominantly even-numbered channels, not totally, but predominantly.   Also channels above 38 are rare.  I tend to get about 20 packets at 5 sec intervals, skipping a channel.  Then it'll not do any at all for a minute or so before starting another strings of 20.  I need to learn more about the frequency shift stuff I guess, not really knowledgeable on what's happening there in spite of my Amateur Extra class license :).

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #18 on: December 08, 2017, 05:51:35 PM »
You still didn't answer to or didn't understand an important question. Does your band match your device? Eg. you live in Australia but have chosen the US frequency band. Check that. You getting every other packet could mean the wrong band is being used.

Offline mathgui

  • Member
  • *
  • Posts: 19
Re: Moteino Receiver Help
« Reply #19 on: December 08, 2017, 05:58:46 PM »
Understand, sorry about that.  Yes, I live in the U.S. and chose that band.  The last time I checked my Davis console it showed a "frequency correction factor" of -8.  I don't know the significance of that or if that is common, just mentioning it since getting the right frequency seems to be my issue.

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #20 on: December 08, 2017, 06:07:46 PM »
You might try using setFreqCorr() to adjust the radio frequency values. It takes a signed kHz value, based on your log fragment, -35 might be a good starting value to test.

EDIT: Also, you might try playing with setTimeBase(uint32_t value) which takes an argument around 1000000, with exactly 1000000 meaning no timing correction. You can use it like value = 1000000 + PPM to adjust timing using PPM notation.
« Last Edit: December 08, 2017, 06:11:12 PM by kobuki »

Offline mathgui

  • Member
  • *
  • Posts: 19
Re: Moteino Receiver Help
« Reply #21 on: December 08, 2017, 06:09:57 PM »
Thanks.  I saw that, but wasn't sure what the units were.   Appreciate the suggestion.  I'll try it.

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #22 on: December 08, 2017, 06:13:38 PM »
wasn't sure what the units were

Yes, they're mainly there to support a planned relay sketch which is in the works but lack of free time blocked its way to the code base...

Offline mathgui

  • Member
  • *
  • Posts: 19
Re: Moteino Receiver Help
« Reply #23 on: December 09, 2017, 07:36:04 PM »
Haven't had any luck with frequency correction.  It doesn't seem to change anything unless I get crazy high (150) with the number, then nothing happens.  One thing I noticed in the process though, the serial output with the raw data and channel number is occurring about once per second.  So a good packet is getting registered about every 2-3 seconds which lines up with what the ISS is sending.  It appears there is something weird with the timing.  Shouldn't the channel only change once in 2.5 secs or so?  I don't totally understand when the frequency is supposed to change so I'm just making guesses here.

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: Moteino Receiver Help
« Reply #24 on: December 09, 2017, 07:45:50 PM »
You say that:
 - the serial output with the raw data and channel number is occurring about once per second
 - a good packet is getting registered about every 2-3 seconds

There seems to be a contradiction between these 2 statements. There's about 2.5 secs between packets at ID 1 (2.5625 to be precise). The log fragment you posted earlier showed about 5 secs (about 2 packet delay's worth) between packets. Can you post a longer log? Anyway if packets are received more frequently than about 2.5 secs you might have more than one transmitter (not all necessarily your own).

 

anything