Réception météo par SMS

Thinking that it might be of interest to other sailors in the whole world, so I decided to translate this information into English, this is a rough translation, so please excuse my poor English! :-)

Weather forecast via SMS - Version 2!

"Far away from civilization" (more than 25-30 nautical miles from the coast), it is rarely possible to be able to obtain weather forecasts by VHF, the only possibilities to obtain this information by "grib" file or others are, either from have a satellite connection, or be equipped with a shortwave (SSB) transmitter / receiver with the appropriate radio license.

An interesting alternative is to use the Garmin InReach to send an SMS weather forecast request to a land-based server for selected geographic locations, no matter where you are on our (still) beautiful planet!

As the number of characters for an SMS, is limited to 160 (encoded on 7 bits) and in order to make the most of the little space available, all the numeric values which are usually in base 10, are converted to base 64 using the following characters "0123456789", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and "& #", which considerably reduces the size of the data sent.

In order to further optimize the size, the latitude and longitude of the vessel (with 2 decimal places, which is more than sufficient) are multiplied by 100 in order to save the decimal point and coded on 2 x 3 characters in base 64 but then all the other geographical locations are “offsets” based on the coordinates of the boat and therefore coded on only 2 x 2 characters. The same method was used for other data when possible.

As the messages are encoded in base 64, they are therefore not understandable to the naked eye, so the following small applications can be used to encode and decode them:

  • "SMS encoding" which makes it possible to encode a request to be sent to the server and
  • "SMS decoder" which allows to decode the messages sent back by the "SMS server".

The "SMS encoding" application

As its name suggests, this application allows you to enter data for the weather request and encode the request text that you just need to copy / paste to send to the SMS server via InReach or via a cellphone if there is network. The definition of locations around the vessel can be done automatically with respect to its current location, heading (followed or desired), distance and angle, or, manually by defining the desired locations.

It is possible to modify the way in which the locations are calculated by modifying the “distance factor” which makes it possible to obtain a decreasing distance from the heading towards the rear of the boat (at 180°). To better understand, below is a graphic representation showing the boat (following a heading of 135°) and the end of the lines representing the locations calculated with an angle of 30° and a distance N.

Effects of the distance factor
Effects of the distance factor

On the left with a factor <0.0> indicating that all locations around the boat are at equal distances, in the middle with a factor of <0.5> (in my opinion the ideal configuration) and on the right with a factor of < 1.0>.

Then simply copy / paste the text to the EarthMate application which is connected to InReach via Bluetooth to send the request to the server number. The application also generates a Map Source file (.ms) so that you can easily view the calculated locations in Guru Maps.

Here is the result of the calculations of locations at 40 and 80 nautical miles (in the direction of the given heading (here 315°) with a diminished distance towards the rear) separated by an angle of 45°, with respect to the current location being [-56.69, -67.61]:

Results for a distance of 40 NM
  • New location [-56.22, -68.46] for a heading of 315° and a distance of 40 NM
  • New location [-56.11, -67.61] for a heading of 0° and a distance of 35 NM
  • New location [-56.34, -66.97] for a heading of 45° and a distance of 30 NM
  • New location [-56.69, -66.85] for a heading of 90° and a distance of 25 NM
  • New location [-56.92, -67.18] for a heading of 135° and a distance of 20 NM
  • New location [-57.11, -67.61] for a heading of 180° and a distance of 25 NM
  • New location [-57.04, -68.26] for a heading of 225° and a distance of 30 NM
  • New location [-56.69, -68.67] for a heading of 270° and a distance of 35 NM
