In We mentioned that a competition with prizes awaits all Habr users in August. It's time to lift the veil of secrecy. We thought that the phrase "cloud server" could be taken literally. So why not actually launch a working server into the sky that can be pinged! Initially, the idea seemed crazy, but after considering it from every angle and discussing it thoroughly, we figured out a way to send the server up to meet the birds. A groundbreaking launch will take place at the end of August, and for now, we are working on the project’s hardware aspect. Details follow.
- The server will be based on Raspberry Pi 3
It would be interesting to lift a one-unit server into the air, but its weight plus the weight of the UPS... This would require significant lift force. And why, when a compact Raspberry Pi 3 can host a quite decent server with computational power several hundred times greater than the machine Tim Berners-Lee was using for fun in 1991.
- The server will be launched on a hot air balloon
We had ideas of lifting the server on a helium probe, but then the server would not be pingable for long before the balloon bursts at high altitudes in rarefied air, and the entire setup would fall to the ground. We wanted to extend the "window" of airtime to one and a half hours. Thus, we decided to use a hot air balloon. The flight duration will be two hours. Moreover, although the flight is not entirely controllable, there can be our engineer in the basket who can quickly "turn it on and off" in case of a malfunction.
- We will use cellular network as the transport network
Modern WiFi antennas can cover quite large distances, but it would require building a communication system that is little inferior to military radar stations in terms of parameters. Building such a system for 1.5-2 hours of communication doesn't make sense since, at the altitude of the hot air balloon, cellular communication must be stable.
After formulating these "postulates", the project no longer seemed unattainable, and soon we began to work on all three fronts simultaneously.
First of all, we reached out to the guys from , having eaten a dog on launches into the air with various iron pieces (followed by searching and rescue).
Then we pulled out a Raspberry Pi 3, which was lying in our admin's drawer, and started setting it up.

We connected the camera:

And tested it on our "Semyon":

Semyon is very convenient as a model and assistant — he doesn’t ask for food, doesn’t get distracted by the phone, is always in a great mood, and has a wide smile across his face. Of course, we won’t need such a spacesuit for the flight, but it creates the right atmosphere in the office.
The project scheme is as follows:

The power bank is used for ground testing; we need something more reliable to launch.
The most interesting piece of hardware is the board for receiving data from all sensors:

The guys from struggled with various analogs for a long time before creating their own onboard computer, because reliability is crucial; the project's fate depends on telemetry data. The onboard computer is responsible for receiving data from all connected sensors and transmitting it to the Raspberry Pi.
We launched it, set it up, and after a couple of weeks of programming and some ritual dances, we managed to get telemetry data and a photo of Semyon with the wide-angle camera:

Telemetry data is transmitted in a single string format:

Then this code transforms the string into an array and displays the data on the website:
$str = 'N:647;T:10m55s;MP.Stage:0;MP.Alt:49;MP.VSpeed:0.0;MP.AvgVSpeed:0.0;Baro.Press:1007.06;Baro.Alt:50;Baro.Temp:35.93;GPS.Coord:N56d43m23s,E37d55m68s;GPS.Home:N56d43m23s,E37d55m68s;Dst:5;GPS.HSpeed:0;GPS.Course:357;GPS.Time:11h17m40s;GPS.Date:30.07.2018;DS.Temp:[fc]=33.56;Volt:5.19,0.00,0.00,0.00,0.00,0.00,0.00,0.00';
parse_str(strtr($str, [
':' => '=',
';' => '&'
]), $result);
print_r($result);Description of some data:
- N:2432; — data package number, always increasing
- T:40m39s; — time since the flight controller was turned on
- MP.Stage:0; — flight stage (0 — on the ground or below 1km, 1 — ascent, 2 — hovering at height, 3 — descent)
- MP.Alt:54; — barometric altitude in meters above sea level — it should be displayed
- MP.VSpeed:0.0; — vertical speed in meters per second with a median filter
- MP.AvgVSpeed:0.0; — vertical speed in meters per second with a smoothing filter
- Baro.Press:1006.49; — pressure according to the barometer in millibars
- Baro.Alt:54; — height according to the barometer
- Baro.Temp:36.99; — temperature of the barometer itself
- GPS.Coord:N56d43m23s,E37d55m68s; — current coordinates
- GPS.Home:N56d43m23s,E37d55m68s; — coordinates of the starting point
- GPS.Alt:165; — altitude in meters from GPS
- GPS.Dst:10; — distance from the starting point in meters
- DS.Temp:[fc]=34.56; — temperature sensor on the board
How the output data looks:
Array
(
[N] => 647
[T] => 10m55s
[MP_Stage] => 0
[MP_Alt] => 49
[MP_VSpeed] => 0.0
[MP_AvgVSpeed] => 0.0
[Baro Press] => 1007.06
[Baro_Alt] => 50
[Baro_Temp] => 35.93
[GPS_Coord] => N56d43m23s,E37d55m68s
[GPS_Home] => N56d43m23s,E37d55m68s
[Dst] => 5
[GPS_HSpeed] => 0
[GPS_Course] => 357
[GPS_Time] => 11h17m40s
[GPS_Date] => 30.07.2018
[DS_Temp] => [fc] 33.56
[Volt] => 5.19, 0.00,0.00,0.00,0.00,0.00,0.00,0.00
)
What to do if the mobile signal drops? We have a second card for this case; two SIM cards can be inserted into the modem (one in the slot at a time):

It can automatically switch to a backup channel if the main one suddenly stops responding.
What will happen if both cellular networks become unavailable?
(The boy from is not just reading "Probability Theory")
For this case, we will have an independent GPS tracker that sends a signal about its location. Note that it does this not through a cellular network, the availability of which over long distances is not guaranteed, but through a satellite.

Yes, the GPS tracker is somewhat larger than the one implanted under James Bond's skin. Since our competition depends on the coordinates of the flying server, this part of the data received onboard will be the most important. But we will tell you more about this in the next post. Stay tuned to our blog!
We believe in the success of the entire project so much that we even announced a competition for those who might want to guess the ball's landing place. Details in our .
Source: habr.com
