{"id":16861193,"url":"https://github.com/limzykenneth/p5bots-server","last_synced_at":"2025-10-24T22:02:06.228Z","repository":{"id":90786074,"uuid":"51362870","full_name":"limzykenneth/p5bots-server","owner":"limzykenneth","description":null,"archived":false,"fork":false,"pushed_at":"2016-02-09T11:30:34.000Z","size":375,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T14:51:15.635Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/limzykenneth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-09T11:29:56.000Z","updated_at":"2016-02-09T11:30:35.000Z","dependencies_parsed_at":"2023-04-29T17:43:43.851Z","dependency_job_id":null,"html_url":"https://github.com/limzykenneth/p5bots-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/limzykenneth/p5bots-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limzykenneth%2Fp5bots-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limzykenneth%2Fp5bots-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limzykenneth%2Fp5bots-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limzykenneth%2Fp5bots-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limzykenneth","download_url":"https://codeload.github.com/limzykenneth/p5bots-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limzykenneth%2Fp5bots-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275399929,"owners_count":25457790,"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","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-13T14:30:01.317Z","updated_at":"2025-09-16T10:04:07.871Z","avatar_url":"https://github.com/limzykenneth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# p5bots-server\n\nThese are the files necessary for the server end of the p5bots setup. While the instructions below help you get the example file up and running, you'll need the [client-side library](https://github.com/sarahgp/p5bots) as well to make your own work with the p5 and p5bots APIs.\n\n## Setup\n\n### Arduino\n1. Download [Arduino IDE](https://www.arduino.cc/en/main/software).\n2. Upload `File \u003e Examples \u003e Firmata \u003e StandardFirmata` to your board. To do this, you'll have to select your board and serial port from the `Tools` menu. ([More instructions from Arduino.](https://www.arduino.cc/en/Guide/MacOSX)) \n  **Note:** If you are only using serial, you can skip this step.\n3. Write down the port your board is using; you may need it later.\n\n### Javascript\n1. Install node \u0026 npm if you haven't already; be sure you have node 0.12.x+ and npm 2.0.x+. Installing and updating node with [homebrew](http://blog.teamtreehouse.com/install-node-js-npm-mac) is probably the easiest approach. You can [update npm using npm](https://docs.npmjs.com/getting-started/installing-node).\n2. Install p5bots server. It's easier to use if you do it globally: \n```\nnpm install -g p5bots-server\n```\n\nbut if you don't have root access to your computer or just wanna keep things local, that's chill, too:\n\n```\nnpm install p5bots-server\n```\n\n## Run Examples\n\nTo test your setup, you can run any of the examples in `examples/quicktest.js`. (It's inside the `/usr/local/lib/node_modules/p5bots-server` folder.)\n\nCurrently, the RGB LED test is uncommented. To run it, set up the breadboard like this:\n\n![rgb led layout with red in 9, green in 10, and blue in 11, plus resistors between board and leg; ground is to ground/](img/rgb_led.png)\n\n_This setup uses a common-anode RGB led. The pin with the longest leg is the anode, and should go into the hole connected to ground. Red is pin 9, green 10, blue 11._\n\nIf you installed globally, run:\n\n```js\nbots-go -d 'node_modules/p5bots-server/example'\n```\n\nIf you installed locally, you can run:\n\n```\nnode ./node_modules/.bin/bots-go -d './node_modules/p5bots-server/example'\n```\n\nor navigate to `node_modules/p5bots-server` and run:\n\n```\nnpm run examples-go\n```\n\nOpen your browser to `localhost:8000` and you should see a circle whose color is also displayed on your RGB Led. Try pressing the arrow keys.\n\nFor other examples, check out `p5bots-server/example/quicktest.js` and try other layouts. From the `/p5bots-server` folder, you can run `npm run examples-go` to get the server up.\n\n## Common Errors\n\n### Ports\nIf you get an error telling you the board cannot be found, or something like:\n\n```js\nError: Error: Cannot open /dev/cu.usbmodem1421\n```\n\nyou may have to adjust [the board declaration in `quicktest.js`](https://github.com/sarahgp/p5bots/blob/master/src/p5bots-server/example/quicktest.js#L53).\n\nEither use the port you noted down in setup, assuming you haven't moved the board, or check out the console, where we are listing the ports via the serial command. The one that looks like `/dev/cu.*` is likely the one you need.\n\n### Installing via NPM\nIf when installing the package you get something like:\n```\nnpm ERR!   errno: 3,\nnpm ERR!   code: 'EACCES',\nnpm ERR!   path: '/usr/local/lib/node_modules/p5bots-server',\nnpm ERR!   fstream_type: 'Directory',\nnpm ERR!   fstream_path: '/usr/local/lib/node_modules/p5bots-server',\nnpm ERR!   fstream_class: 'DirWriter',\nnpm ERR!   fstream_stack:\nnpm ERR!    [\n'/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',\nnpm ERR!\n'/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',\nnpm ERR!      'Object.oncomplete (fs.js:107:15)' ] }\nnpm ERR!\nnpm ERR! Please try running this command again as root/Administrator.\n```\nyou may have to install using \n\n```\nsudo install -g p5bots-server\n```\n\nor else install locally.\n\n## Command Line Options\n\n`bots-go` can be run with the following options:\n\n```\n-d, --dir \u003cd\u003e        Set base directory for server\n-f, --file \u003cf\u003e       Set file to use for the index page\n-p, --ufilepath \u003cp\u003e  Path to file containing user-defined server-side listeners.\n-n, --ufilename \u003cn\u003e  Path, inluding file name, to user-defined server-side listeners.\n```\n\nYou can also find these by running\n\n```js\nnode ./app.js -h\n```\nin the `p5bots-server` directory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimzykenneth%2Fp5bots-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimzykenneth%2Fp5bots-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimzykenneth%2Fp5bots-server/lists"}