CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Radio Comunication

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

Radio Comunication
PostPosted: Sat Nov 04, 2006 3:55 am     Reply with quote

Hi Everybody,

I use a low-cost transceiver fsk modules for radio comunication. The input output is RS232.

A master station send data and wait answer from one slave station. The data contain the univocal address of slave so only one slave can answer.

The system work fine without problem but, in case of long distance, I need to insert one or more repeater.

I want to use repeater that "repeat" every valid comunication received. I have the only problem to test, before transmit, if the channel of comunication is really free. The transceiver does't have this option and the only way to test channel is controll the received RS232 character and wait for a fix time without comunication before transmit. At the moment every slave and repeater has the same way to test the precence of comunication and the system doesn't work really fine.

Have you got any suggestion or idea about ?

Regards,
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Sat Nov 04, 2006 4:20 am     Reply with quote

Is the problem that all the radios check for communication and if OK, they all reply at the same time?

If that is the problem, I think most similar systems use a scheme to delay for a random period of time to prevent collisions.

Try to explain a little more about the details of the 'problem'.

John
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Sat Nov 04, 2006 4:36 am     Reply with quote

Hi,

I belive the problem is that, fix check time doesn't prevent collisions.

I don't realize the way to have random time to check radio channel.


Regards,
Fabri
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Sat Nov 04, 2006 4:52 am     Reply with quote

When it is time to reply to a transmission, all radios delay a random period of time and then recheck if receiving. If not receiving, then they can transmit. The radios that had a longer random delay will then see radio traffic when rechecking prior to trying to transmit and delay again. There most be a name for this scheme but I'm not sure. One of the pros should be able to help more. They'll be around later, apparently they sleep at night.

John
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Nov 04, 2006 9:56 am     Reply with quote

One aproach to ovoid collision is to assign to every Slave a unique delay, that is,
you can use the same code for every Slave and using its Address value * reply_delay
to get an univoque delay value to respond to the Master.

For example:
Code:

#define Slave_ID    1    // 2, 3,... n for every Slave
#define reply_delay 5

// then in the Tx code:

   answbck_delay = (reply_delay * Slave ID);

   if( answerback)
     {
        delay_ms(answbck_delay); // this delay is unique for every Slave
        Tx_answerback();
     }


Hope you catch the idea.

Humberto
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Sun Nov 05, 2006 2:21 am     Reply with quote

Hi,

I thought that but it's quite impossible because in any sistem there's a possibility to have over 200 slave. The solution, I belive, is testing radio channel if is free but every slave, and repeater, test the channel the same time.

Any other idea ?

Regards,
lu2fgn
Guest







PostPosted: Fri Nov 10, 2006 5:38 am     Reply with quote

Hi

Yust like Packet radio system, must generate a random time slot after
the radio channel is free to use, to avoid collision.

Best regards

Alberto
sebdey



Joined: 11 Sep 2003
Posts: 17
Location: Switzerland

View user's profile Send private message

Bidirectionnal radio communication
PostPosted: Fri Nov 10, 2006 7:56 am     Reply with quote

Hi,
I have run into the same problem in one of my current projects. I am also using FSK modems, but not so cheap radios.

When trying to implement bidirectional communication between my devices, I figured out this point:
- the time required for my radios to switch between receive and transmit was so long that I could not use the delay scheme proposed in these posts (switching time is so long that a transmmission could begin during the switching...)
- moreover as I can also have dozen's of clients 'connected' to one master, I could not use the fixed delay (client #120 would have to wait too long...)

So I had to develop a 'software' solution. As all my clients and masters are on the same channel/frequency, every client can 'hear' all transmissions, also every client has a unique Id. The idea then is to create, in the clients, for every message requiring an answer, a list of who was aimed by this message and then to answer in ascending id priority.

Let's say that we have 4 clients aimed by a master's message, client 10,12,25 and 40. Those 4 will know that they have to answer something and also that 3 others clients should answer something. Client 10 should be the first to answer something, then client 12, client 25 and finally client 40. Add to that a constant timeout if one is not responding and you have it !
This was for me and my hardware, the only solution to avoid packet collisions...
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Fri Nov 10, 2006 8:52 am     Reply with quote

Hi,

Thanks for help everybody.

I' solving the problem so:

Every slave has it uniqu address so only one slave answer to master. I decided to include in data packet the address of repeater so the master transmit to repeater and the to slave. I intruduced 3 level of repeater.

In this way I don't have collision but the radio comunication is not very fast.

Regards and thanks for nice help again,
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group