Author Topic: VP2 repeater packet format?  (Read 4993 times)

0 Members and 1 Guest are viewing this topic.

Offline docbee

  • Forecaster
  • *****
  • Posts: 853
    • smartbedded
Re: VP2 repeater packet format?
« Reply #25 on: March 06, 2015, 07:32:47 PM »
yes, well analyzed.  :lol:
F6 is a soil/leaf station.

Now I just have to make repeaters selectable and implement frequency hopping for the
repeated signals. I hope this will be straight forward regarding timing.
« Last Edit: March 06, 2015, 07:34:52 PM by docbee »
founder of smartbedded.com - home of meteohub, meteoplug, meteobridge, meteostick

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: VP2 repeater packet format?
« Reply #26 on: March 06, 2015, 07:48:03 PM »
Very good! Another mistery solved. I think it's enough info to make my repeater now. I guess besides setting up a station as coming via repeater X and handling the packets accordingly is all you need to do. The timing and hopping scheme is the same. So I guess it's going to be straightforward. I hope to see it implemented in the Meteostick soon 8-)

An interesting addition would be the ability to receive a lot more stations than 8. The repeaters probably don't care, and with proper site planning it's entirely possible. Packet collisions would start to get a real problem after a certain number, though.

Offline docbee

  • Forecaster
  • *****
  • Posts: 853
    • smartbedded
Re: VP2 repeater packet format?
« Reply #27 on: March 07, 2015, 06:49:58 AM »
I hope to see it implemented in the Meteostick soon 8-)

It is available as beta firmware for Meteostick: http://forum.meteohub.de/viewtopic.php?f=59&t=10243&p=17341#p17341
founder of smartbedded.com - home of meteohub, meteoplug, meteobridge, meteostick

Offline rdsman

  • Senior Contributor
  • ****
  • Posts: 249
Re: VP2 repeater packet format?
« Reply #28 on: March 22, 2015, 02:11:56 PM »
cmatteri & kobuki:

I used the information that both of you provided and created the following example demo repeater code (4DGL) for use with the Vue.  Only the relevant portion is shown:

Code: [Select]
//
//
//
func main()

    initialize();     //  Sets up the display.
    Radio.begin();    //  Configure the CC1101 registers.
    rxHopIndex := 0;  //  Set the initial hopIndex values.
    txHopIndex := 25;
    Radio.setFrequency(rxHopIndex);
    Radio.receive();  //  Begin reception.

    repeat

        if (radioStatus & CC1101_RX_END)

            radioStatus &= ~CC1101_RX_END;
            repeatPacket();
            Radio.hop();  //  Increments both hop indexes.
            Radio.setFrequency(rxHopIndex);
            Radio.receive();

        endif

    forever

endfunc
//
//
//
func repeatPacket()

     var crc;
     
     for (i := 0; i < 10; i++)
        txBuffer[i] := rxBuffer[i];
     next

     switch (txBuffer[0])

        case 0x50:
        case 0x80:
                   txBuffer[6] := 0x85; txBuffer[7] := 0x00;
                   txBuffer[8] := 0x85; txBuffer[9] := 0x00;
                   break;
        case 0x20:
        case 0x30:
        case 0x70:
        case 0x90:
        case 0xA0:
        case 0xE0:
                   txBuffer[6] := 0x05; txBuffer[7] := 0x08;
                   txBuffer[8] := 0x05; txBuffer[9] := 0x08;
                   break;
        default:
                   Radio.flush();
                   return;

     endswitch

     crc := Radio.calcCrc(txBuffer, 8);
     txBuffer[6] := crc >> 8;
     txBuffer[7] := crc & 0xFF;

     Radio.setFrequency(txHopIndex);
     Radio.transmit(txBuffer, 10);

     gfx_GoTo(30, 0);
     putstr("                                              ");
     gfx_GoTo(30, 0);

     print([DEC2Z] rxHopIndex, "\t");

     for (i := 0; i < 10; i++)
        print([HEX2] rxBuffer[i], "\t");
     next

     gfx_GoTo(50, 0);
     putstr("                                              ");
     gfx_GoTo(50, 0);

     print([DEC2Z] txHopIndex, "\t");

     Radio.reverseBits(txBuffer, 10);   //  Reverse the bits for printing.

     for (i := 0; i < 10; i++)
        print([HEX2] txBuffer[i], "\t");
     next

endfunc


It has run flawlessly for 48 hours!
« Last Edit: March 23, 2015, 05:10:54 PM by rdsman »
Ray

Offline kobuki

  • Forecaster
  • *****
  • Posts: 838
Re: VP2 repeater packet format?
« Reply #29 on: March 22, 2015, 02:17:36 PM »
I has run flawlessly for 48 hours!

Nice! It's best when practice confirms theory, right? 8-)

Offline cmatteri

  • Member
  • *
  • Posts: 11
Re: VP2 repeater packet format?
« Reply #30 on: March 23, 2015, 11:38:12 PM »
 =D&gt;

Nice.  Glad to have helped.