Ligne 310 : |
Ligne 310 : |
| | | |
| {{traduction}} | | {{traduction}} |
| + | |
| + | === The code === |
| + | Now we will load and executes the {{fname|test_emitter.py}} emitter script. The script must be downloaded from the repository. |
| + | |
| + | {{traduction}} |
| + | |
| + | TODO DOWNLOAD |
| + | |
| + | The script can be either executed from Thonny -OR- transfered to the Pico and executed directly on the microcontroler. |
| + | |
| + | It will output the messages on the REPL/Shell over the serial line. |
| + | |
| + | {{ambox-stop|text=We will have to modify the script before executing it!}} |
| + | |
| + | The frequency and encryption key must be updated from team to team to avoids messages collisions and cross-over transmission between the teams. |
| + | |
| + | Ask the organizer for your team frequency according to the [[ENG-CANSAT-PICO-FREQUENCY-PLAN|Frequency Plan ]] |
| + | |
| + | |
| + | {{underline|'''Update for frequency plan, encryption key:'''}} |
| + | |
| + | * The '''frequency''' used by the receiver RFM69HCW must be exactly the same as the emitter! |
| + | * The '''Encryption key''' used by the receiver RFM69HCW must be exactly the same as the emitter! |
| + | * The '''Node ID''' is unique node identifier (0..255). This also the node ID where the base station (the receiver) must send the ACK the response. |
| + | * The '''BaseStation ID''' the node id (0..255) where the emitter must sent the messages (and from which the ACK response are espected). |
| + | |
| + | Locate the following lignes: |
| + | |
| + | <syntaxhighlight lang="python">FREQ = 433.1 |
| + | ENCRYPTION_KEY = b"\x01\x02\x03\x04\x05\x06\x07\x08\x01\x02\x03\x04\x05\x06\x07\x08" |
| + | NODE_ID = 100 # ID of this node |
| + | </syntaxhighlight> |
| + | |
| + | And update the value for '''FREQ''' and '''ENCRYPTION_KEY'''. |
| + | |
| + | The NODE_ID doesn't have to be updated, its is used as node identifier allowing message & ACK exchange between one receiver and several emitter (each having an unique NODE_ID (for the same ENCRYPTION_KEY and FREQ). |
| + | |
| + | {{underline|'''Openning the Serial Line:'''}} |
| + | |
| + | As we want to see the received message, we will open a terminal to receives the messages over the USB-Serial line. |
| + | |
| + | This can be done with the help of: |
| + | * Thonny IDE (that will automatically open the USB-Serial port) |
| + | * Putty (just open the USB-Serial port) |
| + | * mpremote |
| + | |
| + | Just starts the script and wait for the messages to come: |
| + | |
| + | [[Fichier:ENG-CANSAT-PICO-RFM69HCW-TEST-20.png|640px]] |
| + | |
| + | Voilà, We are ready to test the emitter (cansat). |
| + | |
| + | {{ambox|text=IF the file {{fname|test_receiver.py}} is copied to the micropython board THEN it can be started from REPL<br />with {{fname|import test_receiver}} }} |
| | | |
| == More info == | | == More info == |