我仔細研究過他這個圖了 也去電問了我當初幫我畫圖的設計師 通常圖紙有2個部分 part 1) site plan review-> approved 後可以依照site plan 中申請的項目再畫 part 2) Architectural drawing /CONSTRUCTION DRAWINGS part2 approved 後可能還需要有公聽會的程序 取得居民同意才能開工 現在問題來了 依我當初送件 1) 等了3個月 2) 等了6個多月 這個SELLER給的圖是part1 site plan 如果已經Approve 還需要去fire department 申請permit 也要去相關的public work 例如sewer, water ,...申請 will serve permit/letter 有了上述的permit 連同 part2 的圖送審 我猜SELLER 只有 site plan approve 想請你再問seller 1)是否只有 site plan approve? 2) 其他如 fire department 的permit 及 public work 等地PERMIT 有沒有? 3) Architectural drawing 是否已經畫好了? 我們買的價錢是否有包括這個圖? 他是否有跟設計師簽約而且已付清? 還是我需要去找他的設計師再投錢? 或轉我自己的設計師? 4)公聽會 Thank you, 美玲 這是給黃叫他去問ㄉ問題 如果bellflower 只有 site plan approve 你就要放棄ㄌ 我又回頭去看comptom ㄉ文件 分割ㄉPERMIT都有 Architectural drawing 也有 反倒是這ㄍ比較快 水機問題原因列表: 1.)水機常自動1秒內連續回報閥on/off->?4號機4分進水閥+壓力桶+r01改QoS=2(20171231) 2.)mq_flow記錄多於wr_fetch->出水流量計裝在電磁閥與壓力桶之間,因此在造水時會隨壓力漸增而轉動,產生記錄回報(20180101) 3.)水機MQTT常自動掉線重連,出現很多i->?r01改QoS=2(20180101) 请填写接口配置信息,此信息需要你拥有自己的服务器资源。 填写的URL需要正确响应微信发送的Token验证,请阅读接入指南。 URL https://water.suanok.com/Home/weixin/index/uid/1 20180610 -> http://www.suanok.com/dv-m/rq-8.php 一、按下列模板直接发送申请信息至QQ:3481978937(添加QQ请备注账户ID,邮箱不受理,申请信息可以编辑好直接粘贴发送,辛苦配合) 二、申请模板(严格按要求模板发送内容至QQ即可,不符合模板要求的申请无效,通过后会通知您,催促不回复,请知悉) 1、公司名称 2、广告账户ID 3、广告主行业 4、申请一跳还是二跳【一跳:选择落地页推广目的——填写落地页链接处 为一跳落地页链接;二跳:头条建站里面需要添加的链接为二跳链接】 5、使用一跳/二跳原因 6、申请投放白名单链接 (请以http或者https开头) 7、加盖公司公章的ICP资质证明,并手写上“与原件一致”(资质证明:资质要求参见http://www.toutiaopage.com/tetris/page/52203243766/) 8.模板要体现您查询网址的URL 三、白名单申请通过后,会通知您已添加,如遇到不成功建议等一段时间刷新后尝试三次以上,还是不成功,可截图反馈至QQ,我们将为您处理。切记!!!!!不要随便试一下就来反馈,有更新延迟,辛苦配合!! 1、公司名称 :东莞市华算网络科技有限公司 2、广告账户ID :99495020571 3、广告主行业 :招商加盟 4、申请一跳还是二跳 :二跳 5、使用一跳/二跳原因 :方便客户了解更多信息 6、申请投放白名单链接 :http://suanok.com 7、加盖公司公章的ICP资质证明,并手写上“与原件一致”(资质证明:资质要求参见http://www.toutiaopage.com/tetris/page/52203243766/) 8、模板要体现您查询网址的URL 914419003251324314 东莞市常平镇东莞创客邦基地16栋2号101号房(集群注册) 523570 张少丹 13538792973 1837794505@qq.com 东莞市华算网络科技有限公司 河北大学新闻传播学院教授王秋菊称,野蛮生长期对一个平台来说至关重要,若等到政策允许或者产品功能完善之后再发展,一切都来不及了。 现在能够发展起来的产品等监管完善时可能已处于遥遥领先的地位,循规蹈矩的产品注定成为出局者。 河神 一起同过窗 司马懿大将军之军师联盟 那年花开月正圆 使徒行者 九州·海上牧云记 无证之罪 少年有点酷 大唐荣耀 春风十里不如你 致我们单纯的小美好 权利的游戏第七季 你好,旧时光 颤抖吧,阿部! 杀不死 花间提壶方大厨 一,我们会介绍说最起码我们的水知道哪里来的水; 二,我们的水又可以现场试喝; 三,我们的水客户打的多公司会有优惠,我们私人又可以另送一桶至二桶 四,我们的水又是井水,经过公司人员常期会把水带回去抽检化验,保证我们的以提供最优质的水质 五,我们的水是经过电源插电,带消毒的,顾客打五升的水,我们就去掉六成不良的水排出来,只有四成的水,而且我们的水并不像水管那么大的水想出多大就有多大 之所以我们的机器不卖的原因, 我们的机器里面的过滤器是经过我们的水质来安装过滤器的,并不像市场卖的一仟多的那么便宜的过滤器的 SELECT *,sum(`GiftUnit`) FROM `wr_fanggift` WHERE `FangId`='6' group by `GiftType` 20-30 sec 第一次拔SIM卡 AT Ready AST_POWERON 第2次以後拔SIM卡 Device Will Restart... AT Ready AST_POWERON 連上 +STATUS: MQTT READY +STATUS: MQTT CONNECT OK Subscribe OK 中斷自連 +STATUS: MQTT CLOSE +STATUS: MQTT CONNECT OK Subscribe OK 計算機管理->設備管理器->(黃三角形)Prolific USB-to-Serial Comm Port->更新驅動程序軟件->瀏覽計算機以查找->從計算機的驅動程序列表中選取->版3.3.10.104(2009/11/19) ATI->查固件 IOT_Ltd IOT_M35 Revision: MQTT_B5_R05_A10_D171205 AT+GSN->查IMEI 352425023962841 AT+CPIN?->查SIM卡 +CPIN:READY AT+CSQ->查信號 +CSQ: 24,99 ATE0->設停止echo AT+IPPORT=119.29.34.98,18883->設ip+port AT+USERPWD=user2,u2234->設ID+PSW AT+STATUS->查MQTT狀態 AT+AUTOSUB=1,R769000009,2->auto subscript 所有的命令配置完后,需要保存(AT&W)再重启才能生效(重启AT+CFUN=1,1 命令)。 AT&W->保存 AT+CFUN=1,1->重启 AT+SUBSCRIBE=R769000009,2->subscript topic: R769000009,11 tR769000009(無enter) AT+PUBLISH=R769,10->publish >1234567890(enter送出) mosquitto_sub -h 119.29.34.98 -p 18883 -u user2 -P u2234 -t R769 mosquitto_pub -h 119.29.34.98 -p 18883 -u user1 -P u1234 -t R769000009 -m tR769000009 白色卡托 WGate0001+1353879297 DV板D1 SSID:R769000001 + 1353879297300 聯通卡托 192.168.100.1 admin+aa223344 AP PSW 1234567890 -> 1353879297 SSID 3G uFI_XXX -> Gate0001禁用廣播 3G卡公眾號-深圳市达能信通电子有限公司 3個月2元每月5M共15M-20171026-20180126 (ICCD最後1碼為S) ICCD 8986 0617 0800 2246 3325 PUK 0951 8852-(R769000002) 20171126 開通 黑色卡托 Gate0001 + 1353879297 ICCD 8986 0617 0800 2246 3333 PUK 0490 4834-(R769000003) 20171126 開通 黑色卡托 Gate0001 + 1353879297 公众号:“欧申物联”几米充值-联通查询,查询卡号是卡套上的8986开头的ICCID号就是了,输入时不用输最后那个字母 物联卡有锁定功能,只能识别第一个设备,再装其他设备时会自动锁了停用,一个卡只能解锁三次(“欧申物联”几米充值-聯通卡解鎖") ICCD 8986 0617 0800 5754 782N PUK 9191 3935-(R769000004) 20171224 開通 黑色卡托 Gate0001 + 1353879297 ICCD 8986 0617 0800 5754 704N PUK 6544 6074-(R769000005) 20180101 開通 白色卡托 Gate0002 + 1866687760 Mosquitoo 密碼表 /etc/mosquitto/mqtt.acl 要加上允許的topic,否則無法收發 user user1 topic readwrite R769 topic readwrite R769000001 topic readwrite R769000002 topic readwrite R769000003 topic readwrite R769000004 topic readwrite R769000005 topic readwrite R769000006 topic readwrite R769000007 topic readwrite R769000008 topic readwrite R769000009 topic readwrite R769000010 再 cp /www/web/default/bish-bosh/mqtt.acl /etc/mosquitto/mqtt.acl 重 run一次mosquitto ps aux|grep -i 'mos' 找到PID號碼(目前執行這個是 26531), kill 那個 pid, (kill 26531) 重新執行 /usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -p 18883 -d ps aux|grep -i 'bish-bosh' kill r01 再重新執行 /bin/bash /www/web/default/bish-bosh/t01 /www/web/default/bish-bosh/t01->每隔1分鐘檢查r01 如果=1(中斷)則重新run r01 + 判斷如果>4(重覆多支r01)則全砍 /var/spool/cron/crontabs/root 加 * * * * * /bin/bash /www/web/default/bish-bosh/t01 /www/web/zjr/public_html/dv-m/mqtt-tool-tds.php->每天00:30定時發出TDS請求 /var/spool/cron/crontabs/root 加 30 0 * * * /www/wdlinux/apache_php-5.5.38/bin/php /www/web/zjr/public_html/dv-m/mqtt-tool-tds.php > /dev/null 2>&1 /etc/init.d/cron restart -> 重新啟動 to test if mos OK mosquitto_sub -h 119.29.34.98 -p 18883 -u user2 -P u2234 -t R769000010 mosquitto_pub -h 119.29.34.98 -p 18883 -u user1 -P u1234 -t R769000010 -m tR769000010 Mosquitoo 20171117 改 listsen port 1883->18883 + port 1883 mapping ->18883 ps aux|grep -i 'bish-bosh' (查出執行 kill -9 id數字) ps aux|grep -c 'bish-bosh/r01' (查出執行的行數1=中斷,4=運用中) /bin/bash /www/web/default/bish-bosh/t01 if r01 dup 先加時間Stamp echo -ne $(date "+%Y-%m-%d %H:%M:%S")'\n' >>/www/web/default/bish-bosh/bb_err_log ps aux | grep /www/web/default/bish-bosh/r01 | awk '{print $2}' | xargs kill -9 (這行 r01 會全殺) if r01 stop 先加時間Stamp 背景執行後按enter 要加--port (r01中要加user+psw,不可以有output echo否則ssh斷線就退出停止) 2>>bb_err_log 將stderr輸出到bb_err_log /www/web/default/bish-bosh/bish-bosh 2>>/www/web/default/bish-bosh/bb_err_log --port 18883 --verbose 2 -- /www/web/default/bish-bosh/r01 & A1,A2 吸頂路由 192.168.188.253 admin+admin->admin+aa223344 萬能中續模式->上(11)下(4)WIFI信道不可以相同 水星小路由 192.168.100.1 admin+admin->admin+aa22334 开启上网控制 缺省过滤规则 凡是符合已设上网控制规则的数据包,允许通过本路由器 三規則: 119.29.34.98 qq.com weixin.qq.com wx.qq.com suanok.com water.suanok.com wr_z_promo_log g10->g20->g21->g30->g31->g32->wallet 抽1->抽2->獎2->抽3手機->抽3->獎3->支付 g40->抽完后返回 SQL 觸發器-蔡海濤 1.)取水表取水更新用戶水庫/錢包/房東收益 ??? SELECT field INTO var ............ 不可加@ CREATE DEFINER = root@localhost TRIGGER fetch_updae_userWM_fang AFTER UPDATE ON wr_fetch begin DECLARE Discnt FLOAT(3,2); DECLARE UntPri FLOAT(4,2); DECLARE Summoney FLOAT(9,1); DECLARE OwnWater BIGINT(11); DECLARE ActOpenId VARCHAR(32); DECLARE ComFangId BIGINT(11); DECLARE SalComRat FLOAT(6,4); DECLARE FangOpenId VARCHAR(32); if NEW.FlowMl<>0 then if NEW.paytype=1 then SELECT Water INTO OwnWater FROM wr_user WHERE openid = NEW.openid; if OwnWater>0 then set ActOpenId = NEW.openid; else SELECT openid INTO ActOpenId FROM wr_userbind WHERE BindOpenid = NEW.openid; end if; UPDATE wr_user SET Water=Water-NEW.FlowMl WHERE openid = ActOpenId; end if; if NEW.paytype=2 then SELECT Discount INTO @Discnt FROM wr_user WHERE openid = NEW.openid; SELECT UnitPrice INTO @UntPri FROM wr_mach WHERE MachId = NEW.MachId; set Summoney = NEW.FlowMl/1000*@Discnt*@UntPri; UPDATE wr_user SET Money=Money-Summoney WHERE openid = NEW.openid; end if; SELECT FangId INTO ComFangId FROM wr_mach WHERE MachId = NEW.MachId; SELECT SaleCommRate INTO SalComRat FROM wr_fang WHERE FangId = ComFangId; SELECT openid INTO FangOpenId FROM wr_fang WHERE FangId = ComFangId; if NEW.openid<>FangOpenId then INSERT INTO wr_fangincome (FangId,FangIncomeDat,FangIncomeType,FangIncomeAmt,FangIncomeDatStamp) VALUES (ComFangId,date_format(NOW(),'%Y%m%d%H%i%s'),1,(NEW.FlowMl*SalComRat/1000),UNIX_TIMESTAMP()); end if; end if; end 2.)個人水庫/錢包小於0校正歸0 --> X ?? CREATE DEFINER = root@localhost TRIGGER bank_wallet_zero_correct BEFORE UPDATE ON wr_user begin if NEW.Water<0 then set NEW.Water=0; end if; if NEW.Money<0 then set NEW.Money=0; end if; end 3.)收入/提現更新房東收益餘額 CREATE DEFINER = root@localhost TRIGGER fang_income_balance_update AFTER INSERT ON wr_fangincome begin UPDATE wr_fang SET IncomeBal=IncomeBal+NEW.FangIncomeAmt WHERE FangId=NEW.FangId; end 4.)充水庫更新個人水庫餘額 CREATE DEFINER = root@localhost TRIGGER insert_user_water AFTER INSERT ON wr_buywater begin if NEW.types=2 then update wr_user set Water=Water+new.waterMl where openid=new.openid; end if; end CREATE DEFINER = root@localhost TRIGGER update_user_water AFTER UPDATE ON wr_buywater begin if NEW.types=1 and NEW.wxpay_prepay_id is not null and OLD.wxpay_prepay_id is null then update wr_user set Water=Water+new.waterMl where openid=new.openid; end if; end 5.)充錢包更新個人錢包餘額 CREATE DEFINER = root@localhost TRIGGER insert_user_money AFTER INSERT ON wr_moneylog begin if NEW.state=1 and NEW.types=2 then update wr_user set Money=Money+new.money where openid=new.openid; elseif NEW.state=-1 and NEW.types=2 then update wr_user set Money=Money-new.paymoney where openid=new.openid; end if; end CREATE DEFINER = root@localhost TRIGGER update_user_money AFTER UPDATE ON wr_moneylog begin if NEW.state=1 and NEW.types=1 AND NEW.wxpay_prepay_id is not null AND OLD.wxpay_prepay_id is null then update wr_user set Money=Money+new.money where openid=new.openid; end if; end DV-SQL 觸發器 1.)歸0/超量進水更新水箱空滿 CREATE DEFINER = root@localhost TRIGGER mq_bank_empty_full AFTER INSERT ON mq_bank begin if NEW.BankStat='E' then UPDATE water_cht.wr_mach SET BankStock=0 WHERE MachNum=NEW.GateId; elseif NEW.BankStat='F' then UPDATE water_cht.wr_mach SET BankStock=6500 WHERE MachNum=NEW.GateId; end if; end 2.)水箱出水流量計換算毫升 = 1000/(CntRatOut*60) ml/cnt CREATE DEFINER = root@localhost TRIGGER mq_bank_out AFTER UPDATE ON mq_flow begin if NEW.EndTmk<>'' then SELECT CntRatOut INTO @CountRateOut FROM water_cht.wr_mach WHERE MachNum=NEW.GateId; UPDATE water_cht.wr_mach SET BankStock=BankStock-round((NEW.Cnt*1000/(@CountRateOut*60)),0) WHERE MachNum=NEW.GateId; UPDATE water_cht.wr_fetch SET MqFlowId=NEW.MqFlowId,FlowMl=round((NEW.Cnt*1000/(@CountRateOut*60)),0) WHERE MachNum=NEW.GateId AND MqFlowId IS NULL AND FlowMl IS NULL ORDER BY addtime DESC LIMIT 1; end if; end 3.)水箱進水流量計換算毫升 = 1000/(CntRatIn*60) ml/cnt CREATE DEFINER = root@localhost TRIGGER mq_bank_in AFTER INSERT ON mq_flow_in begin if NEW.RepTmk<>'' then SELECT CntRatIn INTO @CountRateIn FROM water_cht.wr_mach WHERE MachNum=NEW.GateId; UPDATE water_cht.wr_mach SET BankStock=BankStock+round((NEW.Cnt*1000/(@CountRateIn*60)),0) WHERE MachNum=NEW.GateId; end if; end 4.)閥開/關/開機更新機器/取水表狀態 CREATE DEFINER = root@localhost TRIGGER mq_valve_state AFTER INSERT ON mq_valve begin if NEW.ValveTmkStamp<>'' then UPDATE water_cht.wr_mach SET ValveStat=NEW.ValveStat,ValveTime=NEW.ValveTmkStamp WHERE MachNum=NEW.GateId; end if; if NEW.ValveStat='i' then UPDATE mq_flow SET EndTmk=NOW(),Cnt='0' WHERE GateId=NEW.GateId AND EndTmk IS NULL ; UPDATE water_cht.wr_fetch SET MqFlowId=0,FlowMl=0 WHERE MachNum=NEW.GateId AND MqFlowId IS NULL AND FlowMl IS NULL ; end if; end 5.)TDS回報更新機器TDS表 CREATE DEFINER = root@localhost TRIGGER mq_tds_update AFTER INSERT ON mq_tds begin if NEW.TdsTmkStamp<>'' AND NEW.Tds0<>0 then UPDATE water_cht.wr_mach SET TdsIn=round((NEW.Tds0/20),0),TdsOut=round((NEW.Tds1/40),0),TdsTime=NEW.TdsTmkStamp WHERE MachNum=NEW.GateId; end if; end 6.)超時未取水更新取水表 CREATE DEFINER = root@localhost TRIGGER mq_wait_timeout AFTER INSERT ON mq_flow begin if NEW.EndTmk<>'' AND NEW.Cnt=0 then UPDATE water_cht.wr_fetch SET MqFlowId=NEW.MqFlowId,FlowMl=0 WHERE MachNum=NEW.GateId AND MqFlowId IS NULL AND FlowMl IS NULL ORDER BY addtime DESC LIMIT 1; end if; end FTP連98常中斷: 改FlashFXP 選項->參數選擇->連結->FTP->數據連結模式->主動模式(PORT) String.toInt()-> Long integers can be as large as 2147483647 and as low as -2147483648 Ko Command: Ko Pub -> Device topic R769000001 (R + area call + (10)gate id) 'c': // pipe N limit counter to stop: "c" + (10)gate id + (1)pipe id + (8)counter xxxxxxxx mosquitto_pub -h 119.29.34.98 -u user1 -P u1234 -t R769000001 -m cR769000001012345678 't': // require report 2 tds meter2: "t" + (10)gate id mosquitto_pub -h 119.29.34.98 -u user1 -P u1234 -t R769000001 -m tR769000001 's': // setup WaitFlowGap + NextUserGap + RepCnti: "s" + (10)gate id + (3)wait flow sec + (3)next user sec + (6)report income pure water counter mosquitto_pub -h 119.29.34.98 -u user1 -P u1234 -t R769000001 -m sR769000001020005002880 'v': // close valve pipe N : "v" + (10)gate id + (1)pipe id mosquitto_pub -h 119.29.34.98 -u user1 -P u1234 -t R769000001 -m vR7690000010 Device Report: Device Pub -> Ko topic R769 "i") # report start up "i" + (10)gate id mosquitto_pub -h 119.29.34.98 -t R769 -m iR769000001 "t") # report tds 0,1 "t" + (10)gate id + (5)tds 0 value + (5)tds 1 value mosquitto_pub -h 119.29.34.98 -t R769 -m tR7690000015555599999 "v") # report valve turn on/off "v" + (10)gate id + (1)pipe id + (1)"o"n / of"f" mosquitto_pub -h 119.29.34.98 -t R769 -m vR7690000010f "b") # report start flow "b" + (10)gate id + (1)pipe id mosquitto_pub -h 119.29.34.98 -t R769 -m bR7690000010 "e") # report stop flow "e" + (10)gate id + (1)pipe id + (8)counter xxxxxxxx mosquitto_pub -h 119.29.34.98 -t R769 -m eR769000001012345678 "z") # report zero flow wait flow expired "z" + (10)gate id + (1)pipe id mosquitto_pub -h 119.29.34.98 -t R769 -m zR7690000010 "I") # report income tap water counter "I" + (10)gate id + (8)counter xxxxxxxx mosquitto_pub -h 119.29.34.98 -t R769 -m IR76900000112345678 "E") # report water bank empty "E" + (10)gate id mosquitto_pub -h 119.29.34.98 -t R769 -m ER769000001 "F") # report water bank full "F" + (10)gate id mosquitto_pub -h 119.29.34.98 -t R769 -m FR769000001 Protel 99 SE E:\Program Files\Design Explorer 99 SE\Library\Sch 下先COPY要的ddb並rename 再到browse Sch->find->find now->找到新lib->Add to library list->ok DV電路板 JP3-D7-TDS0 (近螺絲孔-自來水TDS) JP4-D5-TDS1 (遠螺絲孔-純淨水TDS) JP5-DC24V (接DC 24V正負電源) JP6-D6-Valve0 (接DC 24V正負電磁閥) JP7-D1-Meter0 out (遠螺絲孔-4分出水龍頭流量計) JP8-D2-Meter income (近螺絲孔-2分進水箱流量計) 新QQ云 119.29.34.98 SSH要先用個人帳號 ubuntu ; frevres0907 登入, 再打 su -l 切換成 root ; frevres0907 ps aux|grep -i 'bish-bosh' (查出執行 kill -9 第二排的id數字) /www/web/default/bish-bosh/bish-bosh --verbose 2 -- /www/web/default/bish-bosh/r01 & (背景執行後按 enter r01中不可以有output echo否則ssh斷線就退出停止) subscriber -> mosquitto_sub -h 119.29.34.98 -t R769000001 -u user1 -P u1234 KO command set valve counter -> mosquitto_pub -h 119.29.34.98 -t R769000001 -m cR769000001099999999 -u user1 -P u1234 KO command stop valve -> mosquitto_pub -h 119.29.34.98 -t R769000001 -m cR769000001000000000 -u user1 -P u1234 KO command get TDS -> mosquitto_pub -h 119.29.34.98 -t R769000001 -m tR769000001 -u user1 -P u1234 ID+PSW /etc/mosquitto/mosquitto.conf user1:u1234 user2:u2234 user3:u3234 看MQTT-log cat /var/log/mosquitto/mosquitto.log|perl -nwe's/^(\d+)/localtime($1)/e; print' 執行 mosquitto /usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -d wcmp http://119.29.34.98:8080 -> http://119.29.34.98:33888 admin ; frevres0907, mysql root ; revres88 phpmyadmin http://119.29.34.98/pma_e07f4b62/ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ =============== TAPPURE-170917 ================================================================================================================================= D0 GPIO16 T1 純水TDS (外波形3P黑)-(下公XH2.54 白) D1 GPIO5 , SCL M1 熱水流量計(公SM-4P 藍)-(母SM-4P 藍)-(上公XH2.54 白) D2 GPIO4 , SDA M2 冰水流量計(公SM-4P 黑)-(母SM-4P 黑)-(上公XH2.54 黃) D3 GPIO0 , 10k Pull-up S1 熱水開關 (公SM-4P 紅)-(母SM-4P 紅)-(上公XH2.54 橙) (因為用3.3V-GPIO電位不穩,必須用 pin0 GPIO(high)-ground) D4 GPIO2 , 10k Pull-up, BUILTIN_LED S2 冰水開關 (公SM-4P 綠)-(母SM-4P 綠)-(上公XH2.54 綠) (因為用3.3V-GPIO電位不穩,必須用 pin2 GPIO(high)-ground) D5 GPIO14, SCK T2 進水TDS (內波形3P黑)-(下公XH2.54 藍)-(下公XH2.54 黃) D6 GPIO12, MISO V1 進水電磁閥(內繼電3P紅)-(下公XH2.54 橙) D7 GPIO13, MOSI V2 冰水電磁閥(外繼電3P紅)-(下公XH2.54 綠) D8 GPIO15, 10k Pull-down, SS H1 電熱繼電器(母SM-2P 紅)-(公SM-2P 紅)(因為pulldown,必須用大負載否則wemos開不了機) X X X 5V GN D4 D3 D2 D1 RX TX 紫 藍 綠 橙 黃 白 紅 黑 WEMOS 3V D8 D7 D6 D5 D0 A0 RS 紫 藍 綠 橙 黃 白 紅 黑 X X Wemos D1 mini D1 (上公XH2.54 白)-(母SM-4P 藍) D2 (上公XH2.54 黃)-(母SM-4P 黑) D3 (上公XH2.54 橙)-(母SM-4P 紅) D4 (上公XH2.54 綠)-(母SM-4P 綠) GN (上公XH2.54 藍)-(母SM-2P 黑) -(公SM-2P 黑) D0 (下公XH2.54 白)-(外波形3P黑) D5 (下公XH2.54 黃)-(內波形3P黑) D6 (下公XH2.54 橙)-(內繼電3P紅) D7 (下公XH2.54 綠)-(外繼電3P紅) D8 (下公XH2.54 藍)-(公SM-2P 紅) 3V (下公XH2.54 紫)-(母SM-2P 紅) 外波形模塊 GN (外波形3P黃)-(上公XH2.54 藍) D0 (外波形3P黑)-(下公XH2.54 白) 3V (外波形3P紅)-(下公XH2.54 紫) 內波形模塊 GN (內波形3P黃)-(上公XH2.54 藍) D5 (內波形3P黑)-(下公XH2.54 黃) 3V (內波形3P紅)-(下公XH2.54 紫) 內繼電模塊 GN (內繼電3P黃)-(上公XH2.54 藍) 3V (內繼電3P黑)-(下公XH2.54 紫) D6 (內繼電3P紅)-(下公XH2.54 橙) 外繼電模塊 GN (外繼電3P黃)-(上公XH2.54 藍) 3V (外繼電3P黑)-(下公XH2.54 紫) D7 (外繼電3P紅)-(下公XH2.54 綠) 61.220.188.84 -> 119.29.228.213 mosquitto -d (背景啟動 MQTT server ) subscriber -> mosquitto_sub -h 119.29.228.213 -t Ko001 publisher -> mosquitto_pub -h 119.29.228.213 -t Ko001 -m 12 ps aux|grep -i 'bish-bosh' (查出執行 kill -9 第二排的id數字) /www/web/default/bish-bosh/bish-bosh --verbose 2 -- /www/web/default/bish-bosh/q01 & (背景執行後按 enter q01中不可以有output echo否則ssh斷線就退出停止) Ko Command: Ko Pub -> Gate topic Ko001 1.) 8x limit counter to stop: "C" + gate id xxxxxxxx + counter 0~7 xxxxxxxx (8x8) mosquitto_pub -h 119.29.228.213 -t Ko001 -m CGate00010000000011111111222222223333333344444444555555556666666677777777 2.) 8x limit minisec to stop: "T" + gate id xxxxxxxx + timer 0~7 xxxxxxxxxxxx (12x8) mosquitto_pub -h 119.29.228.213 -t Ko001 -m TGate0001000000000000111111111111222222222222333333333333444444444444555555555555666666666666777777777777 3.) pipe N limit counter to stop: "c" + gate id xxxxxxxx + pipe id x + counter xxxxxxxx mosquitto_pub -h 119.29.228.213 -t Ko001 -m cGate0001712345678 4.) pipe N limit minisec to stop: "t" + gate id xxxxxxxx + pipe id x + timer xxxxxxxxxxxx mosquitto_pub -h 119.29.228.213 -t Ko001 -m tGate00017123456789012 Gate Report: Gate Pub -> Ko topic Dv001 2.) Gate Start Up: "i" + gate id xxxxxxxx + 9 digit 000000000 mosquitto_pub -h 119.29.228.213 -t Dv001 -m iGate0001000000000 2.) pipe N start flow counters: "b" + gate id xxxxxxxx + pipe id x + counter xxxxxxxx mosquitto_pub -h 119.29.228.213 -t Dv001 -m bGate0001712345678 3.) pipe N stop flow counters: "e" + gate id begin + pipe id x + counter xxxxxxxx mosquitto_pub -h 119.29.228.213 -t Dv001 -m eGate0001712345678 4.) pipe N now flow counters: "c" + gate id xxxxxxxx + pipe id x + counter xxxxxxxx mosquitto_pub -h 119.29.228.213 -t Dv001 -m cGate0001712345678 ======================= qq cloud MQTT ========================================= ps aux|grep -i 'bish-bosh' (查出執行 kill -9 第二排的id數字) /home/httpd/www/html/bish-bosh/bish-bosh --verbose 2 -- /home/httpd/www/html/bish-bosh/q01 & (背景執行後按 enter q01中不可以有output echo否則ssh斷線就退出停止) Ko Command: Ko Pub -> Gate topic Ko001 1.) 8x limit counter to stop: "C" + gate id xxxxxxxx + counter 0~7 xxxxxxxx (8x8) mosquitto_pub -h 61.220.188.84 -t Ko001 -m CGate00010000000011111111222222223333333344444444555555556666666677777777 2.) 8x limit minisec to stop: "T" + gate id xxxxxxxx + timer 0~7 xxxxxxxxxxxx (12x8) mosquitto_pub -h 61.220.188.84 -t Ko001 -m TGate0001000000000000111111111111222222222222333333333333444444444444555555555555666666666666777777777777 3.) pipe N limit counter to stop: "c" + gate id xxxxxxxx + pipe id x + counter xxxxxxxx mosquitto_pub -h 61.220.188.84 -t Ko001 -m cGate0001712345678 4.) pipe N limit minisec to stop: "t" + gate id xxxxxxxx + pipe id x + timer xxxxxxxxxxxx mosquitto_pub -h 61.220.188.84 -t Ko001 -m tGate00017123456789012 5.) pipe N limit counter + minisec to stop: "p" + gate id xxxxxxxx + pipe id x + counter xxxxxxxx + timer xxxxxxxxxxxx mosquitto_pub -h 61.220.188.84 -t Ko001 -m pGate0001712345678123456789012 Gate Report: Gate Pub -> Ko topic Dv001 2.) Gate Start Up: "i" + gate id xxxxxxxx + 9 digit 000000000 mosquitto_pub -h 61.220.188.84 -t Dv001 -m iGate0001000000000 2.) pipe N start flow counters: "b" + gate id xxxxxxxx + pipe id x + counter xxxxxxxx mosquitto_pub -h 61.220.188.84 -t Dv001 -m bGate0001712345678 3.) pipe N stop flow counters: "e" + gate id begin + pipe id x + counter xxxxxxxx mosquitto_pub -h 61.220.188.84 -t Dv001 -m eGate0001712345678 4.) pipe N now flow counters: "c" + gate id xxxxxxxx + pipe id x + counter xxxxxxxx mosquitto_pub -h 61.220.188.84 -t Dv001 -m cGate0001712345678 振荡电路参考这个,其中R2就是探针之间的水电阻 1、求出探针之间的水电阻 2、根据探针的间距、横截面面积获得L/S 3、根据上面两个值获得探针之间的电导率 4、根据电导率获得TDS TDS= (0.55~0.7)电导率 两根针间距是5.2mm,针长度是5.5mm,针个直径是1mm /home/httpd/www/html/bish-bosh/bish-bosh --verbose 2 -- /home/httpd/www/html/bish-bosh/q01 & (背景執行 不可以有output echo否則ssh中斷就退出) ps aux|grep -i 'bish-bosh' (查出執行 kill -9 第二排的id數字) cd /home/httpd/www/html/bish-bosh ./bish-bosh --verbose 2 -- q01 mosquitto_pub -h 61.220.188.84 -t Dv001 -m Gate0001700000001 (gate id xxxxxxxx + pipe 0-7 + counter xxxxxxxx -> 00000001/begin 00000000/end else/counter) change valve publisher(84) -> mosquitto_pub -h 61.220.188.84 -t Ko001 -m Gate000100000010 (GateId + 8 valve on/off) 604,523,637 1,2,3 760 600,527,617 1,2,3 800 607,457,651 1,2,3 800,710,820 520,500,513 2,3,1 740 708,682,692 3,1,2 1050 1766 1544 1234 1,2,3 700 1514-870 1532-860 joe /usr/bin/dv01 chmod 777 /usr/bin/dv01 #!/bin/bash mxi=60*5 for (( i = 0; i < $mxi; i++ )); do dat=$(date "+%Y%m%d%H%M%S") echo $dat mosquitto_pub -h 61.220.188.84 -t Gate0001 -m $dat $(php '/home/httpd/www/html/mq.php') sleep 1 done exit 0 方 主板 rm /home/httpd/www/html/dv02 subscriber(84) -> mosquitto_sub -h 61.220.188.84 -t Gate0001 > /home/httpd/www/html/dv02 change valve publisher(84) -> mosquitto_pub -h 61.220.188.84 -t Master -m Gate00010000111 (GateId + 8 valve on/off) timer(84) -> /usr/bin/dv01 -> (mosquitto_pub -h 61.220.188.84 -t Gate0001 -m 20170720202311 + php '/home/httpd/www/html/mq.php') 電磁閥7 流量計7(電源旁) x-publisher(84) -> mosquitto_pub -h 61.220.188.84 -t Master -m 11118 (valve 3 ON 11117 OFF) systemctl restart mosquitto.service RSSI Wifi 訊號 0 - (-55)dbm 满格(4格)信号 (-55) - (-70)dbm 3格信号 (-70) - (-85)dbm 2格信号 (-85) - (-100)dbm 1格信号 =========== C language ===================== char *xxx = ""; -> 一定要先給值後才可以用array去改值 C++ string xxx.length() 字符串長度 char *xxx 沒有預留空間, char xxx[100] 才有 char[x+1] 至少要比字串多1,才不會影嚮下一個未串 ""->string ''->char ============================================ http://61.220.188.84/dv-m/mq-1.php -->從KO送DATA去wemos http://61.220.188.84/dv-m/mq-2.php -->查KO的SQL最後10筆 wemos傳給KO的DATA david@NB3 MINGW64 /f/WX-Water/Arduino/hardware $ cd esp8266com david@NB3 MINGW64 /f/WX-Water/Arduino/hardware/esp8266com $ git clone https://github.com/wemos/Arduino_D1.git esp8266 Cloning into 'esp8266'... remote: Counting objects: 13742, done. Receiving objects: 18% (2606/13742), 1.71 MiB | 8.00 KiB/s s david@NB3 MINGW64 /f/WX-Water/Arduino/hardware/esp8266com $ cd esp8266/tools david@NB3 MINGW64 /f/WX-Water/Arduino/hardware/esp8266com/esp8266/tools (master) $ python get.py Platform: i686-mingw32 Downloading esptool-0.4.9-win32.zip Done Extracting dist/esptool-0.4.9-win32.zip Renaming esptool-0.4.9-win32/ to esptool Downloading win32-xtensa-lx106-elf-gb404fb9-2.tar.gz Done Extracting dist/win32-xtensa-lx106-elf-gb404fb9-2.tar.gz Downloading mkspiffs-0.1.2-windows.zip Done Extracting dist/mkspiffs-0.1.2-windows.zip Renaming mkspiffs-0.1.2-windows/ to mkspiffs david@NB3 MINGW64 /f/WX-Water/Arduino/hardware/esp8266com/esp8266/tools (master) $ wemos MQTT broker(84) -> mosquitto -v subscriber(103-esp) -> 固定send outTopic + 收到callback inTopic publisher(84) -> mosquitto_pub -h 61.220.188.84 -t inTopic -m 111111111111 upload speed 115200 COM5 wemos D1 & mini AVRISP mkII D1接GND + RST接GND Wemos Installing Hardware package cd /f/WX-Water/Arduino/hardware/esp8266com git clone https://github.com/wemos/Arduino_D1.git esp8266 cd esp8266/tools python get.py MQTT broker(84) -> mosquitto -v subscriber(104-pi) -> mosquitto_sub -h 61.220.188.84 -t dv01 publisher(84) -> mosquitto_pub -h 61.220.188.84 -t dv01 -m 12 --------------------- raspberry pi ------------------------------------------- 控制gpio18亮燈 (104-pi) -> sudo python simple.py (84) -> mosquitto_pub -h 61.220.188.84 -t dv01 -m "{\"pin\":18,\"value\":1}" apache-php 加權限才可執行shell sudo visudo 加一行 www-data ALL=(ALL:ALL) NOPASSWD:ALL php 必須用 sudo 去執行shell bash 安裝 PHP + APACHE apt-get install apache2 php5 libapache2-mod-php5 安裝 vsftpd apt-get install vsftpd ftp 修改匿名設定才能上傳檔案 joe /etc/vsftpd.conf write_enable=YES anonymous_enable=YES anon_upload_enable=YES anon_mkdir_write_enable=YES ftp 修改上傳檔案欋限自動變為666 (777?) local_umask=000 讀取 TDS 模塊 minicom -H -S /usr/local/bin/dv02 -C /usr/local/bin/dv03 dv02----------------- #!/bin/sh print "\n" send \0374\0374\0374 dv03----------------- fd 5e 00 fd fd fe 24 01 fe fe raspberry pi 接 USB-串口 接 TDS 產生Hex的 FD FD FD 檔案 > dv01 echo -e "\0375\0375\0375" > dv01 進入minicom -H 顯示十六進位 ctrl-A -> S -> ascii -> /usr/local/bin/dv01 上傳檔案 dv01 當作發送 FD FD FD TDS 雙路 9600 8N1 停止位 1 TX-RX,RX-TX 交換接 TDS 二直突條正面4P孔向上,左->右,接wemos GRN-RX-TX-5V 发送FC FC FC 返回 FD TDSL1 TDSH1 FD FD FE TDSL2 TDSH2 FE FE IC盒探針線向上 右1左2 TDS 單路 9600 8N1 停止位 1 TX-TX,RX-RX 對接 發送 FD FD FD 返回 FD 低位 高位 FD FD ssh -NfR 8080:192.168.100.104:22 root@61.220.188.84 先 apt-get update 再 apt-get install minicom 工作文件區 /usr/local/bin/ ...... gpio18 設定方式 echo 18 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio18/direction echo 1 > /sys/class/gpio/gpio18/value 取消設定 echo 18 > /sys/class/gpio/unexport apt-get install joe apt-get remove xxx pi + raspberry (已改) -> frevres0907 -> su + frevres0907 ====================================== 20170531 New WX Water ===================================================== https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx7fe291f76cf93354&secret=d8fd277920bba0cfddc1fd8f5eacf937 {"access_token":"y-RkXsDVDdxRaMTBybYL8hj5YREkUJmG6hLkGM4E_JkcNmq1pClejE5gF9mTJrmI5qc4Jf2elQf2aD7OBmgx22sWoaZrtArDxAa3A6RWQa8","expires_in":7200} 微信公眾平台 lee@dacomputing.com aa2233zz AppID(应用ID) wx7fe291f76cf93354 AppSecret(应用密钥) d8fd277920bba0cfddc1fd8f5eacf937 weixin.qq.com 101.227.131.102, 101.226.76.175 BIOS 中的南橋USB->8 ports, USB2.0->disable 才不會常常抓不到USB0 BIOS設少8小時->如果linux多8小時 為了確定 wifi AP 是否存在用 ping wifi AP 192.168.188.253 開機增加/etc/sysconfig/network-scripts/ifcfg-eth0:4 --> 192.168.188.100 date -s 2015-01-15 date -s 09:41:30 hwclock -w 把date 寫入 BIOS 點煙器的黃線在中間藍靠主板咖啡靠面板 如果timer_3g卡死,flag-3g-busy將一直存在 ps -ef 列出defunct 僵屍 kill -9 xxxx 進程號 /usr/bin/autossh -M 5678 -NfR 8080:192.168.100.99:22 root@61.220.188.84 ipad-saferi