Modifications

Sauter à la navigation Sauter à la recherche
Ligne 191 : Ligne 191 :     
As the {{fname|rfm.send()}} only acept {{fname|bytes}}/binary data, the {{fname|msg}} is transformed into an array of bytes with {{fname|bytes()}} . {{fname|bytes()}} array can only contains ASCII bytes < 127, any other character/byte must be appropriately encoded! This is why the call to {{fname|bytes(msg , "utf-8")}} mentions the source string encoding (which is [https://fr.wikipedia.org/wiki/UTF-8 UTF-8] nowadays).
 
As the {{fname|rfm.send()}} only acept {{fname|bytes}}/binary data, the {{fname|msg}} is transformed into an array of bytes with {{fname|bytes()}} . {{fname|bytes()}} array can only contains ASCII bytes < 127, any other character/byte must be appropriately encoded! This is why the call to {{fname|bytes(msg , "utf-8")}} mentions the source string encoding (which is [https://fr.wikipedia.org/wiki/UTF-8 UTF-8] nowadays).
 +
 +
== LEDs and Error management ==
 +
Being able to understand rapidly what's happening inside your object is essential to rapidly fix the issue.
 +
 +
The best is to figure out what's happening is to use LED, blink status, heartbeat.
 +
 +
By doing so, no need to attach an USB cable and opens a terminal over the USB-Serial to figure out the status of the object.
 +
 +
[[Fichier:ENG-CANSAT-PICO-MISSION1-CAPTURE-25.png|360px]]
 +
 +
The {{fname|cansat2.py}} script do re-enforce error controls with {{fname|try...except}} statements in the script and showing various onboard LED patterns in case of error.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
| align="center" | LED operation
 +
| align="center" | Description
 +
| align="center" | Fix the issue
 +
|- style="font-size: 90%"
 +
| align="left" | NeoPixel GREEN
 +
| align="left" | The {{fname|setup()}} function did not complete initialization because of a crash.
 +
| align="left" | Check the wiring of sensors. Test each sensor separately (with their tests code). If  this not working, remove all sensors except the one you are testing.
 +
|- style="font-size: 90%"
 +
| align="left" | NeoPixel OFF
 +
| align="left" | The {{fname|setup()}} did complete successfully. The main {{fname|loop()}} is not running.
 +
| align="left" | ''Nothing to do here, just check the RADIO_LED for more informations''.
 +
|- style="font-size: 90%"
 +
| align="left" | RADIO LED = 1 pulse 50ms
 +
| align="left" | The LED is pulsed for each successfully send message + getting ACK from the receiver. The code wait 500ms max for the ACK.
 +
| align="left" | ''Nothing to do here''.
 +
|- style="font-size: 90%"
 +
| align="left" | RADIO LED = 2 pulse 50ms + pause 100ms
 +
| align="left" | Message send but error while decoding the ACK response.
 +
| align="left" | ''This is not critical, the most important is that the message was sent successfully''.
 +
|- style="font-size: 90%"
 +
| align="left" | RADIO LED = 3 pulse 50ms + pause 150ms
 +
| align="left" | Not ACK message received within the 500ms after message was sent.<br />This can be interpreted as "Is there someone listening the message?" because there are not reply.
 +
| align="left" | ''This is not critical, the most important is that the message was sent successfully''.
 +
|}
 +
 +
    
{{ENG-CANSAT-PICO-TRAILER}}
 
{{ENG-CANSAT-PICO-TRAILER}}
29 917

modifications

Menu de navigation