{"id":22468533,"url":"https://github.com/projectweekend/pi-system-rpc-service","last_synced_at":"2025-03-27T15:44:41.740Z","repository":{"id":23890086,"uuid":"27269477","full_name":"projectweekend/Pi-System-RPC-Service","owner":"projectweekend","description":"An RPC service providing system data from a Raspberry Pi using RabbitMQ","archived":false,"fork":false,"pushed_at":"2014-12-03T18:45:37.000Z","size":220,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T19:29:49.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projectweekend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-28T14:05:53.000Z","updated_at":"2019-10-31T20:53:00.000Z","dependencies_parsed_at":"2022-08-22T06:51:12.123Z","dependency_job_id":null,"html_url":"https://github.com/projectweekend/Pi-System-RPC-Service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectweekend%2FPi-System-RPC-Service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectweekend%2FPi-System-RPC-Service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectweekend%2FPi-System-RPC-Service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectweekend%2FPi-System-RPC-Service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectweekend","download_url":"https://codeload.github.com/projectweekend/Pi-System-RPC-Service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245874206,"owners_count":20686726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T11:17:18.542Z","updated_at":"2025-03-27T15:44:41.705Z","avatar_url":"https://github.com/projectweekend.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This project runs on a Raspberry Pi. **Pi-System-RPC-Service** connects to a [RabbitMQ](http://www.rabbitmq.com/) server and listens for messages. When a message is received on the appropriate queue, some system data is gathered (only CPU temperature for now) and returned to the client that sent the message. This architecture makes it simple for any process, running anywhere (like [Holly](https://github.com/projectweekend/Holly)), to access this data as needed.\n\n\n### Installation with Fabric\n\nUsing [Fabric](http://www.fabfile.org/) there is an installation task included in this project's `fabfile`. With the Raspberry Pi connected to the same network as your computer, run the following command:\n\n```\nfab raspberry_pi install\n```\n\nThe task will prompt you for these values:\n\n* `Raspberry Pi:` - The hostname of the Raspberry Pi, for example: `red-dwarf`. Given the example, the Fabric script will attempt to ssh into `red-dwarf.local`.\n* `Loggly token:` - The token from your [Loggly](https://www.loggly.com/) account. The service logs data using Loggly which makes it easier to remotely monitor.\n* `Loggly domain:` - The domain from your Loggly account.\n* `Rabbit URL:` - The connection URL for the RabbitMQ server. If you don't feel like running your own, check out [CloudAMPQ](https://www.cloudamqp.com/).\n\nThe install process will add an [Upstart](http://upstart.ubuntu.com/) script that will handle starting/stopping the service when the Raspberry Pi starts up or shuts down.\n\nTo manually stop it:\n```\nsudo service system-rpc stop\n```\n\nTo manually start it:\n```\nsudo service system-rpc start\n```\n\n\n### Usage\n\nAny script or program can request data from this service provided:\n\n* It has the same `Rabbit URL` value used during installation and can connect to the RabbitMQ server.\n* It sends messages to the correct queue (`system.get` in this project).\n\n#### JavaScript Example\n\nThere are plenty of JavaScript client libraries for RabbitMQ. This example uses [Jackrabbit](https://github.com/hunterloftis/jackrabbit).\n\n```javascript\nvar jackrabbit = require( \"jackrabbit\" );\n\n// Use an environment variable for RABBIT_URL\nvar broker = jackrabbit( process.env.RABBIT_URL, 1 );\n\nvar ready = function () {\n    // Send a message to request the system data\n    broker.publish( \"system.get\", {}, function ( err, data ) {\n        if ( err ) {\n            // Do something with the error\n            console.log( err );\n        }\n        // Do something with the sensor data\n        console.log( data );\n        process.exit();\n    } );\n};\n\nvar create = function () {\n  broker.create( \"system.get\", { prefetch: 5 }, ready );\n};\n\nbroker.once( \"connected\", create );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectweekend%2Fpi-system-rpc-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectweekend%2Fpi-system-rpc-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectweekend%2Fpi-system-rpc-service/lists"}