Results for a distance of 80 NM
  • New location [-55.74, -69.28] for a heading of 315° and a distance of 80 NM
  • New location [-55.52, -67.61] for a heading of 0° and a distance of 70 NM
  • New location [-55.98, -66.35] for a heading of 45° and a distance of 60 NM
  • New location [-56.68, -66.09] for a heading of 90° and a distance of 50 NM
  • New location [-57.16, -66.74] for a heading of 135° and a distance of 40 NM
  • New location [-57.52, -67.61] for a heading of 180° and a distance of 50 NM
  • New location [-57.39, -68.92] for a heading of 225° and a distance of 60 NM
  • New location [-56.67, -69.73] for a heading of 270° and a distance of 70 NM

The "SMS Server" application

This application running on shore, allows the user to obtain the weather information but the requester being possibly at thousands of kilometers does not have to care about it.
See a of the “SMS Server” app.

On the smartphone side (located on shore with an Internet connection), the SMS request is received, the application decodes it and transforms the data into 16 different requests (one per geographic location) sent to the stormglass.io website. Then, the application extracts the required data for each requested location and transforms it, in this case, into 6 messages of 160 characters or less for the last one, with the weather forecast of the requested times (in this example 12h and 18h) based on the present time. All dates and times data are in UTC.

In the event that the SMS arrives out of order, it does happen, each message is preceded by a 2-digit number, the first digit being the message number and the second the total number of messages.

Finally, the messages are sent back to the number that made the request (the Garmin InReach or a cellphone). It's simple and inexpensive!

This application must be installed on shore on an Android smartphone (with internet connection), it must be switched on 24 hours a day, 7 days a week and connected to the mains since it will have to react at any time to weather requests sent by SMS from one or more users. It would be better if someone could restart it if necessary.

In order for the application to obtain weather information from stormglass.io, all you have to do is register for free in order to receive an access key, this allows the "SMS Server" to execute 50 requests per day (one request per location independent of the desired number of hours with a maximum of 240), for more requests / day, you have to pay but in my opinion it is more than enough for one or two ships! the available weather forecasts come from different meteorological institutes around the world (Météo-France, DWD, NOAA, UK MetOffice ...), see sources and description of the API.

See a .

Technical description

Numbers in base 64

All values in the SMS are converted into base 64 (signed or unsigned).

Value range1 char2 chars3 chars4 chars
Signed-31...+31-2047...+2047-131071...+131071-8388607...8388607
Unsigned0...630...40950...2621430...16777215

Requested forecast values

There is the possibility to choose values, the more values requested, the more space is needed! The requested forecast value is coded on 3 chars, the relevant bit must be set for each requested value.

BitRequested forecast valueNumber of charsSigned
1Pressure (hPa)2no
2Visibility (NM)2no
3Cloud cover (1/8)1no
4Air temperature (°C)2yes
5Water temperature (°C)2yes
6Wind direction (° coming from)2no
7Wind speed (kn)2no
8Wind gust (kn)1no
9Current direction (° coming from)2no
10Current speed (kn)2no
11Swell direction (° coming from)2no
12Wave height (m)2no
13Wave period (s)2no
14Tide (m) relative to Mean Sea Level (MSL) - Not yet implemented!2no

Forecast request coding

Format of the SMS content sent from « SMS Coding » to the « SMS Server ». The "#" char represents one char coded into base 64.

SignedCoded valueMeaning
FRQSTThis indicates that the received SMS is a Weather forecast request which will be taken into account by the app « SMS Server »
no##SMS size, the server will check if the received SMS has the right size, this is just to avoid errors!
no##...Forecast time(s), one of more time in range 0...250 hours
?A separator
no###An integer containing which values are requested, see Requested forecast values above
no##Vessel course (heading)
yes###Vessel latitude
yes###Vessel longitude
yes####...One or more locations (latitude and longitude offsets in degres based on the ship location)

Forecast request decoding

Format of the SMS content sent from the « SMS Server » to the requester (« SMS decode »). The "#" char represents one char coded into base 64.

The full weather forecast information is in the following format but if the data is longer than 160 chars then the data is divided into packets of 158 chars and numbered with 2 chars (SMS number and Total number of SMS) at the beginning of each SMS.

