简体   繁体   English

如何通过TCP将数据(来自PC上的应用程序的CAN总线消息)通过TCP接收到Raspberry Pi上运行的Web服务器中?

[英]How to receive data (CAN bus messages from an application on PC) via TCP into a Web Server running on Raspberry Pi?

I want to receive data into a local web server that I have created using Raspberry Pi. 我想将数据接收到使用Raspberry Pi创建的本地Web服务器中。 It is not connected to the internet. 它没有连接到互联网。 I want to know if it is possible to receive data from an application on a Windows PC that sends via TCP protocol. 我想知道是否可以从Windows PC上通过TCP协议发送的应用程序接收数据。 The web server is an Apache server. Web服务器是Apache服务器。 I can specify the web server address and port number in the application that sends the data. 我可以在发送数据的应用程序中指定Web服务器地址和端口号。

I am a newbee to this and I just know what tcp, http etc means. 我是一个新手,我只知道tcp,http等是什么意思。 I do not know them in detail so I am finding it hard to understand related articles on the internet. 我不了解它们的详细信息,因此我很难理解互联网上的相关文章。 Can someone please help me with some code snippets on how to set the web server in raspberry pi so that I can receive the data? 有人可以帮我提供一些代码片段,介绍如何在树莓派中设置Web服务器,以便我可以接收数据吗? Either display it on the web server page or extract the data somewhere using Python or C#. 可以将其显示在Web服务器页面上,也可以使用Python或C#将数据提取到某处。 I am also open to using a Raspberry Pi with Windows IoT image instead of Jessie to do the same. 我也愿意将Raspberry Pi与Windows IoT映像一起使用,而不是Jessie。

With Windows IoT you can start with Hello blinky sample that create a simple Web Server in Python. 使用Windows IoT,您可以从Hello Helloy样本开始, 样本使用Python创建一个简单的Web服务器。

Also, restup create a Web server in C# you can reference. 另外, 可以使用C# 重新创建一个Web服务器,以供参考。 This is the tutorial help you set up the code lines. 这是本教程的帮助您设置代码行。 I test TCP packets receiving on Raspberry Pi 3 with this web server, it works. 我使用此Web服务器测试了在Raspberry Pi 3上接收的TCP数据包,它可以工作。

Hope it is helpful for you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM