5d
来自Jack's Lab
(版本间的差异)
(→Setup RTC) |
|||
第73行: | 第73行: | ||
<br><br> | <br><br> | ||
+ | == Update APP == | ||
+ | |||
+ | Your PC: | ||
+ | |||
+ | <source lang=bash> | ||
+ | $ sudo apt-get install nfs-kernel-server | ||
+ | |||
+ | Config the nfs directory: | ||
+ | |||
+ | $ sudo mkdir -p /tftpboot/rootfs | ||
+ | $ cat /etc/exports | ||
+ | /work/armv9 *(async,rw,insecure,insecure_locks,no_root_squash) | ||
+ | |||
+ | $ sudo /etc/init.d/nfs-kernel-server restart | ||
+ | </source> | ||
+ | |||
+ | In collector: | ||
+ | |||
+ | <source lang=bash> | ||
+ | [root@mcuzone /app]#mount -o port=2049,nolock,proto=tcp -t nfs 192.168.1.72:/wor | ||
+ | k/5d/src ./x | ||
+ | [root@mcuzone /app]#ls x | ||
+ | bin db include nfsroot src ubi.in | ||
+ | chmod.sh dbtest.c lib sh src-x | ||
+ | [root@mcuzone /app]#ls x/src-x | ||
+ | Makefile main.c sysinit.c | ||
+ | bsp.c meter_table.c uart_gprs.c | ||
+ | commap.c notes.md uart_mbus_down485.c | ||
+ | db.c queue.c uart_set.c | ||
+ | elect.c read_heatmeter.c water.c | ||
+ | gather_V1 readallmeters.c xml.c | ||
+ | gprs.c rs485up.c | ||
+ | include sysfuctions.c | ||
+ | </source> | ||
+ | |||
+ | Copy the gather_V1 into collector: | ||
+ | |||
+ | <source lang=bash> | ||
+ | [root@mcuzone /app]#cp x/src-x/gather_V1 . | ||
+ | [root@mcuzone /app]#ls | ||
+ | 1runapp.sh buff2.xml gather_V0 gatherdb.db rcS x | ||
+ | buff1.xml buff3.xml gather_V1 log.txt runapp.sh | ||
+ | </source> | ||
<br><br> | <br><br> | ||
+ | |||
+ | |||
<br><br> | <br><br> | ||
<br><br> | <br><br> |
2017年1月5日 (四) 21:02的版本
目录 |
1 First Tuning
1.1 Disable GPRS
net_type 网络类型:
- 0 - GPRS
- 1 - RS485 等
[root@mcuzone root]#cd /app [root@mcuzone /app]#sqlite3 ./gatherdb.db SQLite version 3.10.0 2016-01-06 11:01:07 Enter ".help" for usage hints. sqlite> select * from t_base_define; sqlite> .head on sqlite> .mode column sqlite> select * from t_base_define; f_id f_config_name f_config_value ---------- -------------- -------------- 1 primary_server 122.5.18.174 2 primary_dns 219.146.0.130 3 primary_port 9011 4 second_server 219.146.0.130 5 second_dns 219.146.0.130 6 second_port 9027 7 gateway_id 37060001 8 net_type 0 9 md5_key 863CA654 10 aes_key d41d8cd98f00b2 11 collect_mode 0 12 collect_cycle 15 13 report_mode 0 14 beat_cycle 2 15 svr_num 0001 16 appmd5 28a011de19210e sqlite> update t_base_define set f_config_value='1' where f_config_name='net_type'; sqlite> sqlite> select * from t_base_define; f_id f_config_name f_config_value ---------- -------------- -------------- 1 primary_server 122.5.18.174 2 primary_dns 219.146.0.130 3 primary_port 9011 4 second_server 219.146.0.130 5 second_dns 219.146.0.130 6 second_port 9027 7 gateway_id 37060001 8 net_type 15 9 md5_key 863CA654 10 aes_key d41d8cd98f00b2 11 collect_mode 0 12 collect_cycle 1 13 report_mode 0 14 beat_cycle 2 15 svr_num 0001 16 appmd5 28a011de19210e
2 Setup RTC
[root@mcuzone root]#date -s 2017.01.05-18:38:48 Thu Jan 5 18:38:48 CST 2017 [root@mcuzone root]#hwclock -w # write RTC to store the time [root@mcuzone root]#hwclock -r Thu Jan 5 18:38:56 2017 0.000000 seconds
3 Update APP
Your PC:
$ sudo apt-get install nfs-kernel-server Config the nfs directory: $ sudo mkdir -p /tftpboot/rootfs $ cat /etc/exports /work/armv9 *(async,rw,insecure,insecure_locks,no_root_squash) $ sudo /etc/init.d/nfs-kernel-server restart
In collector:
[root@mcuzone /app]#mount -o port=2049,nolock,proto=tcp -t nfs 192.168.1.72:/wor k/5d/src ./x [root@mcuzone /app]#ls x bin db include nfsroot src ubi.in chmod.sh dbtest.c lib sh src-x [root@mcuzone /app]#ls x/src-x Makefile main.c sysinit.c bsp.c meter_table.c uart_gprs.c commap.c notes.md uart_mbus_down485.c db.c queue.c uart_set.c elect.c read_heatmeter.c water.c gather_V1 readallmeters.c xml.c gprs.c rs485up.c include sysfuctions.c
Copy the gather_V1 into collector:
[root@mcuzone /app]#cp x/src-x/gather_V1 . [root@mcuzone /app]#ls 1runapp.sh buff2.xml gather_V0 gatherdb.db rcS x buff1.xml buff3.xml gather_V1 log.txt runapp.sh