Header for each received SMS

SignedCoded valueMeaning
no#SMS number
no#Total number of SMS

Data format without information of SMS number and Total number of SMS

SignedCoded valueMeaning
Header
no###UTC dateTime of request YYMM (Year Month, base time)
no###UTC dateTime of request DDHH (Day Hour, base time)
no#Number of forecast times
no###Requested values, see Requested forecast values above
no##Vessel course (heading)
yes###Vessel latitude
yes###Vessel longitude
For each location
yes##Latitude (offset in degres from the ship location)
yes##longitude (offset in degres from the ship location)
For each time forecast
no##Forecast time (offset in hours from the base time given in the header)
no##Pressure (hPa)
no#Visibility (NM)
no#Cloud cover (1/8)
yes##Air temperature (°C)
yes##Water temperature (°C)
no##Wind direction (° coming from)
no##Wind speed (kn)
no#Wind gust (kn) (offset based on wind speed)
no##Current direction (° coming from)
no##Current speed (kn)
no##Swell direction (° coming from)
no##Wave height (m)
no##Wave period (s)
no##Tide (m) relative to Mean Sea Level (MSL) MAYBE!
...and so on for each time forecast
...and so on for each location

The "SMS decoding" application

This application allows you to decode and view the information received from the server. To do this, simply copy / paste the messages received (separated by [ENTER]) in the field provided for this purpose and press [DECODE]. All the weather information is then displayed for each location and each time interval.

Text messages

In this example, the server sent 6 SMS to encode all the information concerning these 16 locations. At the start of the first SMS, the number of forecast hours is encoded in two characters with the following information for each location and for each requested time:

  • Timestamp (YYYY-MM-DD HH:mm UTC),
  • Atmospheric pressure in hPa,
  • Visibility in nautical miles,
  • Cloud cover in 1/8 (0 = clear sky, 8 = overcast sky),
  • Air temperature in degrees Celsius,
  • Direction (wind blowing from in °) and wind speed with gusts in kt,
  • Direction (current coming from in °) and speed of the sea current in kt,
  • Direction of waves and swell in degrees (coming from in °),
  • Wave height (measured between crest and trough) in meters,
  • Wave period (number of seconds separating the passage of 2 successive peaks) in seconds.

The example showed how to get a weather forecast for 16 locations at 2 different time intervals but nothing prevents to make a request for more (or less) points with more or less information, other time intervals ( maximum forecast at 240h) and other angles multiple of 360 (10°, 15°, 20°, 30°, 40°, 45° ...).

On a sailboat, obtaining good weather information is essential but good visualization of this data considerably enriches the information received, in particular with regard to winds and currents.

Viewing KML files under Google Earth is good if you have a computer (Mac or PC) with an internet connection. After looking for other possibilities, I found the free application Guru Maps (for Android and IOS) which allows among other things to visualize the whole world with offline maps (ie working without connection internet) and insert vector overlays with Map Source files (.ms) based on ".geojson" and ".mapcss" files.

So the application exports these files and here is the result in the following screenshot:

Visualization in Guru Maps of the location of the vessel and the locations calculated with the application
In blue, pressure, direction and speed of the current, direction of the swell, height and period of the waves.
In black, time stamp, visibility, cloud cover, air and water temperature, wind direction and speed (gusts).

All this may seem complicated but it really is not because after entering the desired parameters in the “SMS encoding” app, which only takes a few seconds, all you have to do is copy / paste the coded request to the app EarthMate for InReach to send to the server. After a few minutes, the SMS (s) containing the requested forecasts arrive on EarthMate and you just have to copy / paste them to the “SMS decoding” app to read the content.

With the Garmin InReach which works worldwide (because using the Iridium system) for a fairly reasonable price, around 350 € for the InReach mini and an acceptable monthly fee of 59.99 € with an annual contract, it is still expensive but the advantage is to benefit from unlimited two-way text messaging (SMS) in order to be able to communicate with relatives, to be able to locate the Inreach at any time on the EXPLORE website as well as additional security with SOS coverage from GEOS, all of this can be used all over the world!

