owntracks / gw

Java MIDlet Project that includes Paho library to send MQTT position messages with Choral Greenwich hardware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

External trigger to upgrade

jpmens opened this issue · comments

New configuration parameter:

$set dnsTXT customer.example.com

Every startTime % 3 hours, device will query the DNS at the domain configured as dnsTXT. If the current Midlet version is different from that in the TXT record, an $upgrade will be performed.

If the setting is not configured, this will not happen.

The value of the DNS txt record (0.7.95) must be greater than the currently installed Midlet version

Pls note: very low cost plans (Vodafone Global is a notable example) sometimes do not allow connections outside specified hosts (IP lists) thus not allowing generic DNS queries. In this situation you will usually go with numeric IPs only (a private DHCP+DNS server could work but never tested/seen).

In that case a private (public, on the Internet actually?!?) DHCP server would certainly not work. ;)

Just a trick suggested by Voda in case of legacy applications not easy to be re-configured

Ops sorry "DHCP" is misplaced here obviously

  • There is no accessible DNS (other than the name resolver) in JavaME.
  • dnsjava.org implements a complete dns package, but depends on java.net and others which are not available in JavaME

An alternative would be an http(s)://customer.example.org/gw-version request

DNS would have been ideal because it's so lightweight, but yes, HTTP sounds good enough. I don't think HTTPS is required, as we're not doing anything secret.

So,

$set versionURI=http://cust.example.com/version

Can you POST the current Midlet version to that? I would then return text/plain with a "1" if $upgrade should be initiated, "0" if not.

Also, please try to set the HTTP User-Agent to GW/<IMEI>.

curl -X POST --user-agent "XXX/12345678901234" -d 0.1.2 http://....

Documented in OTAP.