Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotate 2nd frequency for HORUS_V2 (not continously) #65

Closed
wants to merge 11 commits into from
90 changes: 89 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# RS41ng - Amateur radio firmware for Vaisala RS41 radiosonde
## Attention: This clone do not support DFM17 (cloned during implementation)

## This clone has special attention to
- recover GPS after disortion
- TX Watchdog to reboot if 10 min silent.
- 4FSK Mode with two frequencies used alternating every intervall (reach more receivers)

**NOTE:** While this firmware has been tested with great success on a number of high-altitude balloon
flights, it is still a work in progress and some features might not work as expected yet!
Expand Down Expand Up @@ -142,7 +148,7 @@ Power consumption notes (at 3V supply voltage) by Mark VK5QI:
- GPS in full power acquisition mode: 110-120 mA (TX off), 160-170 mA (TX on)
- GPS locked (5 sats), full power: 96 - 126 mA (TX off), 170 mA (TX on)
- GPS locked, powersave mode, state 1: ~96 - 110 mA (TX off), ?
- GPS locked, powersave mode, state 2: 60 - 90mA (TX off), 130 mA (TX on)
- GPS locked, powersave mode, state 2: 60 - 90mA (TX off), 130 mA (TX on) - average 72 mA with TX every minute

The variations seem to be the GPS powering up every second to do its fixes.

Expand Down Expand Up @@ -253,6 +259,88 @@ Payload 3:
#define HORUS_V2_TIME_SYNC_OFFSET_SECONDS 80 // the third payload will transmit at 80 seconds within the 120 second interval
```

### Using two alternating frequencies in HORUS-V1/V2 Mode

In Europe, there are two areas where the receivers listen on their respective regional frequencies. So the problem can arise that you have to decide
which channel to choose for the best reception reports on the route. So the idea was to define an additional channel for sending.
You can find these two new entries in config.h

```
// V1 and V2 Version of horus 4FSK have their own switch
#define RADIO_SI4032_TX_FREQUENCY2_HORUS_V2_ACTIV true
#define RADIO_SI4032_TX_FREQUENCY2_HORUS_V2 437600000

#define RADIO_SI4032_TX_FREQUENCY2_HORUS_V1_ACTIV false
#define RADIO_SI4032_TX_FREQUENCY2_HORUS_V1 437600000
```

If activated, the frequency will change after each TX Intervall in HORUS-V1 also V2-Mode (not working in continous mode)

### TX-Watchdog: Rebooting after no transmissions over long time

While doing much testing sessions, sometimes the sonde was found in an state where GPS signals good conditions (long interval blink)
but there where no transmissions over a longer time. I did not found the reason so i decided to implement an watchdog. You can define the timeout
in the config (see sample)

The `config.h` shows new entries to activate this improvement.

```
// Enable this setting to watch TX and make a cold start on the CPU if no transmission occured after TX_LOST_FOR_SECONDS
// TX hangs up longer then 10 min, then REBOOT
#define RADIO_TX_LOST_CHECK_ENABLE true
#define RADIO_TX_LOST_FOR_SECONDS 600
```

### Flying solar powered

#### GPS-Watchdog: Rebooting after not reaching a 3D fix

Sometimes you launch the sonde in an area where GPS cannot be received and then take it to a place where GPS is available again.
Also if the sonde lost GPS in a jamming-zone. Anyway if this signal lost longer then aprox. 20 seconds the Ublox fall into a sleep mode.
I did not found a way to get it out of that sleep mode other then making a reboot. Thats what acually is implemented.
You can decide what the sonde should do after lost GPS signal and how long it waits before kicks an reboot.

There are ideas to prepare a RS41 powered by solar panels only. Goal is to fly more then one day don't have this limit with batteries.
Some addional enhancements are needable to reach this goal. One of them is to make sure after sunrise that there is a GPS fix.
To solve this its a good idea to make a System Reset in the air if a missing GPS-FIX reaches out some time limit (e.g. 3 minutes or longer).

The `config.h` shows new entries to activate this improvement.

```
// Enable this setting to make a cold start on the CPU if GPS-Fix missing longer then GPS_REBOOT_MISSING_GPS_FIX_SECONDS
#define GPS_REBOOT_MISSING_GPS_FIX_ENABLE true

// If enabled above, define threschold how long a missing GPS-Fix before cold start (dont hold it to short)
#define GPS_REBOOT_MISSING_GPS_FIX_SECONDS 200
```

#### Probe does not start at sunrise because current too low

If solar panels are to be used, it is important to consider a few things:

- Autostart nessesery. Currently, it is still unclear when the RS41ng software will cause a probe to start on its own when batteries are connected.
If the batteries are inserted into the existing holder (2 x AA type) the voltage is conducted via a voltage regulator on the board. In this case,
the button on the board probably works and must be pressed to start the software. This is not helpfull if you wait for pushing a button in the air.
But there is another method to connect the battery voltage. In this case, the regulator is bypassed. Here the probe starts immediately as soon as at
least 1.5 volts are present (up to 4 volts are tested). The battery is connected directly to one end of an SMD component.
I'm sure your community has more info on this.
- Solar panels should deliver 3-4 volts and a current of 200 mA.
- You need a capacity of around 2.000 µF to buffer the solar power a little bit. Somehow the RS41 will not start without them.

Lets have look on the voltage if the sun rises:
- Its dark, the capacitors are empty.
- First sun on the panels brings the voltage up to 300 mV. This will load slowly the capacitors.
- After a while the voltage comes up to 500 mV. The LEDs on the board start to glow and flicker a bit.
- More and more sun falling on the panels. The voltage climbs to 800-1.000 mV. Over 800 mV the red LED shows that the software starts but...
- While the voltage is still to low on 800 mV the main procedure on the board tries to init some hardware elements. This is successful
up to the moment when the GPS module gets initialized. There is a loop programmed and waiting the gps_init will work one day. Not this time.
- The voltage climbs still in background but the loop will never end. The only way to init the GPS unit successful is to initiate a System Reset.
- A System Restart is now implemented after waiting 10 times the loop initiated the GPS unit unsuccessfull.
- If the System is booting meanwhile the voltage is up to get the GPS unit initiated this time.
- Everything fine now .... But there is no guarantee this way of recovering is the best one - in practice it works.



## Building the firmware

The easiest and the recommended method to build the firmware is using Docker.
Expand Down
6 changes: 3 additions & 3 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ volatile bool system_initialized = false;
* Maximum length: 64 characters.
*/
char *cw_message_templates[] = {
// "$cs $loc6 $altm $gs km/h $tiC",
"vvv de $cs solar rs41 $loc8 $altm $gs kmh sk",
// "$cs $loc6",
// "$alt m",
// "$gs km/h $ti C",
// "$gs kmh $ti C",
NULL
};

Expand All @@ -78,7 +78,7 @@ char *pip_message_templates[] = {
* Note that many hardware APRS receivers show a limited number of APRS comment characters, such as 43 or 67 chars.
*/
char *aprs_comment_templates[] = {
// " B$bu $teC $hu% $prmb $hh:$mm:$ss @ $tow ms - " APRS_COMMENT,
" $ $altm $gskm/h $bvmV $clvel dir:$he - " APRS_COMMENT,
// " B$bu $teC $hu% $prmb - " APRS_COMMENT,
// " B$bu $loc12 $hh:$mm:$ss - " APRS_COMMENT,
// " $loc12 - " APRS_COMMENT,
Expand Down
Loading