The few tests I have done with the InReach are positive and everything seems to be working perfectly. After having launched a request with 8 locations and 2 hours of forecast, the first 2 SMSs arrived after approximately 5 minutes, the last SMS arrived approximately twenty minutes later, it is not very fast but largely sufficient, I guess this is due to the location of the satellites.

All this requires a few steps but it works and above all, it is "tailor-made" and it does not cost too much! It is obvious that the use of "grib" files is more comfortable and richer in information, but at a much higher cost.

I therefore intend to use this system to obtain the weather forecast. My departure is only scheduled for summer 2021 (delayed due to the pandemic and for other reasons).

All these applications run on Android, I also created these 2 applications ("SMS encoding" and "SMS decoding") for IOS but as I did not put them on the AppStore, I can only provide the source. just compile with Xcode.

Software design takes a lot of work, it starts with the general idea followed by design, programming and then the testing phase. So I did my best for the realization but it is in use that we almost always discover errors (bugs). So if you are using these few apps, please let me know about any issues.

For those who are interested, below is the source code of all these applications as well as the executables (only for Android). In the event of a problem (bug) or for more information, use "Contact" at the bottom of this page.

Apple allows you to create apps for OS-X and IOS with Xcode but unfortunately they also included a rather annoying limitation, unless you have a paid annual developer account, apps installed using an Apple ID expire at after seven days :-(

So that IOS users can still use this system, I have now created the equivalent of the 2 applications ("SMS encoding" and "SMS decoding") in HTML and JavaScript, it works perfectly and can be used with most Internet browsers, see Weather via SMS V2.2.


InReach Mini
InReach Mini

SMS encoding application
SMS encoding application

Choosing data for the query
Choosing data for the query

L'application « Serveur SMS » après la réception d'une requête
L'application « Serveur SMS » après la réception d'une requête

Display of data received on SMS decoding
Display of data received on "SMS decoding"

Details of the information displayed under Guru Maps
Details of the information displayed under "Guru Maps"

Implementation and use

First of all, you have to install the "SMS Server" application on an Android cellphone which must have an activated SIM card (in order to be able to receive and send SMS) and be somewhere on a terrestrial location with an internet connection, this device must stay on 24/24 and 7/7 therefore connected to the mains in order to be able to respond to requests. It is therefore necessary to install the “smsServer.apk” file available on Source code and executables for Android. When this application is launched for the first time, you will need to copy / paste the access key which you can obtain for free by registering on stormglass.io. Voilà, That's it for the server part!

To be able to send a weather request to your server, it is necessary to encode it using the "SMS encoding" application, for this, simply install the "sms-coding.apk" file available on Source code and executables for Android. Enter the desired parameters and select [AUTOMATIC POSITION CALCULATION] or [DATA ENCODING], copy the text (SMS content) starting with "FRQST". Then paste this text into the application EarthMate to send your request using the Garmin InReach or onto the SMS application if you have network and finally send your message to the server number.

If all goes well, after a few moments you should receive one or more SMS from the server in response to your request. In order to be able to decode this or these messages, you will have to install the application "SMS decoding" also available on Source code and executables for Android.

For IOS users, I programmed the same apps. Apple allows you to create apps for OS-X and IOS with Xcode but unfortunately they also includes a rather annoying limitation, unless you have a paid annual developer account, apps installed using an Apple ID expire after seven days :-(

So that IOS users can still use this system, I have now created the equivalent of the 2 applications ("SMS encoding" and "SMS decoding") in HTML and JavaScript, it works perfectly and can be used with most Internet browsers, see Weather via SMS V2.2.

If you use these applications and have any questions or possible improvements, please contact me using the Contact form.