alidron / spyrk Goto Github PK
View Code? Open in Web Editor NEWPython module for Spark devices (see spark.io)
License: GNU Lesser General Public License v3.0
Python module for Spark devices (see spark.io)
License: GNU Lesser General Public License v3.0
When using Particle Photon/Core for data logging, namely reading I/O pins based on certain interval, sometimes my program just hangs there: no new data reading and also no exception. The reason is because right now in spark_cloud, no timeout is specified for RESTful request.
@AxelVoitier please let me know if this is the correct way to surface this: The spyrk version available from pypi is years old now.
Any plans to release a new version? The current one breaks because the fix from the pull request #6 is missing
The particle Api defines stream events that allows the core/photon to push event to subscribers.
Spyrk should be updated to handle the following REST API endpoints:
/v1/events
/v1/events/{EVENT_PREFIX}
/v1/devices/events
/v1/devices/events/{EVENT_PREFIX}
/v1/devices/{DEVICE_ID}/events
/v1/devices/{DEVICE_ID}/events/{EVENT_PREFIX}
Note: {DEVICE_ID} can also be {DEVICE_NAME}
The returned events of these endpoints looks like this:
bash$ curl -H "Authorization: Bearer <put your token>" https://api.spark.io/v1/events
:ok
event: Reading
data: {"data":"9904;0;0","ttl":"60","published_at":"2015-06-03T21:18:42.980Z","coreid":"54ff6d066678574935340167"}
event: settings
data: {"data":"{\"t\":\"1\",\"v\":\"20\",\"t2\":\"1\",\"v2\":\"20\",\"u\":\"F\",\"p\":\"5\"}","ttl":"60","published_at":"2015-06-03T21:18:42.984Z","coreid":"51ff6a065067545732320187"}
event: emergence-event
data: {"data":"0","ttl":"60","published_at":"2015-06-03T21:18:43.189Z","coreid":"53ff70066667574849402167"}
event: tempeature
data: {"data":"C","ttl":"60","published_at":"2015-06-03T21:18:43.191Z","coreid":"53ff6c065075535135071587"}
event: sensors
data: {"data":"b:-3;rb:75;d:0;rd:73;mo:0;m:2032;h:1927;c:2100;l:0","ttl":"60","published_at":"2015-06-03T21:18:43.208Z","coreid":"53ff6a066667574853222067"}
event: tmpInfo
data: {"data":"Temperature: 78.57 Fahrenheit","ttl":"60","published_at":"2015-06-03T21:18:43.271Z","coreid":"53ff6e066667574836061267"}
event: pfarmer/in_temp
data: {"data":"17.77","ttl":"60","published_at":"2015-06-03T21:18:43.311Z","coreid":"53ff6c065067544849371287"}
event: TempF
data: {"data":"78.57","ttl":"60","published_at":"2015-06-03T21:18:43.351Z","coreid":"53ff6a066667574827542567"}
event: status
data: {"data":"{\"pump\":0,\"salt\":0}","ttl":"60","published_at":"2015-06-03T21:18:43.353Z","coreid":"55ff6a064989495333252587"}
event: Pressure
data: {"data":"29.82","ttl":"60","published_at":"2015-06-03T21:18:43.354Z","coreid":"53ff6a066667574827542567"}
event: DEBUG:GET REQUEST URL
data: {"data":"/stest.php?name=humedad&value=42.400002&coreid=55ff6e0666785055","ttl":"60","published_at":"2015-06-03T21:18:43.677Z","coreid":"55ff6e066678505539251367"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.