搭建自有服务器对接华为云iot +温湿度传感器调试
抹去的是公网ip,简单说就是在公网上装一个centos,再开启ftp, 即可 对 自己的 终端设备进行 Fota 升级
宝塔是提供 面板 的 很简单上手的 工具 ,结合自由 app 后台管理系统 ,很方便实现
在单位,没有路由搭建SCP 传送怎么办?
试试网络桥接 ,把无线 和有 线桥接起来 ,开发板网线插到 电脑 网口 ,这样 {PC 和 开发板 可以 同时 上网 ,传送 文件
root@myir:~# ifconfig //是使用 此命令 查询 网络 配置 和 iPC 一样
eth0 Link encap:Ethernet HWaddr FC:69:47:33:A5:65
inet6 addr: fe80::fe69:47ff:fe33:a565/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:154 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16208 (15.8 KiB) TX bytes:8597 (8.3 KiB)
Interrupt:62 Base address:0x8000
目前是 没有 获取 到 地址的 状态 ,
root@myir:~# ifconfig
eth0 Link encap:Ethernet HWaddr FC:69:47:33:A5:65
inet addr:192.168.2.20 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::fe69:47ff:fe33:a565/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2977 errors:0 dropped:282 overruns:0 frame:0
TX packets:500 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:242942 (237.2 KiB) TX bytes:64873 (63.3 KiB)
Interrupt:62 Base address:0x8000
获取到 IP 192.168.2.20
ub@ubuntu:~/Downloads/SHT30$ make ARCH=arm
ub@ubuntu:~/Downloads/SHT30$ make ARCH=arm
arm-linux-gnueabihf-gcc -c -Iincludes -I. sources/main.c -o build_arm/main.o
arm-linux-gnueabihf-gcc build_arm/main.o -o build_arm/SHT30_demo
ub@ubuntu:~/Downloads/SHT30$ scp ^C
ub@ubuntu:~/Downloads/SHT30$ scp ./build_arm/SHT30_demo root@192.168.2.58:/home/root/
SHT30_demo 100% 8636 177.9KB/s 00:00
ub@ubuntu:~/Downloads/SHT30$
Xshell 过期 ,就 继续 使用 X term
root@myir:~# ls
SHT30_demo analogclock
root@myir:~# ./SHT30_demo 成功 获取温度 , 湿度 ,
open /dev/i2c-0 success !
set slave address to 0x44 success!
SHT30---->: 0x6c 0xf8 0x5b 0x95 0xf9 0xb1
temperature:29.491493 humidity:58.583961
SHT30---->: 0x6d 0x2 0xf6 0x95 0xe4 0xbe
temperature:29.518196 humidity:58.551918
SHT30---->: 0x6c 0xfd 0xae 0x95 0xdb 0x55
temperature:29.504845 humidity:58.538185
SHT30---->: 0x6c 0xf8 0x5b 0x95 0xe9 0xf2
temperature:29.491493 humidity:58.559547
SHT30---->: 0x6d 0x2 0xf6 0x95 0xec 0x7
temperature:29.518196 humidity:58.564125
SHT30---->: 0x6c 0xfd 0xae 0x95 0xbc 0x79
temperature:29.504845 humidity:58.490883
SHT30---->: 0x6d 0x8 0x2d 0x95 0x9f 0xac
temperature:29.534218 humidity:58.446632
SHT30---->: 0x6c 0xf8 0x5b 0x95 0xa2 0x25
temperature:29.491493 humidity:58.451210
SHT30---->: 0x6d 0xd 0xd8 0x95 0xb9 0x8c
temperature:29.547569 humidity:58.486305
此处的 sh文件 未找到 ,自己的编写的 报错
root@myir:~# ./ L610_usbdriver_pppd.sh
-sh: ./: Permission denied
root@myir:~# ./L610_usbdriver_pppd.sh
-sh: ./L610_usbdriver_pppd.sh: Permission denied
添加 下面 文件 权限 即可 解决 ,
root@myir:~# chmod +x L610_usbdriver_pppd.sh
root@myir:~# ./L610_usbdriver_pppd.sh
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 1782:4d10 Spreadtrum Communications Inc.
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
:1.0: GSM modem (1-port) converter detected
[ 1543.169755] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0
[ 1543.178105] option 1-1.1:1.1: GSM modem (1-port) converter detected
[ 1543.191207] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1
[ 1543.215508] option 1-1.1:1.2: GSM modem (1-port) converter detected
[ 1543.230934] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2
[ 1543.247295] option 1-1.1:1.3: GSM modem (1-port) converter detected
[ 1543.255879] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB3
[ 1543.279268] option 1-1.1:1.4: GSM modem (1-port) converter detected
[ 1543.300508] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB4
[ 1543.323867] option 1-1.1:1.5: GSM modem (1-port) converter detected
[ 1543.353590] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB5
[ 1543.366302] option 1-1.1:1.6: GSM modem (1-port) converter detected
[ 1543.379277] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB6
/dev/ttyUSB0 /dev/ttyUSB2 /dev/ttyUSB4 /dev/ttyUSB6
/dev/ttyUSB1 /dev/ttyUSB3 /dev/ttyUSB5
root@myir:~#
[11:20:50.154]发→◇AT+CGMR?
□
[11:20:50.158]收←◆AT+CGMR?
+CGMR: "16000.1000.00.05.01.12"
OK
[11:20:54.194]发→◇AT+CFUN=1
□
[11:20:54.198]收←◆AT+CFUN=1
OK
[11:20:57.427]发→◇AT+CGSN?
□
[11:20:57.432]收←◆AT+CGSN?
+CGSN: "861037050017664"
OK
[11:21:01.082]发→◇AT+CFSN?
□
[11:21:01.086]收←◆AT+CFSN?
+CFSN: "L619LU0AB7"
OK
[11:21:13.417]发→◇AT+CPIN?
□
[11:21:13.424]收←◆AT+CPIN?
+CPIN: READY
OK
[11:21:23.961]发→◇AT+CGDCONT=1,"IP","cmnet"
□
[11:21:23.969]收←◆AT+CGDCONT=1,"IP","cmnet"
OK
[11:21:35.194]发→◇AT+CSQ?
□
[11:21:35.197]收←◆AT+CSQ?
+CSQ: 28,99
OK
[11:21:50.154]发→◇AT+CEREG?
□
[11:21:50.158]收←◆AT+CEREG?
+CEREG: 0,1
OK
[11:22:00.577]发→◇AT+COPS?
□
[11:22:00.582]收←◆AT+COPS?
+COPS: 0,0,"CHINA MOBILE",7
OK
[11:22:50.922]发→◇AT+MIPCALL?
□
[11:22:50.927]收←◆AT+MIPCALL?
+MIPCALL: 0
OK
拨号脚本 有需要可以 联系 我
- 点赞
- 收藏
- 关注作者
评论(0)