Modifications

Sauter à la navigation Sauter à la recherche
1 841 octets ajoutés ,  30 octobre 2018 à 21:46
Ligne 1 : Ligne 1 :  
{{ENG-CANSAT-NAV}}
 
{{ENG-CANSAT-NAV}}
   −
{{traduction}}
   
== Introduction ==
 
== Introduction ==
 
The following wiring will prepare the "Receiver Station" for the mission 1. From the "RFM69HCW Testing" section, we will use an Arduino UNO and RFM69HCW module to '''redirect the Radio Messages to the serial port'''.
 
The following wiring will prepare the "Receiver Station" for the mission 1. From the "RFM69HCW Testing" section, we will use an Arduino UNO and RFM69HCW module to '''redirect the Radio Messages to the serial port'''.
Ligne 61 : Ligne 60 :     
In the informations:
 
In the informations:
* '''len''': len of the data.
+
* '''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).
 
* '''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'''
 
* '''transmitted_data''': the data as transmitted by the emitter. As designed in the emitter, it starts with ''':''' and ends with ''';\r\n'''
Ligne 67 : Ligne 66 :  
In the '''transmitted_data''', we can identify:
 
In the '''transmitted_data''', we can identify:
 
* The packet counter
 
* The packet counter
* The time counter (miiliseconds)
+
* The time counter (milliseconds)
 
* The temperature (from tmp36)
 
* The temperature (from tmp36)
 
* The atmospheric pressure (from bmp280)
 
* The atmospheric pressure (from bmp280)
Ligne 240 : Ligne 239 :  
Select the proper port in the menu '''Tools -> Port'''
 
Select the proper port in the menu '''Tools -> Port'''
   −
Then press the "compile" button.
+
Then press the "upload" button.
 +
 
 +
== Capturing data to file ==
 +
Having data available in the Arduino Serial Monitor is great... but capturing it without Arduino would be even better.
 +
 
 +
=== Putty ===
 +
The putty software (available on Windows, Mac, Linux) can be also be used to connect to the Arduino Serial Port interface
 +
 
 +
Here how it should be configured to capture the data.
 +
 
 +
[[Fichier:ENG-CANSAT-MISSION1-RECEIVE-30.png|360px]]
 +
 
 +
Putty also offers some logging capability that may be useful.
 +
 
 +
=== Linux command ===
 +
If you are addict to Linux or Raspberry-Pi board then you can easily view and capture the data with the following commnands.
 +
 
 +
cat /dev/ttyACM0 > output.dat
 +
 
 +
This command will redirect the content of the USB port to a file named {{fname|output.dat}} .
 +
 
 +
=== With Python ===
 +
The following Python script will capture a serial port (see {{fname|baud_rate}} variable) and write the content to a file (see {{fname|write_to_file_path}} variable).
 +
 
 +
The content of the file is reset when the script is started.
 +
 
 +
{{ambox-stop|text=Openning the Serial Port will issue the automatic Reset feature of the Arduino board.}}
 +
 +
<syntaxhighlight lang="python">
 +
import serial
 +
 
 +
serial_port = '/dev/ttyACM0';
 +
# depend on Serial.begin(baud_rate) in Arduino
 +
baud_rate = 115200;
 +
write_to_file_path = "output.txt";
 +
 
 +
output_file = open(write_to_file_path, "w+")
 +
ser = serial.Serial(serial_port, baud_rate)
 +
try:
 +
    while True:
 +
        line = ser.readline()
 +
        line = line.encode("utf-8") #ser.readline returns a binary, convert to string
 +
        print(line)
 +
        output_file.write(line)
 +
except KeyboardInterrupt:
 +
    print( 'User abord' )
 +
output_file.close()
 +
ser.close()
 +
</syntaxhighlight>
 +
 
 +
=== Other options ===
 +
You may find many other capture methods from Internet:
 +
* Free Software available on Internet
 +
* Source Code example for your favourite programming language.
    
{{ENG-CANSAT-TRAILER}}
 
{{ENG-CANSAT-TRAILER}}
29 837

modifications

Menu de navigation