Skip to content

sony791210/arudino_3g_raspberry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

arudino_3g_raspberry

Introduce

1.Use ardino to collect data ,then send data by SIM360(3g) http.
2.raspberry to get data ,input it to database or send it to ur phone by Line.

簡單說明利用ardino收集資,透過3g模組將資料傳回中心,利用raspberry接收資料,傳入DB中或用line傳入

machine

A-1. Arudino
A-2. SIM5360
A-3. battery

image

B-1. Raspberry pi
B-2. Router

First Arduino

準備 SIM5360模組板
將Aruino 程式放入,一共有4組code (A1_Setup,A2_Loop,SIM5360_Lib,X56360_test),其資料夾名稱為X5360_test
If arduino can't sent data ,use the battery for SIM module
And u need the antenna to sent
If all fail , to check the delay time use slowly
如果跑不動記得用電池驅動SIM模組
記得要裝天線
如果真的還跑不動,檢查延遲時間增加多一點,看看是否能跑

x5630_test

//arduino RXpin 2 compare SIM TX
//arduino Txpin 3 compare SIM RX

//IP is ur IP or DDNS ;
String uploadServer = "IP" ;

//test.php?aid=
//在raspberry裡面有test.php的在接收資料,用aid=??在接收
String uploadPage = "/dbtest.php?aid=" ;

A2_Loop

//read data from Serial
u can input any data to test send

SIM5360_Lib

use 80 port to send information

raspberry

follow
https://howtoraspberrypi.com/how-to-install-web-server-raspberry-pi-lamp/
u need to install lamp
linux
apache
mysql
php

star with raspberry pi

apache2

//install apache2
sudo apt install apache2
//to change user ,pi is user name u can change
sudo chown -R pi:www-data /var/www/html/
sudo chmod -R 770 /var/www/html

php

//install php
sudo apt install php php-mbstring

Mysql

//install mysql
sudo apt install mysql-server php-mysql
// into mysql
sudo mysql --user=root
//then very imporant
DROP USER 'root'@'localhost';
CREATE USER 'root'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON . TO 'root'@'localhost';

phpmyadmin

//install phpmyadmin to look data
sudo apt install phpmyadmin
//link the file to www
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin

how to get data

//in raspberry /var/www/html/
create file name

Router 路由器

To check ur router ,tcp 80 port is open for ur raspberry
or ur can use DMZ ,but it is't a good idea
確認你的80port對應你的raspberry
如果不會用的話,可以用DMZ去raspberry,但是不建議使用

About

Just test to send message

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors