{"_id":"5b424d7ecc1a9a000323c020","project":"5511fc8c0c1a08190077f90c","version":{"_id":"5511fc8d0c1a08190077f90f","__v":13,"project":"5511fc8c0c1a08190077f90c","createdAt":"2015-03-25T00:08:45.273Z","releaseDate":"2015-03-25T00:08:45.273Z","categories":["5511fc8d0c1a08190077f910","5511fd52c1b13537009f5d31","568ecb0cbeb2700d004717ee","568ecb149ebef90d0087271a","568ecb1cbdb9260d00149d42","56a6a012b3ffe00d00156f1e","56a6bfe37ef6620d00e2f25f","58fbccb5809fc30f00f2dc03","58fbcd136b29580f00d8ff3a","5942ec4d50b8a900373ce9ff","59481476d305c20019295d8c","5a8c51f42566820088ac230a","5a8c5217be0d21001d924692"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"5942ec4d50b8a900373ce9ff","project":"5511fc8c0c1a08190077f90c","version":"5511fc8d0c1a08190077f90f","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-06-15T20:21:33.617Z","from_sync":false,"order":3,"slug":"buzz-box-mobile-app","title":"OSBeehives App"},"user":"58fbcc0bd8c0ba0f00cf52d6","githubsync":"","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-07-08T17:44:30.402Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"You can use the OSBeehives App to set up real-time data forwarding between our cloud and your own server. This allows you to store the data on your own and process it however you like. We have created an Open Data Server template that you can clone for free in this address:\n\nhttps://github.com/opensourcebeehives/OpenDataServer\n\nThe server is a Python-based API that exposes two endpoints: measurements and audioevents.\nYou can redefine the functions to process measurements and audioevents. By default, they will just write the data to a .csv file.\n\nOnce the server is set up and running, you can use the Data Server URL field in the Settings screen to enter your server's http(s)://URL:PORT or http(s)://IP:PORT. Don't add a slash (/) to the end of the URL. Once you tap \"Submit Changes\", all the following data will automatically be forwarded to your server.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/a3d5e0a-Docs---Data-Redirects.jpg\",\n        \"Docs---Data-Redirects.jpg\",\n        1600,\n        900,\n        \"#e8a431\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"TESTING\"\n}\n[/block]\nYou can test the server by using CURL, Postman, ARC or any other tool that allows you to perform HTTP POST requests:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST http://URL:PORT/measurements < new_measurement.json\\n\\n# new_measurement.json\\n{\\n\\t\\t\\\"measurement\\\":{\\n    \\t\\\"published_at\\\": \\\"2018-06-18 17:12:47.158\\\",\\n      \\\"device_id\\\": \\\"000000000000000000000000\\\",\\n      \\\"temp_c_in\\\": 27.4,\\n      \\\"temp_c_out\\\": 18.05,\\n      \\\"pressure_out\\\": 762,\\n      \\\"rhumidity_out\\\": 72,\\n      \\\"rhumidity_in\\\": 27,\\n      \\\"battery_charge\\\": 100,\\n      \\\"battery_health\\\": 100,\\n      \\\"solar_charge\\\": 3,\\n      \\\"rssi\\\": -5,\\n      \\\"wifi_packet_loss\\\": 1,\\n      \\\"audio_packet_loss\\\": 1,\\n      \\\"lat\\\": 0,\\n      \\\"lon\\\": 0, \\n      \\\"weather_main\\\": \\\"Scattered Clouds\\\",\\n      \\\"wind_speed\\\": 3,\\n      \\\"wind_angle\\\": 30\\n    }\\n}\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST http://URL:PORT/audioevents < new_audioevent.json\\n\\n# new_measurement.json\\n{\\n\\t\\\"audioevent\\\":{\\n  \\t\\\"published_at\\\": \\\"2018-06-18 17:12:47.158\\\",\\n    \\\"device_id\\\": \\\"000000000000000000000000\\\",\\n    \\\"event_type\\\": \\\"Active\\\",\\n    \\\"s3_url\\\": \\\"https://s3-us-west-2.amazonaws.com/osbhbuzzboxrecordings/0000.mp3\\\" \\t}\\n}\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"real-time-data-forwarding","type":"basic","title":"Real-time Data Forwarding"}

Real-time Data Forwarding


You can use the OSBeehives App to set up real-time data forwarding between our cloud and your own server. This allows you to store the data on your own and process it however you like. We have created an Open Data Server template that you can clone for free in this address: https://github.com/opensourcebeehives/OpenDataServer The server is a Python-based API that exposes two endpoints: measurements and audioevents. You can redefine the functions to process measurements and audioevents. By default, they will just write the data to a .csv file. Once the server is set up and running, you can use the Data Server URL field in the Settings screen to enter your server's http(s)://URL:PORT or http(s)://IP:PORT. Don't add a slash (/) to the end of the URL. Once you tap "Submit Changes", all the following data will automatically be forwarded to your server. [block:image] { "images": [ { "image": [ "https://files.readme.io/a3d5e0a-Docs---Data-Redirects.jpg", "Docs---Data-Redirects.jpg", 1600, 900, "#e8a431" ] } ] } [/block] [block:api-header] { "title": "TESTING" } [/block] You can test the server by using CURL, Postman, ARC or any other tool that allows you to perform HTTP POST requests: [block:code] { "codes": [ { "code": "curl -X POST http://URL:PORT/measurements < new_measurement.json\n\n# new_measurement.json\n{\n\t\t\"measurement\":{\n \t\"published_at\": \"2018-06-18 17:12:47.158\",\n \"device_id\": \"000000000000000000000000\",\n \"temp_c_in\": 27.4,\n \"temp_c_out\": 18.05,\n \"pressure_out\": 762,\n \"rhumidity_out\": 72,\n \"rhumidity_in\": 27,\n \"battery_charge\": 100,\n \"battery_health\": 100,\n \"solar_charge\": 3,\n \"rssi\": -5,\n \"wifi_packet_loss\": 1,\n \"audio_packet_loss\": 1,\n \"lat\": 0,\n \"lon\": 0, \n \"weather_main\": \"Scattered Clouds\",\n \"wind_speed\": 3,\n \"wind_angle\": 30\n }\n}", "language": "curl" } ] } [/block] [block:code] { "codes": [ { "code": "curl -X POST http://URL:PORT/audioevents < new_audioevent.json\n\n# new_measurement.json\n{\n\t\"audioevent\":{\n \t\"published_at\": \"2018-06-18 17:12:47.158\",\n \"device_id\": \"000000000000000000000000\",\n \"event_type\": \"Active\",\n \"s3_url\": \"https://s3-us-west-2.amazonaws.com/osbhbuzzboxrecordings/0000.mp3\" \t}\n}", "language": "curl" } ] } [/block]