Document Actions

Creating Windows desktop gadgets & Ajax clients with the Ethernet module

Up to Direct line

Creating Windows desktop gadgets & Ajax clients with the Ethernet module

Posted by llecaroz at November 24. 2009

Hello,


I tried tonight to create an Ajax client to retrieve the rtMon.xml file from my Ethernet module, but it appears that the access is controled by the mini webserver on the Ethernet module & it refused to return the rtMon.xml when the referer does not contain an Url to the Ethernet module :(


So only pages downloaded from the Ethernet module can execute script with XMLHttpRequest() & so on download the rtMon.xml :(




When invoking the send method of XMLHttpRequest() from another page not stored on the Ethernet module (so for example stored on my ISP or home server storage), I cannot retrieve the Rtmon.xml as you check for the Referer & Origin fields ! even If I try to force them to the correct value as browsers informs you that I overwrote these fields :(




So, finally, I cannot create any windows desktop gadgets or ajax client on my site to display my aquarium parameters !




For sure opening this feature will makes lot of publicity for you as it will open lot of client applications around your system !




Maybe you could add new configuration options in the AquaTronica software on the Ethernet Module like "authorized referer & origins" (with a list box) & allow all referers if you don't want to specify any server in the previous list, with for sure, with the Ethernet module as default/forced referer !


?????




Thx in advance for your feedback,


Louis



Re: Creating Windows desktop gadgets & Ajax clients with the Ethernet module

Posted by ik2vov at November 25. 2009

Hi Louis,


Aquatronica is sensible to the security and to be shure not to give the possibility to hack the system and/or to kill the tank.


It can be dangerous creating another port that can have access to the module, but i'm ignorant in html and programming, I'll ask to the Aquatronica engineers and I'll tell you.



Bye



Gilberto Hassan

Re: Creating Windows desktop gadgets & Ajax clients with the Ethernet module

Posted by llecaroz at November 25. 2009

Ok, so let me apologize, it is an issuse based on the aquatronica... but on the "same origin policy" of Firefox !


just save the attached file below on your local disk. run it with IE, it will work without any error ! so good ! it means that I will be able to write Windows gadgets to display my AquaTronica parameters/sensor values and/or Power Unit status  on my desktop ! as there is not any "same origin policy" setting in IE




run the attached file now in firefox : it will not work due to the "same origin policy" !  os it is a browser related !




I have finally to say bye bye to my idea of displaying my aquarium parameters on my blog but I will certainly write windows gadgets to monitor my aquarium ;)




Louis



Attachments

Re: Creating Windows desktop gadgets & Ajax clients with the Ethernet module

Posted by llecaroz at November 25. 2009


arg ! time to go to bed ! you should read : "Ok, so let me apologize, it is not an issuse based on the aquatronica... but on the "same origin policy" of Firefox !"

instead of "Ok, so let me apologize, it is an issuse based on the aquatronica... but on the "same origin policy" of Firefox !"

So, it is due to firefox allowing to execute XMLHttpRequest for data stored on the same server from the one on which was download the html script page :(


really feel that having windows gadget will be the best way.

about security, for sure, I understand your concern.... about this, what do you think about the actual password security which does not have associated usernampe ? & what about ssl certificates to certify that the user is really a user authorized to access in change mode ?



Re: Creating Windows desktop gadgets & Ajax clients with the Ethernet module

Posted by byronm at December 30. 2009

messing about with visual studio and linq


plan was to pull the status into query with a service everyminute...and the then check the db..see if the values had changed and log to a db with timestamp..anyways go cut a long story short...reading xml with linq



Module Module1



    Sub Main()

        Dim doc = XDocument.Load("http://ethernetip/rtMon.xml")



        Dim result = From x In doc.Descendants("powerUnit") _

            Select New PowerUnit With { _

            .Name = x.<name>.Value, _

            .PlugList = (From y In x.Descendants("plugList").Descendants("plug") _

                        Select New Plug With {

                            .PlugId = y.@id, _

                            .Name = y.<name>.Value, _

                            .Status = y.<status>.Value}).ToList _

                        }



        For Each r In result

            Console.WriteLine(r)

        Next



        Console.ReadLine()

    End Sub



End Module





And this uses 2 classes:




Public Class PowerUnit



    Public Property Name As String





    Public PlugList As List(Of Plug)







End Class





Public Class Plug



    Public Property PlugId As Integer

    Public Property Name As String

    Public Property Status As String

End Class



Re: Creating Windows desktop gadgets & Ajax clients with the Ethernet module

Posted by yznhmr at January 13. 2010

byronm:


messing about with visual studio and linq



plan was to pull the status into query with a service everyminute...and the then check the db..see if the values had changed and log to a db with timestamp..anyways go cut a long story short...reading xml with linq





Module Module1





    Sub Main()


        Dim doc = XDocument.Load("http://ethernetip/rtMon.xml")





        Dim result = From x In doc.Descendants("powerUnit") _


            Select New PowerUnit With { _


            .Name = x.<name>.Value, _


            .PlugList = (From y In x.Descendants("plugList").Descendants("plug") _


                        Select New Plug With {


                            .PlugId = y.@id, _


                            .Name = y.<name>.Value, _


                            .Status = y.<status>.Value}).ToList _


                        }





        For Each r In result


            Console.WriteLine(r)


        Next





        Console.ReadLine()


    End Sub





End Module








And this uses 2 classes:







Public Class PowerUnit





    Public Property Name As String








    Public PlugList As List(Of Plug)











End Class








Public Class Plug





    Public Property PlugId As Integer


    Public Property Name As String


    Public Property Status As String


End Class







did this work?

['Rich document', 'Page', 'DistributorsFolder', 'Smart Folder', 'Folder', 'Photo Album', 'File', 'Image', 'PloneFormMailer', 'Form Mailer']
Log in


Forgot your password?
New user?
 

Copyright © 2006-2012 A.E.B. S.p.A. a socio unico - Sede Legale: via dell'Industria 20 -42025 Cavriago (RE) - Italy
CAP.SOC. € 2.800.000 i.v. - REG.IMPR.RE /C.F./P.IVA/VAT ID: IT01160540355 - R.E.A. RE N.163334