Modifications

Sauter à la navigation Sauter à la recherche
3 032 octets ajoutés ,  27 février 2022 à 22:42
Ligne 33 : Ligne 33 :     
  {{ambox|text=The [https://github.com/mchobby/esp8266-upy/tree/master/rfm69 RFM69 library repository] contains many examples of usage. Do not hesitate to check them!}}
 
  {{ambox|text=The [https://github.com/mchobby/esp8266-upy/tree/master/rfm69 RFM69 library repository] contains many examples of usage. Do not hesitate to check them!}}
 +
 +
== About Antennas ==
 +
{{ambox-stop|text=The RFM69HCW will not work without antenna, even at 1m distance of each other.}}
 +
 +
For this example, a simple wire twisted in the antenna hole will do a great job for testing.
 +
 +
'''Please wait before soldering the wire inside the antenna hole!'''.
 +
The antenna hole can be populated with:
 +
* a simple wire
 +
* a {{pl|1418|µFl SMT antenna connector}} where you could plug various kind of antenna.
 +
* a {{pl|1419|PCB SMA Connector}} where you could plus various kind of antenna.
 +
 +
<div style="margin: 15px 0; background: rgba(255,204,102,.3); display: block; padding: 15px 15px 15px 15px; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; border: 1px solid #ff9900;" >The antenna design is a key feature to ensure a reliable communication over a long distance.</div>
 +
 +
A µFl connector (also named uFl) is looking to this:
 +
 +
[[Fichier:ENG-CANSAT-RFM69HCW-TEST-uFL-connector.jpg|150px]] 
 +
 +
A PCB SMA Connector is looking to this:
 +
 +
[[Fichier:ENG-CANSAT-RFM69HCW-TEST-SMA-connector.jpg|150px]]
 +
 +
== Frequency, Encryption & Power ==
 +
To make the module communicating together:
 +
* The module must be identical. You cannot mix them.
 +
* The tuned frequency must be identical.
 +
* The encryption key must be identical.
 +
 +
=== Tuned frequency ===
 +
The tuned frequency is declared with a line like this:
 +
<syntaxhighlight lang="c">#define RF69_FREQ 433.0
 +
 +
...
 +
 +
if (!rf69.setFrequency(RF69_FREQ)) {
 +
    Serial.println("setFrequency failed");
 +
}</syntaxhighlight>
 +
 +
where the tuned frequency is declared with the constant '''RF69_FREQ'''.
 +
 +
{{ambox-stop|text=Use the frequency assigned to your team by the instructor.}}
 +
 +
In packet radio, several teams can share the same frequency if they use distinct encryption key.
 +
 +
Like TCP (from TCP/IP network), the packet radio is able to detect packet colission try to recover from it.
 +
 +
However, more teams share the same frequency, more collision we have.
 +
 +
=== Encyption Key ===
 +
The module encrypts the data with AES-128.
 +
 +
The encryption key is defined into the following lines.
 +
 +
<syntaxhighlight lang="c">// The encryption key has to be the same as the one in the server
 +
uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
 +
                  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
 +
rf69.setEncryptionKey(key);</syntaxhighlight>
 +
 +
{{ambox-stop|text=It is highly recommended for each team to define its own encryption key.}}
 +
 +
'''When all the teams do use the same frequency and the same key''' then they will all receives the messages from the other teams sending messages. Your messages will also been received by all the other teams.
 +
 +
=== Transmission Power ===
 +
The transmission power is set with the function call.
 +
 +
The range of power is 14 to 20 (in dBi). Lowest values requires less power. Means higher battery life but also smaller transmission distance.
 +
 +
<syntaxhighlight lang="c">rf69.setTxPower(20, true);</syntaxhighlight>
 +
 +
Notice: the second parameter concerns the HCW radio modules and indicates that extra amplifier is present.
       
{{ENG-CANSAT-PICO-TRAILER}}
 
{{ENG-CANSAT-PICO-TRAILER}}
29 917

modifications

Menu de navigation