在控制台窗口上检索数据-套接字编程网络嵌入式系统 [英] Retrieve data on a console window- Socket Programming Networked Embedded Systems

查看:64
本文介绍了在控制台窗口上检索数据-套接字编程网络嵌入式系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我解释发生了什么..我有一个带Web服务器的微控制器(Contiki OS),该芯片连接到同一板上通过SPI连接的以太网芯片.整个系统是一个控制器或协调器,可从其他无线传感器读取数据.在这种情况下,它的温度.现在,您只需进入Web浏览器,然后输入分配的地址即可显示网页,并显示该无线传感器的温度读数.所有这些都运行良好.

我想要的是我需要这些数据直接从我的计算机上通过同一局域网(通过终端窗口或其他Web服务器或其他任何东西)发送给我.我的想法是绕过芯片上现有的Web服务器.

我想到的一件事是,我们在该板上已经有一个以太网节点.那么我们如何创建一个套接字并获取该数据呢?关于数据,数据经过处理后已经存储在变量中,然后再显示在网页上.

可以说,我们正在谈论制造插座,以便服务器端可以是我的计算机,而客户端是电路板.它必须自行初始化并形成一个套接字,或者如果您可以从计算机中推送命令并调用诸如GET之类的命令,那么我会在窗口中看到该变量.


告诉我,这可能是我在说什么,我因太多事情而迷失了..给我一些概述.对于其他任何事情,您需要更好地了解它.让我知道

Let me explain what is happening .. I have a micro controller with web server on it ( Contiki OS ) this chip is connected to an Ethernet chip on the same board which is connected via SPI. This entire system is a controller or coordinator which reads data from other wireless sensors. In this case its temperature. Right now you just go to you web browser and type that assigned address a web page shows up and shows the temperature reading from that wireless sensor. All of this is working nicely.

What I want is that I need that data to come out directly to me, on my computer on the same LAN ( Via terminal window or maybe another web-server or anything . The idea is to bypass the existing web sever on the chip..

One thing that came to my mind was that that we already have an Ethernet node on that Board. So how about we could create a socket and get that data. About the data it gets processed and already gets stored in a variable before it shows on the web page.

Lets say we are talking about making socket so the server side can be my computer but the client is a circuit board. It has to initialize it self and form a socket or If you could push a command from my computer and invoke it something like GET and I see that variable on my window.


Tell me is that possible what I am talking about, I jus get so lost with so many thing .. give me some outline to go around it. For anything else you need to understand it better jus let me know

推荐答案

您将需要计算机上的套接字服务器应用程序和板上的套接字客户端应用程序你想要什么.
我认为更好的方法是在板上运行套接字服务器应用程序,以便计算机上的套接字客户端可以连接到该套接字服务器并获取所需的数据.
You will need a socket server application on the computer and a socket client application on the board to do what you want.
I think a better way would be to have a socket server application running on the board so that a socket client on the computer can connect to it and get the required data.


_Superman_ on解决方案1 ,有正确的想法.

您不希望使用经过硬编码的硬件来查找特定的计算机.配置计算机以查找硬件更加容易.

我怀疑该芯片上的Web服务器会产生大量开销.

为什么不只是使用套接字连接到它,然后发出HTTP命令来获取数据呢?这比重写两端要容易得多.

每次您要求时,芯片上的Web服务器都可能获得硬件价值.
_Superman_ on Solution 1, has the right idea.

You don''t want your hardware, hard coded to find a specific computer. It''s easier to configure the computer to find the hardware.

I doubt the web server on that chip is incurring much overhead.

Why not just connect to it with a socket, and issue the HTTP commands to get the data? This should be an easier task than rewriting both ends.

And the web server on the chip is likely getting the hardware value, every time you ask for it.


这篇关于在控制台窗口上检索数据-套接字编程网络嵌入式系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