SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By rich
#2646
Hi,

I am using the tRF24G transceiver to impleent a basic wireless network of sensors.

I've finally got it working perfectly with only two transceivers. With 40 bit addresses, 16 bit CRC, ACK's and sequence numbers, I have a very very low error rate. (If anyone is interested in the code, let me know and I'll put on avrfreaks academy)

But now to implement my network I am a bit stuck. I am using shockburst mode and need some kind of a broadcast address that all transceivers automatically receive on. I know that in direct mode this can be software coded but in Shockburst mode can it be done?

I do'n't want to have to restructure it in Direct mode, any help would be much appreciated.

Richard
By pittuck
#2647
Hi, i have been pondering a network protocol for these devices for a while and have kinda settled on having addresses stored on EEPROM and when miss-match occurs or other devices are entered a global reset signal is broadcastable to all devices to turn settings to a factory setting, and then to retune the units to the correct settings. If you see what i mean...

i am working from the principle that each unit will have a dedicated controller which works on a serial (RS232 type, SPI or i2c) to the other controllers and controls data flow and error checking itself. Also an important feature will be a reset button and a hard copy of factory settings for when something goes wrong.

I have not got anywhere need a cohesive set of ideas, but running on a 'IP' device addressing scheme for each device connected to the network and when a new device enters it must already be on the correct address. (Funnily enough this works well as a new unit with defult address can easily be reprogrammed by resetting the master, all the rest will only notice that the master dissapears for a bit).

This is not a very good protocol, but it will do for small numbers of devices. One thing i have set on it the master broadcasting blips every x many ms so that the slaves know whats there. With 2 types of blips (data and new) adding new devices in a hot plug wait will be possible. IE have 5 consecutive data blips for slaves to send data if needed (followed by x amount of rx mode time), followed by one new blip where any unregistered devices can enter into the network.

Just ideas, i got a lot (also having a refresh blip to make sure devices have not left, but this will need some sort of error checking to make sure devices do hear OK!)

Regrads,

- Martyn

PS what speed is the interface running at, 1mbps or 250kbps (try 250 if u get the chance and there should be loss dropped packets).
By MJ
#2649
I'd be interested in the code, but I'd be implementing it on a PIC so would need some recoding. I think the concept is a good one and would be curious about it.

Any posting would be appreciated; thanks,
Jeff
By Guest
#2655
i would be interested in adapting your code to a project i am working on
By rich
#2659
I will put it on the academy this afternoon.

But do you have any ideas about broadcast addressing using shockburst? One option is to set them all to the same address, and then in the data field have the "real"address field. So all motes receive every send and then ignore if not for them. (And i could implement broadcast address in the software).

However this is not ideal, and it would be better there was an already set broadcast address. Any clues?
By richg
#2660
have put it on the academy, search for tRF24G
By SOI_Sentinel
#2663
Shockburst is set up as an address based protocol, not a message based protocol (as you'd like). If you can handle the overhead, one version of what Pittuck's going on about is to have the units (in their off time) "search" a block of addresses (small of course). When they find an active transciever, they swap active address databases, so the network is self-discovering. This might cause message loops, though, depending on how responsibility is handled. I'm thinking a simple daisy chain (esp. since they're all on the same frequency), with misses eventually bypassing the non-receptive transciever. It could re-introduce itself at a later date. This might cause a problem if all the transcievers are not within range of each other. Hmmm.... a bit more complex would be for the system to include the transcievers into the chain after the one that detected it. Hope message latency isn't too big a problem.


Now, a COMPLETELY different variation is what I'm going to refer to as Wireless CAN. CAN bus hits 1Mb/s and works in noisy environments. It has an 11 or 29 bit identifier, CRC, and data bytes. And ACK's too. Usually it's done with twisted pair connections. Now, I just got this one bouncing in my head for later. CAN is a message based protocol (no addresses), and the hardware takes care of nodes joining and leaving the network dynamically. Microchip has embedded 0-Vdd transmitters into many of their 18F series of PICs, and provide state machine transcievers for the SPI bus. It just MIGHT be possible to interface these into the Direct mode serial stream. You would have to temporarily bypass it on startup to load the configuration, though. You could bit-bang the interface through the onboard CAN lines for the PICs then switch on CAN, but you'd have to throw in a set of blocks for the external transciever.

Wireless CAN bridge?
By Genisys
#2685
Hi, did you post your code on Avrfreaks

Thank you

Rich.
By cristianosigla
#42274
rich wrote:Hi,

I am using the tRF24G transceiver to impleent a basic wireless network of sensors.

I've finally got it working perfectly with only two transceivers. With 40 bit addresses, 16 bit CRC, ACK's and sequence numbers, I have a very very low error rate. (If anyone is interested in the code, let me know and I'll put on avrfreaks academy)

But now to implement my network I am a bit stuck. I am using shockburst mode and need some kind of a broadcast address that all transceivers automatically receive on. I know that in direct mode this can be software coded but in Shockburst mode can it be done?

I do'n't want to have to restructure it in Direct mode, any help would be much appreciated.

Richard

Hello Richard, would like to know if address "in the modules obtained to decide the problem of" broadcast trf24g. If yes it would have some code to send as example. Grateful