Ligne 40 : |
Ligne 40 : |
| |} | | |} |
| | | |
| + | == Download the code == |
| + | The code is available for download on the [https://github.com/mchobby/cansat-belgium-micropython GitHub associated to this wiki]. |
| + | |
| + | {{download-box|Téléchargez Mission1 Base Station Receiver script (basestation.py)|https://github.com/mchobby/cansat-belgium-micropython/blob/main/mission1/basestation.py}} |
| + | |
| + | == About testing == |
| + | |
| + | Once the script {{fname|basestation.py}} renamed as {{main.py}} and uploaded to the board, just restart the board to make it running. |
| + | |
| + | {{ambox|text=It also possible to start the script from REPL with the instruction {{fname|import basestation}} }} |
| + | |
| + | The data can be view onto the REPL/Shell session by using Thonny, Putty, MPRemote. |
| + | |
| + | You should see the following messages appearing in the REPL. |
| + | |
| + | [[Fichier:ENG-CANSAT-PICO-MISSION1-RECEIVER-20.png]] |
| + | |
| + | Where we could see the received messages with additional information. |
| + | |
| + | <nowiki>[DATA](len=<data_len>,RSSI=<radio_rssi>)<transmitted_data></nowiki> |
| + | |
| + | * Each data received and send over the serial connection are prefixed with '''[DATA]''' |
| + | * The prefix is followed by information enclosed between parenthesis '''()''', this concerns the ''received data''.<br />Entries are key=value pairs separated by coma. |
| + | * At the end, we retrieve the transmitted data (under their binary content). |
| + | * The message contained into the [DATA] section is decoded to an utf8 string. |
| + | |
| + | In the informations: |
| + | * '''data_len''': length of the data stream received. |
| + | * '''RSSI''': indicated the [https://en.wikipedia.org/wiki/Received_signal_strength_indication strength of the signal] (-15 at best, -90 at worst). |
| + | * '''transmitted_data''': the data as transmitted by the emitter. As designed in the emitter, it starts with ''':''' and ends with ''';\r\n''' |
| + | |
| + | In the '''transmitted_data''', we can identify: |
| + | * The packet counter |
| + | * The time counter (milliseconds) |
| + | * The temperature (from tmp36) |
| + | * The atmospheric pressure (from bmp280) |
| + | * The temperature2 (from bmp280) |
| | | |
| | | |
| {{ENG-CANSAT-PICO-TRAILER}} | | {{ENG-CANSAT-PICO-TRAILER}} |