Creating Windows desktop gadgets & Ajax clients with the Ethernet module
Up to Direct line
Creating Windows desktop gadgets & Ajax clients with the Ethernet module
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
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
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
Re: Creating Windows desktop gadgets & Ajax clients with the Ethernet module
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
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
Re: Creating Windows desktop gadgets & Ajax clients with the Ethernet module
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 Module1Sub 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 resultConsole.WriteLine(r)NextConsole.ReadLine()End SubEnd ModuleAnd this uses 2 classes:Public Class PowerUnitPublic Property Name As StringPublic PlugList As List(Of Plug)End ClassPublic Class PlugPublic Property PlugId As IntegerPublic Property Name As StringPublic Property Status As StringEnd Class
did this work?