Transmission works with wires but not always with wireless


Closed Thread
Results 1 to 40 of 43

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    9

    Default Transmission works with wires but not always with wireless

    I am using the Laipac 315 MHz RF modules and I serout only once and it works with wires 100% of the time. When I try wireless it works once in a while. On the other hand, when I serout 5 times the wireless works most of the time but does not work once in a while. I have added 4 $55s for a preamble and manchester encoded everything.
    Last edited by jyi1; - 24th April 2007 at 05:59.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jyi1 View Post
    I am using the Laipac 315 modules and I serout only once and it works with wires 100% of the time. When I try wireless it works once in a while. On the other hand, when I serout 5 times the wireless works most of the time but does not work once in a while. I have add 4 $55 for a preamble and manchester encoded everything.
    But yet we don't see any code to base an opinion on what could possibly be wrong!

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    skimask,

    Not all solutions require the persons code to solve the problem.

    If you've used a "Laipac 315" before, then maybe you've noticed something that might apply.

    He's made a very specific request, and shouldn't expect an answer for quite some time. Hopefully from someone that's tried that device before.

    You're indignant response only 1 minute after his post, does not help.
    <br>
    DT

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    skimask, Not all solutions require the persons code to solve the problem. If you've used a "Laipac 315" before, then maybe you've noticed something that might apply. He's made a very specific request, and shouldn't expect an answer for quite some time. Hopefully from someone that's tried that device before. You're indignant response only 1 minute after his post, does not help. <br>
    True...but if the guy has the code in the first place, why not hasten the process and post it straight away!

    And tell me that this thread/code and this one
    http://www.picbasic.co.uk/forum/showthread.php?t=6145
    don't look very similar...too similar...not that there's anything wrong with that. I mean, at least the guy (whether it be the same guy as the other thread or actually a new guy) searched the forum's and found some usable code instead asking for somebody else to write it all.
    And no, I don't think everything is a conspiracy...or is it?

  5. #5
    Join Date
    Apr 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Transceiver

    Include "Modedefs.bas"

    ct55 var byte: encoded1 var byte: p var byte: counter var byte: e var byte: action var byte:
    encoded var byte: encoded2 var byte: action2 var byte: B0 var bit: B1 var bit: B0=1: B1=0:
    p=0: e=0: encoded1=0: counter = 0: action=0: action2=0: encoded=0: encoded2=0:

    Main:

    Clr:
    p=0: e=0: encoded1=0: action=0: action2=0: encoded=0: encoded2=0

    Maina:
    ct55=0 'counter for $55 is zero

    Wait55:
    serin PORTB.0, n2400, encoded1
    If encoded1 = $55 Then
    ct55 = ct55 + 1
    If ct55 = 4 Then goto Waitaa
    Else
    goto Maina
    Endif
    goto Wait55

    Waitaa:
    serin PORTB.0, n2400, encoded1
    If encoded1 <> $aa Then goto Maina
    serin PORTB.0, n2400, encoded1
    write 0, encoded1

    For counter = 0 to 3 : p.0[counter] = encoded1.0[counter*2]:Next counter
    write 1,p

    e = p:
    If ((e.3=B0) and (e.2=B1)) Then
    goto L3
    Else
    write 2, p
    goto Clr
    Endif

    L3:
    If((p.1=0) and (p.0=0)) Then
    action=%1010
    write 3, p
    For counter = 0 to 3
    If action.0[counter]=0 Then
    encoded.0[counter*2]=0 : encoded.0[counter*2+1]=1
    Else
    encoded.0[counter*2]=1 : encoded.0[counter*2+1]=0
    Endif
    Next counter:
    write 8, encoded
    For counter = 0 to 4
    serout PORTB.7, n2400, [$55,$55,$55,$55,$aa, encoded]
    Next counter
    goto Clr


    Endif

    If ((p.1=0) and (p.0=1)) Then
    action2 = %1011
    write 4, p
    For counter = 0 to 3
    If action2.0[counter]=0 Then
    encoded2.0[counter*2] = 0: encoded2.0[counter*2+1] = 1
    Else
    encoded2.0[counter*2] = 1: encoded2.0[counter*2+1] = 0
    Endif
    Next counter:
    write 9, encoded2
    For counter = 0 to 4
    serout PORTB.7, n2400, [$55,$55, $55, $55,$aa, encoded2]
    Next counter
    goto Clr

    Endif
    End

    Receiver

    Include "Modedefs.bas"
    cot55 var byte: encoded1 var byte: p var byte: counter var byte: e var byte:
    p = 0: e = 0: encoded1 = 0: counter = 0:

    Main:


    Mainb:
    cot55=0 'counter for $55 is zero

    Wait55:
    serin PORTB.0, n2400, encoded1
    If encoded1 = $55 Then cot55 = cot55 + 1
    If cot55 = 4 Then
    goto Waitaa
    Else
    goto Wait55
    Endif
    'goto Wait55

    Waitaa:
    serin PORTB.0, n2400, encoded1
    If encoded1 <> $aa Then goto Maina
    serin PORTB.0, n2400, encoded1
    write 0, encoded1

    For counter = 0 to 3 : p.0[counter] = encoded1.0[counter*2]: Next counter
    write 1,p

    If (p.1=1) Then
    goto B4
    Else
    write 2,p
    High 2
    Pause 1000
    Low 2
    goto Mainb
    Endif

    B4:
    e = p
    write 3, e
    High 1
    Pause 1000
    Low 1
    High 5
    serout PORTB.3, n2400, [e.3]
    serout PORTB.4, n2400, [e.2]
    goto Mainb

    End
    Last edited by jyi1; - 24th April 2007 at 05:46.

  6. #6
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jyi1 View Post
    I am using the Laipac 315 MHz RF modules and I serout only once and it works with wires 100% of the time. When I try wireless it works once in a while. On the other hand, when I serout 5 times the wireless works most of the time but does not work once in a while. I have added 4 $55s for a preamble and manchester encoded everything.
    JYI1:

    Firstly, I feel a name is more suited to talking in a forum. Anyway, after seeing your code, I do feel you can look for the 55,aa alone as the marker to your data. You may not see the 4x55s followed by the aa considering that the Laipac receiver module is ASK(correct me if I am wrong).

    I have used similar modules with PIC and implemented a wireless joystick which works like you say almost 100% of the time. There is an occasional hiccup due to which I would not get 100%. To achieve this, I know that RF shielding of the receiver is priority #1. I did not Manchester code my data, that could be the reason for the almost 100% accuracy. Also, the modules I have used (Summitek) specify the data rate in the region of almost 1200 baud and not 2400 baud as you use. Perhaps you need to look into this as well.

    Jerson

  7. #7
    Join Date
    Apr 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Yes Laipac uses ASK and has 2400 bps. I do not understand why the $55,$55,$55,$55,$aa is not always picked up by the receiver when I send it once. It seems like I need to send it the same thing 5 times for it to pick up reasonably well.

  8. #8
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    The module needs time to get above the noise floor before it can decode the $55 stream correctly. That is why I suggested to just look for the $55,$AA in your code; you still have to transmit the $55s before you send the $AA. Those should be considered as padding and ignored in the receiver. You may increase it beyond the 4 that you have now to improve performance if you will.

    Transmit $55,$55,$55,$55,$55,$AA,"data"
    Receive .................."ah there it is","data" You ignore the first 4x$55


    Jerson
    Last edited by Jerson; - 24th April 2007 at 06:56. Reason: <data> shows as blanks

  9. #9
    Join Date
    Apr 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    So I should basically send a couple of $55 and then just wait for $55, $aa only?
    I'm thinking of coding it like: serin2 PORTB.0, 16780, [WAIT($55, $aa) ,encoded1], would this be good enough?

  10. #10
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    I think you got the point. Still, tell us your name. JYI1 sounds like a name from the new StarTrek series

    Jerson

  11. #11
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jyi1 View Post
    I am using the Laipac 315 MHz RF modules and I serout only once and it works with wires 100% of the time. When I try wireless it works once in a while. On the other hand, when I serout 5 times the wireless works most of the time but does not work once in a while. I have added 4 $55s for a preamble and manchester encoded everything.
    I think skimask has a very good point. You started with the statement above and are now deeper than you could ever imagine. There is a subtle truth to the KISS principle, it works and it is simple.

    • What are your expectations?
    • Do you have something that works 4-out-of-5 times? I mean you send the message 5 times and you receive it 4.
    • Where you expecting the link to work 100% of the time? If so, do you know what your link budget is? Do you now how much margin you have? What distance you need to cover?
    • I do not know of any comm system that works 100% of the time. The best systems (very expensive) use redundancy, error correction, complex modulation schemes, etc. Normal systems (i.e. remotes, sensors, telemetry) usually just encode and send several times.
    • You pick what you think you need in terms of reliability and no more usually. If you have way more, you over-designed it (your wasting battery power, causing unintended radiation, or something else).

    I am not trying to persuade you from making something better. But seeing how complicated it is getting, do you really need it this complex? Or can you keep your manchester coded signal (which apparently is already working) send it a few times and only use the first one that passes a CRC check or something like that?

  12. #12
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by languer View Post
    I think skimask has a very good point. You started with the statement above and are now deeper than you could ever imagine. There is a subtle truth to the KISS principle, it works and it is simple.
    And one other point I might make...
    The 432-433Mhz modules seems to work, the 315 doesn't.
    Why not use 2 432-433Mhz modules, one master, one slave. Sure you can't use them both at the same time, bidirectionally. But for instance, maybe the slave will ONLY answer after the master has spoken. Use a PICs pin to provide power to the modules, turn off the master's receiver while it's transmitting, turn off the transmitter while it's receiving, and so on with the slave, only the other way around in reverse...
    I think I get what the end result is supposed to be, with changing all the bits around and sending the modified code back. But why not let the PIC handle the bit changing after receiving a certain code or something along those lines.

    OK. You're crazy!
    __________________
    www.davehouston.net
    YES!!!

Similar Threads

  1. Wireless Tachometer - Design Help
    By DanPBP in forum Off Topic
    Replies: 2
    Last Post: - 3rd May 2009, 09:06
  2. RS485 Vs Wireless (TWS-434A)
    By koossa in forum Off Topic
    Replies: 3
    Last Post: - 11th April 2009, 12:40
  3. Serial Wireless
    By mackrackit in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th May 2007, 16:06
  4. Serial comm - are 2 wires for TX only enough?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 30th August 2006, 03:23
  5. RS 485 wireless communication
    By Armadus in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 26th January 2006, 19:30

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts