I am hoping to do something very simple, I expected it to be very simple.
The goal is a web app on my house network to serve out the details of a weather station connected to the computer via an RS232 serial port.
in a desktop system this all works perfectly, no issue with the hardware to worry about.
I have messed about with this for many hours now and the solution that I expect to be so simple does not appear to be so forthcoming.
Yes I have searched the forum, some ideas have come up but none appear to resolve what appears to me to be an issue that must have been needed many many times previously.
all I wish to achieve is to have a stand alone web app on my computer that has a serial port connection to the weather station.
that GLOBAL serial connection collects data and loads an APP property with the data (a string) which each instance of the web app will read and display .
what seems utterly impossible is to have a serial port in the project, that serial port is initiated and connects to the hardware, it then downloads the data when the DataAvailable event fires, that data is loaded into the APP string that all sessions can view.
I can add the serial port to the MAIN window of the web app, it is opened up and the data is readable no problem, but obviously that connection is only available in the session that first runs, its not globally available, any subsequent session can not open the port (obviously) so show no data.
I simply need to be able to set the properties of a serial class and have the DataAvailable event accessible in a global method or event.
I have tried modules, classes APP level properties, addhandler, I can instantiate an instance of the serial port.
what I can not do is simply have a serial port instance that I can open up and sit waiting for the DatAvatlble event to fire.
Any ideas how to get a serial port initialised as if it were a global APP level control?