Files
POC-Java/README.md
2017-03-01 12:16:21 -06:00

87 lines
2.5 KiB
Markdown

# Henry POC
## Written in Java for Intel Edison Board
# Edison Configuration
After configuring the Intel Edison via the config utility, software should be installed:
## SD Card Configuration
The Mongo DB will be stored on the SD card. This will ensure that the OS partition does not fill up. Insert an SD Card formatted to FAT32 into the SD card slot.
```
mkdir /media/sdcard/db
mkdir /data
ln -s /media/sdcard/db /data/db
```
## Mongo DB
We'll be installing version 2.6.12 since it's the last version to support 32-bit OS.
```
cd ~
wget https://fastdl.mongodb.org/linux/mongodb-linux-i686-2.6.12.tgz
mkdir ~/bin
cd ~/bin
tar -xvzf ../mongodb-linux-i686-2.6.12.tgz
```
Create a systemd script at /etc/systemd/system/mongod.service with the contents:
```
[Unit]
Description=Mongo is a scalable, document-oriented database.
After=syslog.target network.target
[Service]
ExecStart=/home/root/bin/mongodb-linux-i686-2.6.12/bin/mongod --journal
[Install]
WantedBy=multi-user.target
```
Enable the systemd script with:
```
systemctl enable mongod.service
```
# Local Web API
## Endpoint `/config?`
### `update=<doUpdate:string>`
- if doUpdate = `true`, the well configuration will be updated.
- returns `{"configUpdated: <result>"}`
### `fluidOilRatio=<newRatio:double>`
- sets the fluidOilRatio (BBL oil to every 1 BBL fluid producted) to `newRatio`
- returns `{"fluidOilRatio": <fluidOilRatio>}`
### `fluidWaterRatio=<newRatio:double>`
- sets the fluidWaterRatio (BBL water to every 1 BBL fluid producted) to `newRatio`
- returns `{"fluidWaterRatio": <fluidWaterRatio>}`
### `fluidGasMCFRatio=<newRatio:double>`
- sets the fluidGasMCFRatio (MCF gas to every 1 BBL fluid producted) to `newRatio`
- returns `{"fluidGasMCFRatio": <fluidGasMCFRatio>}`
### `pumpOffSetpoint=<newSetpoint:double>`
- sets the pump-off fill percent setpoint to `newSetpoint`
- returns `{"pumpOffSetpoint": <pumpOffSetpoint>}`
### `pumpOffStrokes=<newSetpoint:long>`
- sets the number of low-fillage strokes required for pump-off to `newSetpoint`
- returns `{"pumpOffStrokes": <pumpOffStrokes>}`
### `pumpOffDowntime=<newSetpoint:long>`
- sets the minutes of downtime after pumpoff to `newSetpoint`
- returns `{"pumpOffDowntime": <pumpOffDowntime>}`
## Endpoint `/command?`
### `start=<startCommand:string>`
- if startCommand = `true`, the well will attempt to start.
- returns `{"startCommand: <result>", "status": <runStatus>}`
### `stop=<startCommand:string>`
- if stopCommand = `true`, the well will attempt to stop.
- returns `{"stopCommand: <result>", "status": <runStatus>}`