7 public static void main(String[] args) throws Exception {
10 long pstart = System.currentTimeMillis();
13 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 361, -1);
17 } catch (Exception e) {
21 long start = System.currentTimeMillis();
25 System.out.println("Sleeping......");
29 } catch (Exception e) {
33 System.out.println("Pulling......");
34 long stop1 = System.currentTimeMillis();
36 System.out.println(stop1 - pstart);
39 long stop2 = System.currentTimeMillis();
41 System.out.println("Done......");
42 System.out.println(stop1 - start);
43 System.out.println(stop2 - stop1);
45 // t1.startTransaction();
46 // t1.addKV(ipingTimerKey, ipingTimer);
47 // t1.addKV(ia1, senDat);
48 // t1.commitTransaction();
54 // String pingTimerKey = "sensorController";
55 // IoTString ipingTimerKey = new IoTString(pingTimerKey);
57 // String a1 = "sensor";
58 // IoTString ia1 = new IoTString(a1);
61 // System.out.println("Starting System");
71 // // Runtime runTime = Runtime.getRuntime();
72 // // // Process proc = runTime.exec("/opt/vc/bin/vcgencmd measure_temp | tr -d 'temp=' | tr -d \"'C\"");
73 // // Process proc = runTime.exec("/opt/vc/bin/vcgencmd measure_temp");
74 // // BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
75 // // String line = null;
76 // // String dat = "";
77 // // while ((line = reader.readLine()) != null) {
78 // // System.out.println(line);
85 // // String pingTimer = Long.toString(System.currentTimeMillis());
86 // // IoTString ipingTimer = new IoTString(pingTimer);
89 // IoTString senDat = new IoTString(dat);
92 // t1.startTransaction();
93 // t1.addKV(ipingTimerKey, ipingTimer);
94 // t1.addKV(ia1, senDat);
95 // t1.commitTransaction();
103 // Thread.sleep(5000);
105 // } catch (Error e) {
106 // e.printStackTrace();
108 // Runtime runTime = Runtime.getRuntime();
109 // runTime.exec("gpio mode 4 out");
113 // runTime.exec("gpio write 4 1");
114 // Thread.sleep(500);
115 // runTime.exec("gpio write 4 0");
116 // Thread.sleep(500);