Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Updated ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
integraloftheday committed Jul 23, 2020
1 parent d0a38ba commit fe26f06
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 61 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
129 changes: 81 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,122 @@
# Pebble-Imessager
A [PebbleJs](https://github.com/pebble/pebblejs) and Server Application to allow iMessage texting on microphone enabled pebble smartwatches.

## Demo
A [PebbleJs](https://github.com/pebble/pebblejs) and Server Application to allow WhatsApp chatting on microphone enabled pebble smartwatches.

## Demo

![](Demo.gif)

## About
Since the takeover by Fitbit pebble smartwatches could no longer send messages on iPhones. However, using this watch app and server
applications users can once again send iMessage’s from iPhones. To accomplish this the application uses a server running on a Mac (or
[emulated Mac](https://github.com/foxlet/macOS-Simple-KVM)) to send messages.
## About

Using this watch app and server microphone enabled pebbles can reply to WhatApp messages. Based on [GitHub - integraloftheday/Pebble-Imessager: A PebbleJs and Server Application to allow imessage texting on pebble smart watches](https://github.com/integraloftheday/Pebble-Imessager)

## A Security Note

## A Security Note
In the current state all server requests are sent over http which is not encrypted. In the future it is planed
to update this to https to ensure fully encrypted requests. In the meantime, it is recommended to only use this application over local
networks or use a VPN to establish a secure connection to a local network.

## Server Installation
### Requirments
1. A Mac or [emulated Mac](https://github.com/foxlet/macOS-Simple-KVM) with iMessage signed in
2. Xcode Command Line Tools, Can be installed by typeing `xcode-select --install` in terminal
3. Python3 (sometimes included in Xcode Command Line Tools or can be installed at (python.org)[https://www.python.org/])

### Requirments

1. A computer / raspberry pi (Anything that can run node.js)
2. [Node.js]((https://nodejs.org/en/)) installed

### Steps
The simplest way is to use the install.sh script. It only downloads the required files.
1. `curl -o install.sh https://raw.githubusercontent.com/integraloftheday/Pebble-Imessager/master/installer.sh`
2. `sh install.sh` The server should install inside a folder called "PebbleImessageServer"
3. `cd PebbleImessageServer`
4. `sh start.sh` To run the server

The easiest way is to use the install.sh script. It only downloads the required files.

1. `curl -o install.sh https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/installer.sh`

2. `sh install.sh` The server will install inside the directory "PebbleWhatsAppServer"

3. `cd PebbleWhatsAppServer`

4. `node app.js` Run the server

5. Scan the QR code with your phone connecting WhatsApp

To keep the server running [screen](http://www.kinnetica.com/2011/05/29/using-screen-on-mac-os-x/) can be used.
### Configuration
Inside the `PebbleImessageServer` folder there is a file `config.json` which included everything that needs to configured. The file looks like:

```json
### Configuration

Inside the `PebbleWhatsAppServer` folder there is a file `config.json` which included everything that needs to configured. The file looks like:

```json
{
"key":"abc",
"port":5000,
"saveLogin":false,
"contacts":[
{
"buddyName":"Demo",
"displayName":"Demo"
}

{
"buddyName":"Demo",
"displayName":"Demo"
},
]
}
```
The `"key"` is generated in the watch app and must be set to the same value. The `"port"` is what port the server runs on and `"contacts"`
is the list of everyone the watch app can message. Each contact has two fields `"buddyName"` which is the exact name as displayed on the Mac
in iMessages. The `"displayName"` is what name will be displayed in the watch app. As many contacts as needed can be added to `config.json`
below is an example of a config file on port 2020 with 3 contacts. **Note** when editing `config.json` restarting the server is not needed
unless the `"port"` has be edited.

```json
* `"key"` is generated in the watch app and must be set to the same value.

* `"port"` is what port the server runs on

* `"saveLogin"` if set to `true` the server will remember the WhatsApp login.

* `"contacts"` is the list of everyone the watch app can message.

* `"buddyName"` is the WhatsApp id for each contact/group. It follows this pattern for an individual `[country code][phone number]@s.whatsapp.net` for example, ``19999999999@s.whatsapp.net`. For infromation including for groups can be found here: [GitHub - adiwajshing/Baileys: Lightweight full-featured typescript/javascript WhatsApp Web API](https://github.com/adiwajshing/Baileys#sending-messages).

* `"displayName"` is what will be displayed in the WatchApp

**Note** when editing `config.json` restarting the server is not needed
unless the `"port"` has be edited.

```json
{
"key":"abc",
"port":2020,
"contacts":[
{
"buddyName":"Homer Simpson",
"displayName":"Homer"
},
{
"buddyName":"Homer Simpson",
"displayName":"Homer"
},
{
"buddyName":"Marge Simpson",
"displayName":"Marge"
},
{
"buddyName":"Bart Simpson",
"displayName":"Bart"
}
"buddyName":"Marge Simpson",
"displayName":"Marge"
},
{
"buddyName":"Bart Simpson",
"displayName":"Bart"
}
]
}
```
## Watch Installation

## Watch Installation

Currently the watch app needs to be sideloaded but could be added to the rebble store in the future.
### Requirements

### Requirements

1. A microphone enabled pebble watch

2. A [rebble voice subscription](https://rebble.io)
### Side Loading
1. Downloaded the latest .pbw file from the [releases](https://github.com/integraloftheday/Pebble-Imessager/releases) on your phone.
2. Click the share icon then "more" then select "Copy to Pebble"

### Side Loading

3. Downloaded the latest .pbw file from the [releases](https://github.com/integraloftheday/Pebble-Imessager/releases) on your phone.

4. Click the share icon then "more" then select "Copy to Pebble"

The pebble app then will install the watch app.
### Watch App Configuration

### Watch App Configuration

These steps must be done before the watch app can be used.

1. Click "Settings" and scroll to "Server IP" select and enter the Server's IP address and Port Number
2. Click "key Generate" and updated `config.json` to match the key displayed on the watch app
3. Click "Contact Fetch" to update the watches internal contacts. This can be done after any update to `config.json`
4. Click "Current" if everything was entered correctly and working the server IP the key and any contacts should be displayed.
5. Send Messages! by clicking on the contacts name on the main menu.

4 changes: 2 additions & 2 deletions WhatsAppServer/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ app.post("/what/api/v1/send",function(req,res){
var config = JSON.parse(fs.readFileSync("./config.json","utf-8"));
console.log("MessageSend:",req.body);
if(config.key == req.body.key){
try {

try {
console.log("Sending Message")
client.sendTextMessage(req.body.to,req.body.msg);
var response = {"sucess":"true"};
res.status(200).json(response);
Expand Down
5 changes: 0 additions & 5 deletions WhatsAppServer/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
{
"buddyName":"Demo",
"displayName":"Demo"
},
{
"buddyName":"Demo2",
"displayName":"Demo2"
}

]
}
12 changes: 6 additions & 6 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

echo "Creating Node.js Folder"

mkdir PebbleWhatsApp
mkdir PebbleWhatsAppServer

echo "Downloading Required Files"

curl -o PebbleWhatsApp/app.js https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/app.js
curl -o PebbleWhatsAppServer/app.js https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/app.js

curl -o PebbleWhatsApp/config.json https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/config.json
curl -o PebbleWhatsAppServer/config.json https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/config.json

curl -o PebbleWhatsApp/package.json https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/package.json
curl -o PebbleWhatsAppServer/package.json https://raw.githubusercontent.com/integraloftheday/Pebble-WhatsApp/master/WhatsAppServer/package.json

npm install --prefix PebbleWhatsApp/
npm install --prefix PebbleWhatsAppServer/

echo "Now edit config.json to add contacts, to change the port number, and to set the key"

echo "Use node app.js to start the server in side PebbleWahtsApp"
echo "Use node app.js to start the server inside PebbleWhatsAppServer"



0 comments on commit fe26f06

Please sign in to comment.