Commit 06c12562 authored by VANDAELE Julien's avatar VANDAELE Julien
Browse files

add submission script based on real values

sample_coord.txt file has been made by using the output of `experiment-cli info -l --site lille`, then converting it to csv, and cleaned to obtain only id,x,y,z.
sample_data.txt file has been made by running the 01-sensors-collecting iotlab example in contiki on all available lille's nodes and catching the serial_aggregator output.
The submission script build a dictionnary by reading the data file, then complete the dict with coords of nodes by reading the coord file.
parent c8750927
network_address,x,y,z
m3-1,0.82,0.1,1.5
m3-3,2.02,0.1,1.5
m3-6,3.22,0.1,0.6
m3-9,5.62,0.1,1.5
m3-10,5.62,0.1,0.6
m3-11,6.82,0.1,1.5
m3-14,8.02,0.1,0.6
m3-15,9.22,0.1,1.5
m3-18,10.42,0.1,0.6
m3-19,11.62,0.1,1.5
m3-23,14.02,0.1,1.5
m3-24,14.02,0.1,0.6
m3-26,15.22,0.1,0.6
m3-27,0.1,0.3,1.5
m3-28,0.1,0.3,0.6
m3-29,0.82,0.3,2.6
m3-32,4.42,0.3,2.6
m3-33,5.62,0.3,2.6
m3-34,6.82,0.3,2.6
m3-38,11.62,0.3,2.6
m3-39,12.82,0.3,2.6
m3-40,14.02,0.3,2.6
m3-42,16.1,0.3,2.4
m3-44,16.1,0.3,0.6
m3-47,0.82,1.5,2.6
m3-49,3.22,1.5,2.6
m3-51,5.62,1.5,2.6
m3-52,6.82,1.5,2.6
m3-54,9.22,1.5,2.6
m3-56,11.62,1.5,2.6
m3-57,12.82,1.5,2.6
m3-63,0.1,2.7,1.5
m3-64,0.1,2.7,0.6
m3-65,0.82,2.7,2.6
m3-66,2.02,2.7,2.6
m3-67,3.22,2.7,2.6
m3-70,6.82,2.7,2.6
m3-71,8.02,2.7,2.6
m3-72,9.22,2.7,2.6
m3-73,10.42,2.7,2.6
m3-74,11.62,2.7,2.6
m3-76,14.02,2.7,2.6
m3-79,16.1,2.7,1.5
m3-80,16.1,2.7,0.6
m3-82,0.1,3.9,0.6
m3-83,0.82,3.9,2.6
m3-85,3.22,3.9,2.6
m3-87,5.62,3.9,2.6
m3-88,6.82,3.9,2.6
m3-89,8.02,3.9,2.6
m3-90,9.22,3.9,2.6
m3-91,10.42,3.9,2.6
m3-92,11.62,3.9,2.6
m3-94,14.02,3.9,2.6
m3-95,15.22,3.9,2.6
m3-97,16.1,3.9,1.5
m3-100,0.1,5.1,0.6
m3-102,2.02,5.1,2.6
m3-104,4.42,5.1,2.6
m3-106,6.82,5.1,2.6
m3-108,9.22,5.1,2.6
m3-110,11.62,5.1,2.6
m3-111,12.82,5.1,2.6
m3-113,15.22,5.1,2.6
m3-114,16.1,5.1,2.4
m3-115,16.1,5.1,1.5
m3-116,16.1,5.1,0.6
m3-118,5.42,5.45,0.6
m3-121,14.18,5.1,1.5
m3-122,14.18,5.1,0.6
m3-125,3.22,6.3,2.6
m3-127,5.62,6.3,2.6
m3-128,6.82,6.3,2.6
m3-130,9.22,6.3,2.6
m3-131,10.42,6.3,2.6
m3-132,11.62,6.3,2.6
m3-133,12.82,6.3,2.6
m3-134,14.02,6.3,2.6
m3-135,14.18,6.3,1.5
m3-136,14.18,6.3,0.6
m3-138,2.02,7.5,2.6
m3-140,4.42,7.5,2.6
m3-142,6.82,7.5,2.6
m3-143,8.02,7.5,2.6
m3-144,9.22,7.5,2.6
m3-145,10.42,7.5,2.6
m3-148,14.02,7.5,2.6
m3-149,14.18,7.5,1.5
m3-156,6.82,8.7,2.6
m3-157,8.02,8.7,2.6
m3-159,10.42,8.7,2.6
m3-160,11.62,8.7,2.6
m3-161,12.82,8.7,2.6
m3-163,14.18,8.7,1.5
m3-169,3.22,9.16,1.5
m3-170,3.22,9.16,0.6
m3-173,6.82,9.16,1.5
m3-174,6.82,9.16,0.6
m3-177,9.22,9.16,1.5
m3-178,9.22,9.16,0.6
m3-179,0.82,9.9,2.6
m3-181,3.22,9.9,2.6
m3-182,4.42,9.9,2.6
m3-184,8.02,9.9,2.6
m3-187,11.62,9.9,2.6
m3-188,12.82,9.9,2.6
m3-190,14.18,9.9,1.5
m3-193,2.02,11.1,2.6
m3-194,3.22,11.1,2.6
m3-195,4.42,11.1,2.6
m3-196,5.62,11.1,2.6
m3-197,6.82,11.1,2.6
m3-200,10.42,11.1,2.6
m3-202,12.82,11.1,2.6
m3-203,14.02,11.1,2.6
m3-204,15.22,11.1,2.6
m3-209,5.62,12.3,2.6
m3-210,6.82,12.3,2.6
m3-211,8.02,12.3,2.6
m3-212,9.22,12.3,2.6
m3-213,10.42,12.3,2.6
m3-214,11.62,12.3,2.6
m3-215,12.82,12.3,2.6
m3-216,14.02,12.3,2.6
m3-217,15.22,12.3,2.6
m3-218,0.82,13.5,2.6
m3-219,2.02,13.5,2.6
m3-220,3.22,13.5,2.6
m3-221,4.42,13.5,2.6
m3-223,6.82,13.5,2.6
m3-226,10.42,13.5,2.6
m3-228,12.82,13.5,2.6
m3-229,14.02,13.5,2.6
m3-230,15.22,13.5,2.6
m3-232,2.02,14.7,2.6
m3-233,3.22,14.7,2.6
m3-236,6.82,14.7,2.6
m3-238,9.22,14.7,2.6
m3-239,10.42,14.7,2.6
m3-240,11.62,14.7,2.6
m3-241,12.82,14.7,2.6
m3-243,15.22,14.7,2.6
m3-244,0.82,15.9,2.6
m3-245,2.02,15.9,2.6
m3-246,3.22,15.9,2.6
m3-248,5.62,15.9,2.6
m3-250,8.02,15.9,2.6
m3-253,11.62,15.9,2.6
m3-254,12.82,15.9,2.6
m3-255,14.02,15.9,2.6
m3-256,15.22,15.9,2.6
m3-2,0.82,0.1,0.6
m3-4,2.02,0.1,0.6
m3-5,3.22,0.1,1.5
m3-7,4.42,0.1,1.5
m3-8,4.42,0.1,0.6
m3-12,6.82,0.1,0.6
m3-13,8.02,0.1,1.5
m3-16,9.22,0.1,0.6
m3-17,10.42,0.1,1.5
m3-20,11.62,0.1,0.6
m3-21,12.82,0.1,1.5
m3-22,12.82,0.1,0.6
m3-25,15.22,0.1,1.5
m3-30,2.02,0.3,2.6
m3-31,3.22,0.3,2.6
m3-35,8.02,0.3,2.6
m3-36,9.22,0.3,2.6
m3-37,10.42,0.3,2.6
m3-41,15.22,0.3,2.6
m3-43,16.1,0.3,1.5
m3-45,0.1,1.5,1.5
m3-46,0.1,1.5,0.6
m3-48,2.02,1.5,2.6
m3-50,4.42,1.5,2.6
m3-53,8.02,1.5,2.6
m3-55,10.42,1.5,2.6
m3-58,14.02,1.5,2.6
m3-59,15.22,1.5,2.6
m3-60,16.1,1.5,2.4
m3-61,16.1,1.5,1.5
m3-62,16.1,1.5,0.6
m3-68,4.42,2.7,2.6
m3-69,5.62,2.7,2.6
m3-75,12.82,2.7,2.6
m3-77,15.22,2.7,2.6
m3-78,16.1,2.7,2.4
m3-81,0.1,3.9,1.5
m3-84,2.02,3.9,2.6
m3-86,4.42,3.9,2.6
m3-93,12.82,3.9,2.6
m3-96,16.1,3.9,2.4
m3-98,16.1,3.9,0.6
m3-99,0.1,5.1,1.5
m3-101,0.82,5.1,2.6
m3-103,3.22,5.1,2.6
m3-105,5.62,5.1,2.6
m3-107,8.02,5.1,2.6
m3-109,10.42,5.1,2.6
m3-112,14.02,5.1,2.6
m3-117,5.42,5.45,1.5
m3-119,10.82,5.45,1.5
m3-120,10.82,5.45,0.6
m3-123,0.82,6.3,2.6
m3-124,2.02,6.3,2.6
m3-126,4.42,6.3,2.6
m3-129,8.02,6.3,2.6
m3-137,0.82,7.5,2.6
m3-139,3.22,7.5,2.6
m3-141,5.62,7.5,2.6
m3-146,11.62,7.5,2.6
m3-147,12.82,7.5,2.6
m3-150,14.18,7.5,0.6
m3-151,0.82,8.7,2.6
m3-152,2.02,8.7,2.6
m3-153,3.22,8.7,2.6
m3-154,4.42,8.7,2.6
m3-155,5.62,8.7,2.6
m3-158,9.22,8.7,2.6
m3-162,14.02,8.7,2.6
m3-164,14.18,8.7,0.6
m3-165,0.82,9.16,1.5
m3-166,0.82,9.16,0.6
m3-167,2.02,9.16,1.5
m3-168,2.02,9.16,0.6
m3-171,4.42,9.16,1.5
m3-172,4.42,9.16,0.6
m3-175,8.02,9.16,1.5
m3-176,8.02,9.16,0.6
m3-180,2.02,9.9,2.6
m3-183,6.82,9.9,2.6
m3-185,9.22,9.9,2.6
m3-186,10.42,9.9,2.6
m3-189,14.02,9.9,2.6
m3-191,14.18,9.9,0.6
m3-192,0.82,11.1,2.6
m3-198,8.02,11.1,2.6
m3-199,9.22,11.1,2.6
m3-201,11.62,11.1,2.6
m3-205,0.82,12.3,2.6
m3-206,2.02,12.3,2.6
m3-207,3.22,12.3,2.6
m3-208,4.42,12.3,2.6
m3-222,5.62,13.5,2.6
m3-224,8.02,13.5,2.6
m3-225,9.22,13.5,2.6
m3-227,11.62,13.5,2.6
m3-231,0.82,14.7,2.6
m3-234,4.42,14.7,2.6
m3-235,5.62,14.7,2.6
m3-237,8.02,14.7,2.6
m3-242,14.02,14.7,2.6
m3-247,4.42,15.9,2.6
m3-249,6.82,15.9,2.6
m3-251,9.22,15.9,2.6
m3-252,10.42,15.9,2.6
m3-257, , ,
m3-258, , ,
m3-259, , ,
m3-188;55.618286
m3-135;94.055176
m3-149;67.962646
m3-87;83.633423
m3-169;31.600952
m3-185;8.575439
m3-145;46.386719
m3-161;64.071655
m3-154;59.326172
m3-238;95.108032
m3-131;152.664185
m3-144;57.754517
m3-90;75.927734
m3-26;70.159912
m3-146;50.216675
m3-158;43.075562
m3-209;36.041260
m3-237;96.237183
m3-213;14.389038
m3-52;230.834961
m3-37;149.276733
m3-229;143.997192
m3-36;161.148071
m3-120;87.127686
m3-34;184.326172
m3-84;93.093872
m3-141;71.731567
m3-39;176.925659
m3-33;178.695679
m3-133;83.435059
m3-23;86.761475
m3-62;97.381592
m3-113;121.398926
m3-205;41.442871
m3-98;81.817627
m3-190;50.216675
m3-73;65.521240
m3-38;173.294067
m3-64;127.090454
m3-240;65.032959
m3-208;57.174683
m3-65;100.723267
m3-94;63.903809
m3-242;171.905518
m3-138;77.713013
m3-192;24.688721
m3-156;179.550171
m3-72;73.059082
m3-118;119.308472
m3-54;98.510742
m3-241;150.268555
m3-227;23.849487
m3-10;138.946533
m3-60;111.526489
m3-172;143.218994
m3-207;66.040039
m3-110;57.876587
m3-76;65.597534
m3-70;93.322754
m3-247;233.230591
m3-249;132.110596
m3-168;124.359131
m3-180;8.499146
m3-236;93.719482
m3-107;80.703735
m3-152;73.028564
m3-112;68.557739
m3-245;199.508667
m3-11;200.317383
m3-13;216.918945
m3-189;111.785889
m3-19;118.087769
m3-66;102.416992
m3-111;72.860718
m3-53;123.977661
m3-117;117.446899
m3-108;69.442749
m3-47;108.642578
m3-32;165.481567
m3-171;34.561157
m3-7;210.861206
m3-22;81.954956
m3-194;43.212891
m3-153;365.188599
m3-214;13.732910
m3-9;150.482178
m3-137;74.035645
m3-246;284.027100
m3-182;20.034790
m3-248;252.639771
m3-126;78.079224
m3-115;81.695557
m3-78;90.148926
m3-50;99.166870
m3-106;83.892822
m3-114;108.230591
m3-81;141.265869
m3-179;6.362915
m3-96;90.270996
m3-105;80.413818
m3-170;167.724609
m3-104;80.230713
m3-186;32.501221
m3-86;89.263916
m3-99;130.035400
m3-71;92.300415
m3-45;141.326904
m3-198;16.693115
m3-20;93.704224
m3-199;13.336182
m3-196;22.781372
m3-157;46.936035
m3-93;57.723999
m3-15;205.047607
m3-42;168.624878
m3-256;254.074097
m3-202;61.126709
m3-222;66.238403
m3-12;157.196045
m3-18;116.088867
m3-231;160.507202
m3-211;23.513794
m3-147;66.955566
m3-191;26.199341
m3-25;93.490601
m3-162;121.459961
m3-123;87.768555
m3-210;35.186768
m3-166;88.424683
m3-136;89.996338
m3-225;37.780762
m3-183;22.689819
m3-31;222.991943
m3-14;160.186768
m3-127;75.622559
m3-177;20.248413
m3-91;62.225342
m3-40;162.185669
m3-61;96.115112
m3-83;112.838745
m3-5;273.544312
m3-165;86.318970
m3-82;131.729126
m3-151;78.506470
m3-88;202.804565
m3-174;136.154175
m3-140;73.165894
m3-21;116.577148
m3-103;109.710693
m3-67;107.757568
m3-220;126.296997
m3-176;149.154663
m3-200;10.055542
m3-233;220.657349
m3-159;40.069580
m3-27;115.478516
m3-56;88.836670
m3-223;50.628662
m3-163;57.785034
m3-252;157.043457
m3-6;170.730591
m3-121;98.297119
m3-215;76.217651
m3-2;115.478516
m3-255;252.380371
m3-74;62.164307
m3-125;379.898071
m3-197;28.579712
m3-195;24.887085
m3-139;95.718384
m3-253;183.212280
m3-57;76.690674
m3-155;60.806274
m3-212;20.217896
m3-100;130.905151
m3-230;256.011963
m3-130;111.755371
m3-97;81.848145
m3-235;144.073486
m3-239;75.332642
m3-63;140.136719
m3-17;132.446289
m3-234;193.069458
m3-119;124.755859
m3-217;379.913330
m3-43;117.324829
m3-46;136.367798
m3-124;90.637207
m3-228;94.711304
m3-4;145.874023
m3-30;197.875977
m3-59;115.264893
m3-226;28.915405
m3-250;166.244507
m3-16;144.561768
m3-92;65.246582
m3-69;88.348389
m3-109;61.416626
m3-29;137.832642
m3-193;25.009155
m3-164;51.940918
m3-184;19.012451
m3-102;89.965820
m3-148;123.291016
m3-219;61.279297
m3-122;106.307983
m3-218;75.607300
m3-85;391.815186
m3-181;22.033691
m3-143;63.949585
m3-244;232.299805
m3-77;101.348877
m3-173;42.800903
m3-175;32.150269
m3-24;75.790405
m3-167;113.113403
m3-49;449.203491
m3-134;154.800415
m3-232;123.779297
m3-51;99.548340
m3-132;65.917969
m3-75;57.128906
m3-89;100.341797
m3-28;108.215332
m3-254;264.511108
m3-203;100.357056
m3-116;70.343018
m3-142;77.301025
m3-95;99.761963
m3-201;9.796143
m3-58;76.339722
m3-243;167.602539
m3-187;34.347534
m3-221;113.113403
m3-224;41.427612
m3-204;148.880005
m3-48;116.531372
#!/usr/bin/python
from subprocess import call
data = dict()
# 1 - load light measures (format: id;measure)
fo = open("sample_data.txt", "r")
for line in fo:
line = line.replace('\n','')
id, light = line.split(";")
data[id] = {'light': light}
fo.close()
# 2 - append coord (format: id,x,y,z)
fo = open("sample_coord.txt", "r")
fo.readline()
for line in fo:
line = line.replace('\n','')
id, x, y, z = line.split(",")
if(id in data):
data[id].update({'x': x, 'y': y, 'z': z})
fo.close()
for key, value in data.iteritems():
json = '{"id": "%s", "position": {"x": %s, "y": %s}, "value": %s}' % (key, value['y'], value['x'], value['light'])
# print json
call(["curl","-X", "POST", "--header", "Content-Type: application/json", "--header", "Accept: application/json", "-d" , json, "http://localhost:8080/measure"])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment