Author Topic: TX and Rx data from web interface to COM1 on EVb9s12ne64  (Read 17372 times)

Offline Eddie

  • Newbie
  • *
  • Posts: 1
    • View Profile
TX and Rx data from web interface to COM1 on EVb9s12ne64
« on: August 04, 2008, 06:33:27 AM »
Hello I am new to utasker and have just set it up. I have project in which I want to do the following:

I want to access a serial port controlled device over the internet via VPN(since Utasker doesn´t currently support Dynamic DNS, I have to use a VPN router. but my intention is to write some code that will make utasker DynDNS compatible!!  8) , I will let you know...)

Since I am new at this, (i have already programed other S12X processors but none with an Ethernet port, and I am also a Web develper (PHP, MySQL) ) I am not quite sure where or how to begin. I haved looked at some documentation but haven´t found what I am looking for, so that´s why I am writing this.

I want to do the following with my project:

I have 8 serially controlled devices, I only will use 1 com port and a MUX to access the devices one at a time, so I want to have a we interface that will allow me to select which device I want to control, then after I selected the device I want to start configuring it via telnet, between the Internet and the previously selected device.

I also want to have a webpage that will show me the status of the devices via some realy boards connected to the GPIOs and the devices.

So my questions are:

-How do I access the serial port using telnet or something similar?
-How do I read the port status and show them on a webpage?
-How do I change the status of the ports using a webpage? (I have tried the demo webpages but they don´t act as I expect, maybe I am not doing something right.. ::)

BTW, I think Utasker is great and as soon as I get a clear understanding of I definetly will write some more code for it and send it to you so you can take a look at it...

Thanks

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: TX and Rx data from web interface to COM1 on EVb9s12ne64
« Reply #1 on: August 04, 2008, 09:34:39 PM »
Hi Eddie

-How do I access the serial port using telnet or something similar?

I am not 100% sure about the question but I am assuming that you want to enter commands or a file via a Telnet TCP connection and send the data received by the Telnet server to the UART of the NE64.
If you activate the TELNET demo (USE_TELNET in config.h) you can test a TELNET server with a simple menu.
All received data is passed to the TELNET listener (fnTELNETListener() in debug.c).
If you add the following code to the TCP_EVENT_DATA case of this listener call back it will pass all received data to the UART (also enable SERIAL_INTERFACE in config.h):

case TCP_EVENT_DATA:
    fnWrite( SerialPortID, ucIp_Data, usPortLen);  // copy received data to the serial port
    ....


-How do I read the port status and show them on a webpage?

-How do I change the status of the ports using a webpage?

The following thread gives a good introduction as to how this works:
http://www.utasker.com/forum/index.php?topic=94.0

(I have tried the demo webpages but they don´t act as I expect, maybe I am not doing something right..

On the I/O control page of the demo you should be able to control outputs (LED on the demo board) and also display the state of inputs. I have never heard of this not working - what is the problem that you are experiencing?
The control interface is in the web page HTML and the interface file webInterface.c and it uses the techniques as explained in the thread above. It is best to use the uTasker simulator and then you can test this and experiment easily with your own changes.

Good luck!

Regards

Mark