I want to send a text file from my Raspberry Pi (Raspbian Jessie) to my PC (Windows) via GSM, this file contains about twenty parameters of a vehicle (ex: level = 20 L).
After that I want to display these parameters in a table.
Questions:
What should be created to display this table (a software or a server or a simple web page)?
Is is it necessary to create a data base to be able to send the parameters of several vehicles instead of one?
Is it necessary to establish a communication protocol between the Pi and the PC (I need some explanation for this part)?
-
Welcome to Raspberry Pi :-) But your question is too broad. Such questions are flagged and may be closed. This site isn't made for brainstorming and discuss general issues. It is made to do one specific question that can be answered detailed. Please take the short Tour and visit the Help Center to get an idea how things work here.Ingo– Ingo2019年03月28日 21:01:00 +00:00Commented Mar 28, 2019 at 21:01
1 Answer 1
Seems like an IoT question, but anyway.
You should define your project better. Usually then we start planing a project, we first list what we expect from the system.
I guess that you want your system to:
- Set up a server to gather data (you need a web server)
- Support multiple clients (clients need an ID)
- Save data from each client (you need a database on the server)
Since you mentioned GSM, I guess each client (each Raspberry Pi) will have a configured and working GSM module to provide an internet connection. Additional each client should have a unique ID in order to let the server know which client's the data are. You may combine the ID with a password, so you can configure each client with a username-password pair.
Your server (your PC) should be online when a client try to send their data and accessible from outside your network. This means that your PC should be always online, and have a public static IP or a DDNS and update his public IP or a DDNS on your local modem/rooter and a port forwarding to your PC on the local network. Then you should set up any web-server and define a simple API for the data submission and the data display. For additional security you should be able to configure a SSL certification on the web-server.
For example you can set up an Apache web server with an SQL database and a static IP. You then create 2 php files, submit.php
and view.php
.
The submit.php
would take the username and the password, validates them and then save the 20 parameters and the username on the SQL (maybe add a timestamp too, if you want to have history data).
The view.php
could have a simple admin login system and then show the data on a table as you like.
Then your clients could just make a HTTPS POST request to the server (at an interval, for example every 1 hour), example with curl:
curl -d "username=<username-here>&password=<password-here>&level=<value>&other=<value>" https://xxx.xxx.xxx.xxx/submit.php
In the same way you can setup a node.js server. If you don't care to save the data between server shut downs, in node.js you can just save each client's data on a variable.
The way you send the data (in a file or by just posting each parameter) is irrelevant. You may want to minimize the data usage due to GSM internet costs (for example don't sent unchanged variables).
-
thank you very much, that's what I was looking for as an explanation.Hi Cham– Hi Cham2019年03月31日 15:26:46 +00:00Commented Mar 31, 2019 at 15:26
-
@HiCham you may select it as accepted answer if this is what you were looking for.GramThanos– GramThanos2019年03月31日 18:00:07 +00:00Commented Mar 31, 2019 at 18:00