https://github.com/anthonyec/atm
https://github.com/anthonyec/atm
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anthonyec/atm
- Owner: anthonyec
- Created: 2016-06-21T08:45:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-20T07:53:40.000Z (over 8 years ago)
- Last Synced: 2025-02-13T00:26:25.845Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 531 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Robotic Oracle
# Photon
### Flashing Photon
Compiling and flashing remotely```sh
$ particle flash
```### Terminal utils
Use `netcat` to test simple server communcation```sh
$ netcat
```Use cURL to simulate SMS messages
```sh
$ curl -X POST localhost:4000/sms --data 'From=+4477000000000&Body=EC2A 3AR'
```### Photon Device Modes
https://docs.particle.io/guide/getting-started/modes/core/### Setup WiFi via USB
Please note, the particle **can't** connect to 5GHz networks and only supports 2.4GHz### Connecting to photos from terminal
1. In case you don't have particle-cli, install it by running:
```sh
npm install -g particle-cli
```2. Then login
```sh
$ particle cloud login
```3. To list all devices, and see their offline/online status
```sh
$ particle list
```4. To print a random message from printer
```sh
$ particle call blue printText 'WOW'
```## Production
### Enviroment Variables
Fill out and add these to `~/.bshrc`. Run `. ~/.bashrc` to reload the vars for the current shell.```
export PARTICLE_TOKEN=''
export TWILIO_SID=''
export TWILIO_TOKEN=''
export TWILIO_PHONE_NUMBER=''
export NODE_ENV='' # development | productionexport DB_HOSTNAME=''
export DB_NAME=''
export DB_PASSWORD=''
export DB_USERNAME=''
export TCP_URL=''
export TCP_PORT=''
```### SSH
Production is hosted on DigitalOcean```
$ ssh [email protected]
```### Starting app on Digital ocean
Using https://github.com/foreverjs/forever to run node app in the background.
To start the app
1. SSH into the root
```
$ ssh [email protected]
```2. Go into the atm folder
```
$ cd atm
```3. Start the app
```
$ forever start app.js
```Optionally to stop the app
```
$ forever stop app.js
```## Testing
Manually testing posting the message
```
$ curl -X POST http://localhost:4000/sms -d "Body=n79bu&From=122"
```### See log files of running app
```
$ forever list
```shows log file being used by the currently running application in logfile colum
e.g (/root/.forever/D9ap.log)
```
$ cd /root/.forever/
``````
` tail D9ap.log
```## Misc info
### Printer Specs
- 32 characters per line
- 384 pixels width### WiFi
SSID: ATM_2.4GPASS: c0pb0trulez