Uw opmerkingen

Мож кому понадобится

  •  Через проверку смены SSID Wi-Fi для пользовательской панели
  • IR.GetVariable("System.Net.SSID")
    ...
    IR.SetInterval(10000, checker);
    
  • Через какой-нибудь внешний HTTP-запрос (картинки, HTTP HEAD запрос SendEx)
    http://support.iridiummobile.net/topics/13547-get-json-with-http-request-and-parse/#comment-80900
  • Через доступность какого-нибудь TCP-порта (80) открыть-закрыть SYN-ACK (AV & Custom Systems (TCP)

ICMP не реализуем в данный момент на i3 Pro, т.к. невозможно сменить поменять поле Protocol = 1 (ICMP) в заголовке IP.
http://www.support.iridiummobile.net/topics/13153-websocket/#comment-78447 (внешний вызов ping через Popen на Win)

What is "Subscribe command"? It is not part of SSDP protocol.


again: UPnP already realized in i3 Pro!

http://dev.iridiummobile.net/Drivers_API/en#.Subscribe (eventSubURL)

IR.GetDevice("Sonos").Subscribe("urn:schemas-upnp-org:service:AVTransport:1");

sample: http://support.iridiummobile.net/topics/12214-sonos-not-working-with-latest-sonos-firmware/#comment-77802

Useful idea!


.. many hours of work were lost ..

For working with large amounts of data HTTP, SMB, NFS are best suited .. routers and NVR (Network Video Recorder)

Most modern cameras support writing to the network drive (including the creation of screenshots)


you can periodically copy file

for windows server command

http://support.iridiummobile.net/topics/9767-irexecute-zapustit-prilozhenie-s-klyuchom/?lang=en#comment-67451

copy c:\folder\file.img \\dest-machine\destfolder /Z /Y

wget
http://support.iridiummobile.net/topics/11245-file-operations-via-js-on-iridiumserver/


expanded idea:

Please add the additional parameter DATA to IR.CreateImage function (as Base64, maybe)

Александр, Вы решили свой вопрос?

"Joining" is not the functionality of UDP, it is implemented in higher-level protocols.

SSDP already in UPNP  http://dev.iridiummobile.net/Drivers_API/en#.Subscribe

But if you want to go a long way:

var inUDP = IR.GetDevice("In_UDP");
var outUDP = IR.GetDevice("Out_UDP");
IR.AddListener(IR.EVENT_RECEIVE_DATA, inUDP, function(data)
{
   IR.Log("GLOBAL IN DATA (1900 port):" + data)
});
IR.AddListener(IR.EVENT_RECEIVE_DATA, outUDP, function(data)
{
   IR.Log("UNICAST DATA (12345 port):" + data)
});
      
function snd() {
   outUDP.Send(["M-SEARCH * HTTP/1.1\r\n"+
   "HOST: 239.255.255.250:1900\r\n"+
   "MAN: \"ssdp:discover\"\r\n"+
   "MX: 5\r\n"+
   "ST: ssdp:all\r\n"]);
}




Check network settings with https://github.com/coherence-project/UPnP-Inspector

IR.AddListener(IR.EVENT_START,0,function()
{
   pWther.request(function(resp) {
      try {
         if (resp.main.temp !== undefined) {
            IR.Log("TEMPERATURE is " + resp.main.temp);
            //IR.Log(typeof resp.main.temp)
            //IR.GetDevice("HDL-BUS Pro Network (UDP)").Set("HVAC:temp", resp.main.temp); //type conversion warring!
         }
      } catch (e) {
         IR.Log("Something is wrong \n" + e); // error handler 
      } 
   });
});
var pWther  = {};
pWther.dev = IR.CreateDevice(IR.DEVICE_CUSTOM_HTTP_TCP, "pWeather", "api.openweathermap.org", 80);
pWther.request = function(in_callback){
      pWther.dev.SetParameters({ConnectWaitTimeMax: 5000, ReceiveWaitTimeMax: 10000});
      pWther.dev.Connect(); // Must be
        pWther.dev.SendEx({
            Type: "GET",
            Url: "/data/2.5/weather?q=Moscow,Russia&units=metric&appid=072808c7b054b6b21a549dbbb3c936c0",
            /*Headers: {
            "Content-Type": "application/json"
            },*/
            cbReceiveText: function(text, code, headers) {
            if (code != 200) return; //parse other error codes!
                var resp = JSON.Parse(text);
            //IR.Log(text); 
            pWther.dev.Disconnect();            
            in_callback(resp);            
            },
        });
   }

http://support.iridiummobile.net/topics/233-izmeneniya-v-drajvere-http-sendex/?lang=en

IR.GetDevice("AV & Custom Systems (HTTP)")..SendEx(
{
Type: "Type of forming a request", The following types are possible GET, POST, PUT.
Url: "Link to the object that is requested",
For POST and PUT requests Data field is also available.
Data: [""],
The next block is Header. it is what your client must send to the requested server.
Headers: {
"Content-Type": "application/json",
"Accept": "application/xml;",
"Accept-Language": "de,en-us;q=0.7,en;q=0.3",
"User-Agent" : "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"
}

http://dev.iridiummobile.net/Drivers_API#.SendEx