smartanthill / smartanthill2_0

SmartAnthill is an open IoT system which allows easy control over multiple microcontroller-powered devices, creating a home- or office-wide heterogeneous network out of these devices
http://smartanthill.org
GNU General Public License v2.0
13 stars 3 forks source link

SAMP - Mesh Network Protocol - Request For Comments #11

Open nobugs-hare opened 9 years ago

nobugs-hare commented 9 years ago

It seems that it is possible to have a mesh network within very restricted MCU requirements (and over protocols which are not inherently supporting mesh).

With some effort, it seems like that we'll be able to have it working even on top of protocols without CSMA/CA. It means that we should be able to create open source mesh network implementation working over heterogeneous network (!), where underlying protocols can be very different, and may include plain RF(!!) - as previously, all this aiming at stock MCUs with 512 bytes of RAM (maybe 1K for Retransmitting Devices). What bothers me a bit is amount of Flash required, but it seems that we can skip most of SAMP implementation for non-Retransmitting Devices.

Questions:

  1. Are there any special considerations we should take into account for our mesh protocol? (inherent asymmetry between SA devices is already accounted for).
  2. Can somebody take a look and tell if popular and cheap RF chips can tell "if somebody is transmitting right now?" (not just "here is your bytes which were transmitted some time ago", but "right now"). This function is an unavoidable building block for CSMA/CA, and it is better to know if we can assume that we can implement basic CSMA/CA for RF, or if we need to rely on our own mechanisms to avoid collisions in 'flood'-like scenarios (it seems that we can do both, but it is better to know how to optimize it).
ivankravets commented 9 years ago

Are there any special considerations we should take into account for our mesh protocol?

I've aslo thought about it earlier but within wired buses. If we talk about SA Network we should not be limited just with RF-based SmartAnthill Devices. See an example, where SAMP could be useful within wired buses: SmartAnthill Core -> Ethernet/Wi-Fi Enabled MCU with CAN Controller -> CAN Bus -> SmartAnthill CAN-based Devices. Using network types: ETH -> ETH -> CAN.

Can somebody take a look and tell if popular and cheap RF chips can tell "if somebody is transmitting right now?"

I've just asked Vitaliy, he is going to test it today using low-cost nrf24L01. I'll put answer here.

nobugs-hare commented 9 years ago

If we talk about SA Network we should not be limited just with RF-based SmartAnthill Devices.

Of course; unlike ZigBee etc., our mesh is heterogeneous, so it can work either as wireless (RF included), or wired, or intermix of wired and wireless. For example, one of the paths could look as Central Controller+WiFi -> WiFi+Device+USB -> USB cable going through the wall where wireless doesn't pass -> USB+Device+IEEE802.15 -> IEEE802.15.4+Device. Any other conceivable combination should be also possible.

ivankravets commented 9 years ago

I've just asked Vitaliy, he is going to test it today using low-cost nrf24L01

He reported that there are no interrupts for "if somebody is transmitting right now". MCU interrupts only when completely data(packet) has been received. See datasheet:

https://www.sparkfun.com/datasheets/Components/SMD/nRF24L01Pluss_Preliminary_Product_Specification_v1_0.pdf http://i57.tinypic.com/2n0pmc3.png

nobugs-hare commented 9 years ago

Thanks; it makes things more difficult, but it is challenges which make it interesting :-)

nobugs-hare commented 9 years ago

BTW, is there a chance that these chips implement CSMA/CA (see http://en.wikipedia.org/wiki/Carrier_sense_multiple_access_with_collision_avoidance) or maybe some other collision detection/avoidance schema themselves?

ivankravets commented 9 years ago

BTW, is there a chance that these chips implement CSMA/CA (see http://en.wikipedia.org/wiki/Carrier_sense_multiple_access_with_collision_avoidance) or maybe some other collision detection/avoidance schema themselves?

@valeros please research this information for a few popular low-cost RF chips. Thanks in advance!

valeros commented 9 years ago

Here are a few chips with support carrier detect for "listen before transmit" :

  1. CC1100 low power Sub-1GHz RF Transceiver. http://www.ti.com/lit/ds/symlink/cc1100.pdf
  2. nRF905 Low-Power UHF Wireless Transceiver Module. https://www1.elfa.se/data1/wwwroot/assets/datasheets/qjnRF905_E-rev1_3.pdf
  3. Si4430/31/32 ISM Transceiver (only Clear Channel Assessment). https://www.silabs.com/Support%20Documents/TechnicalDocs/Si4430-31-32.pdf
  4. RFM22B ISM Transceiver (only Clear Channel Assessment). https://www.sparkfun.com/datasheets/Wireless/General/RFM22B.pdf
  5. SPIRIT1 (STMicroelectronics) Low data rate, low-power sub-1GHz transceiver (with embedded CSMA/CA protocol). http://www.st.com/web/en/resource/technical/document/datasheet/DM00047607.pdf