7 public static void main(String[] args) throws Exception {
10 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 361, -1);
14 } catch (Exception e) {
18 long start = System.currentTimeMillis();
22 System.out.println("Sleeping......");
26 } catch (Exception e) {
30 System.out.println("Pulling......");
31 long stop1 = System.currentTimeMillis();
34 long stop2 = System.currentTimeMillis();
36 System.out.println("Done......");
37 System.out.println(stop1 - start);
38 System.out.println(stop2 - stop1);
40 // t1.startTransaction();
41 // t1.addKV(ipingTimerKey, ipingTimer);
42 // t1.addKV(ia1, senDat);
43 // t1.commitTransaction();
49 // String pingTimerKey = "sensorController";
50 // IoTString ipingTimerKey = new IoTString(pingTimerKey);
52 // String a1 = "sensor";
53 // IoTString ia1 = new IoTString(a1);
56 // System.out.println("Starting System");
66 // // Runtime runTime = Runtime.getRuntime();
67 // // // Process proc = runTime.exec("/opt/vc/bin/vcgencmd measure_temp | tr -d 'temp=' | tr -d \"'C\"");
68 // // Process proc = runTime.exec("/opt/vc/bin/vcgencmd measure_temp");
69 // // BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
70 // // String line = null;
71 // // String dat = "";
72 // // while ((line = reader.readLine()) != null) {
73 // // System.out.println(line);
80 // // String pingTimer = Long.toString(System.currentTimeMillis());
81 // // IoTString ipingTimer = new IoTString(pingTimer);
84 // IoTString senDat = new IoTString(dat);
87 // t1.startTransaction();
88 // t1.addKV(ipingTimerKey, ipingTimer);
89 // t1.addKV(ia1, senDat);
90 // t1.commitTransaction();
98 // Thread.sleep(5000);
100 // } catch (Error e) {
101 // e.printStackTrace();
103 // Runtime runTime = Runtime.getRuntime();
104 // runTime.exec("gpio mode 4 out");
108 // runTime.exec("gpio write 4 1");
109 // Thread.sleep(500);
110 // runTime.exec("gpio write 4 0");
111 // Thread.sleep(500);